Ultima VII music engine

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Tribun

Ultima VII music engine

Post by Tribun »

I really want to talk about the Ultima VII music engine. Many don't appreciate how complex it is, and sadly Exult still isn't capable of really emulating it properly. Please note that I got all of that just from observation, I'm no code-guy.

There are verious situations for the music engine:

Normal situation- no enemies nearby.

1.)Ambient sounds (their own track) are played.
2.)Once you enter a zone with music, the music in question is triggered.
=>If you stay inside the zone of the music, it'll loop all the time, even if talking or gumps are open.
=>If you leave the zone of the music, it'll end the current loop and then return to ambient sounds.
=>Some areas delete the music trigger once you leave them (like the stables at the start), but loop as long as you are inside them.
3.)Entering a different music zone while another music is playing will terminate that loop instantly and start the new music.

The carpet and ship have their own music:

1.)Using the carpet or ship, any other music replaced by the special music for them.
2.)However, their music is not abolute and other music triggers do override their music (nearby locations).
3.)Interestingly, their music is not programmed to loop.
4.)Disenganging the transportation instantly kills any kind of music, regardless which one, and returns to ambient music. Moving right after disenganging, if you are in a music area, starts the fitting area music.

Dungeon music is special:

Dungeon music can only start if the program registers you are underground (through blacking out the environment outside the dungeon). It basically is the ambient sound of underground areas and always on if there is no other music. It also can't be triggered by flying over the mountains (though other music can) since it's bound to the underground-flag.

Then of course the are danger and battle music. Each music has it's own condidtion:

1.)Enemy is approaching. That music is triggered to take priority over all other music triggers until the situation is resolved (battle or enough distance).
2.)Enemy closing in. Triggered when a certain distance is entered. Again takes priority until the situation is resolved in one way or another.
3.)Battle music. Enter combat mody with active enemies nearby (entering combat mode itself is no trigger, it needs the condition). Battle music takes priority over everything until the following conditions are met.
4.)Victory. Alle enemies are slewn. There is a small music for easy victories. If combat takes a certain amount of time (in-game timeer), then the big victory fanfare is played.
5.)Peril-music. Leaving combat mode in the middle of battle starts this music. It stays on even after re-entering battle and only ends with victory, death or running away.

Note that the system is flexible, so sometimes fighting and killing a single enemy won't trigger music.


This is quite a complex system (and there surely is more to it) and it's sad that Exult implements it poorly.

-Area looping doesn't work, either the song only plays once, or loops until a different music is played, thus eliminating ambient sounds. Just staying in an area doesn't trigger looping, only the triggers at its edge work and have to be triggered by walking over them.
-The in-game loading system - when loading from the menu instead of the title screen - breaks a lot of music triggers which only work again when exiting the game and then reloading from the title screen. That especially goes for the danger and battle musics as well as the dungeon music.

It's my hope that beside fixing the problem with the loading menu, that looping beside disabled and continuous also is implemented with the original behavior of looping depeanding on area.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Ultima VII music engine

Post by Dominus »

it's mostly down to someone coding it properly...
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
agentorangeguy
Posts: 565
Joined: Thu May 14, 2020 1:34 pm

Re: Ultima VII music engine

Post by agentorangeguy »

There is also a "escape the dangerous situation" music, track 18 i think if you open up the cheat menu alt-1 and play it. It never plays on Exult, to my knowledge. It would play if you were out of range of a bad guy but never entered combat mode I think.
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
agentorangeguy
Posts: 565
Joined: Thu May 14, 2020 1:34 pm

Re: Ultima VII music engine

Post by agentorangeguy »

Whoops, track 8 that is
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
agentorangeguy
Posts: 565
Joined: Thu May 14, 2020 1:34 pm

Re: Ultima VII music engine

Post by agentorangeguy »

oh wait, i was right... it IS track 18
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
Gotcha!
Posts: 354
Joined: Thu May 14, 2020 1:34 pm

Re: Ultima VII music engine

Post by Gotcha! »

I believe you're right, agentorangeguy; I share the same experience.
Locked