the song playing changes after the scene finishes loading

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
User avatar
jayhova
Posts: 924
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

the song playing changes after the scene finishes loading

Post by jayhova »

I've noticed a tendency for DFU to play music, render the scene, then switch to a different song. Has anyone else noted this behavior?
Remember always 'What would Julian Do?'.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: the song playing changes after the scene finishes loading

Post by pango »

DFU keeps 3 SongManager(s) around, one for interiors, one for exteriors, one for dungeons.
When switching from one condition to the other, control is given to the appropriate SongManager, but it only switches tunes during Update(), hence when the game is rendering scene.
So if scenes get slow to load, hence are not rendering for a noticeable amount of time, you may be hearing transitory music (say, the last tune played by the same SongManager; So if you left a tavern, enter a bank, you may be hearing last tavern song for a moment before switching to bank tune).
I'm not sure how it could be fixed in a simple and clean way.

That's a difficult issue in general. Daggerfall Unity has a modular architecture that helps handle complexity. However modules update their states independently, so many of transitory states can happen if nothing is done about it...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
jayhova
Posts: 924
Joined: Wed Jul 19, 2017 7:54 pm
Contact:

Re: the song playing changes after the scene finishes loading

Post by jayhova »

It would seem like a good idea to change the song prior to rendering the scene since the song starts playing first. Perhaps when changing locations there should be a scene change queued with location info and this info is read by the module that plays the music. That is to say if I am fast traveling it's known where and when I will be when the next scene is rendered. Obviously this info has to be available and is available when the music changes.
Remember always 'What would Julian Do?'.

User avatar
Elricwulf
Posts: 12
Joined: Mon Jan 06, 2020 10:22 pm

Re: the song playing changes after the scene finishes loading

Post by Elricwulf »

jayhova wrote: Tue Dec 31, 2019 3:11 am I've noticed a tendency for DFU to play music, render the scene, then switch to a different song. Has anyone else noted this behavior?
Yes.. What I've noticed specifically, when entering Dungeons is that sometimes the music changes about 2-3 times (per my last crypt venture) It was a graveyard, with exterior dungeon music playing...
1 Exterior dungeon music stops after clicking on door..
2 Overland music begins (night time)
3 Dungeon music starts, then dungeon is finished loading

Maybe one way to handle this, according to the way Unity handles it, per pango..

1 Upon clicking on a dungeon door, If the other 2 handlers can be stopped somehow and the dungeon music started. That way if the dungeon music is playing during a load it will just set the mood for the dungeon you are about to enter
2 Alternately, just keep any external dungeon music that is currently playing and simply start the dungeon music when it loads.
(Just ideas, not sure how difficult this is to implement without looking at the DF Unity code..) I'm not sure why the overland music would start in the middle of the load when you are entering a dungeon, but I'm guessing it has something to do with how & when the 3 separate handlers are initialized/called.

Post Reply