The problem was first spotted in BG:EE, but this report is a test case for BGII:EE. It is a continuation of this topic created in wrong forum section: http://forum.baldursgate.com/discussion/34913/the-battle-music#latest
Please read that topic if you find this post confusing.
Expected behavior: All music songs assigned in SONGLIST.2DA should work, day/night music should end combat ends.
Current behavior: Some slots in SONGLIST.2DA are broken. If the music track is assigned to broken slot the combat music continues until resting or leaving area (or if the combat music is also assigned to broken slot it won't start at all).
Let's test it on AR4000 in BG2:EE. In the attached file you will find:
- updated "songlist.2da" with additional BG:EE song entries from BG:EE
- music folder with 2 MUS files and corresponding directories with ACM files - "pday" and "fday"
- AR4000.ARE with following songs assigned: Day song: PDay - 136, Night song: FDay - 127, Victory song: BP2 - 57, Battle song: BP2 - 57, Defeat song: BP2 - 57 (as you can see I've changed Day and Night song entries to use BG:EE tracks)
Here is how it can be tested:
1. Download attached file and extract it to your BG2:EE directory
2. Start a new ToB game or teleport to AR4000 using clua console: CLUAConsole:MoveToArea("ar4000")
3. If it is a night time you will hear "FDay" song correctly - everything OK
4. Rest 12 hours. When it is a day time you won't be able to hear "PDay" song that is assigned to Day slot. For some reason it does not trigger at all.
5. Now let's test the battle music: CLUAConsole:CreateCreature("gnollsu")
6. At night time when the battle is over the music will be properly stopped, but if you killed the monster at day time the music won't stop because the engine refuse to start the "PDay" song as I mentioned above. The only way to fix it is saving + loading the game or resting.
7. Exit the game and open the SONGLIST.2DA and swap the music entries (assign Pday slot 127 and FDay to 136)
8. Do the whole test again with the modified SONGLIST.2DA file - as you can see this time Pday song will work fine and the FDay song will be broken - this is a proof that this is not a problem with MUS structure or ACM files, but the engine bug with reading from SONGLIST.2DA. Songs will not play at all if they are placed in broken slots and whenever the engine has problem with playing a Day/Night song it will also bug the battle music song when the battle is finished (unless the battle music is also assigned to broken slot - in such case it won't play at all). 2 problems in 1.
There are more broken music slots- this is just an example. The engine is definitely bugged and fixing the root of the cause, may as well fix the battle music problem reported by other players.