0.10.12 - Dungeon Soundtrack does not change when entering another dungeon [RESOLVED 0.10.14]

Bug topics that have been resolved.
Locked
User avatar
The Holy Knight
Posts: 40
Joined: Wed Jun 26, 2019 11:51 pm

0.10.12 - Dungeon Soundtrack does not change when entering another dungeon [RESOLVED 0.10.14]

Post by The Holy Knight » Tue Nov 26, 2019 6:04 am

What I mean is that the first dungeon you enter the music for that dungeon is what you will hear in every other dungeon. I thought it was the Vanilla music Mod doing this but ive updated my game to 0.10.12 without the mod and the problem persists even then. The soundtrack of the first dungeon I enter when starting the game up will play in any other dungeon I go to next.

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

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by pango » Tue Nov 26, 2019 9:39 pm

Thanks for the bug report, I can reproduce it indeed.

Technical details: Intering, Exterior and Dungeon hierarchies have their own SongPlayer, each with their own SongManager component.
SongManagers detect changes in music context, when they happen select the adequate playlist, and when the playlist changes, pick a new song in the new playlist.
Problem is, dungeons only have one playlist, so the SongManager of dungeons only picks a song once.
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
The Holy Knight
Posts: 40
Joined: Wed Jun 26, 2019 11:51 pm

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by The Holy Knight » Tue Nov 26, 2019 9:57 pm

Is that patchable? or does it have to do with the Unity engine itself?

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

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by pango » Tue Nov 26, 2019 10:15 pm

Those are Daggerfall Unity components, so this is something we have to fix.
I'm not sure what's the best way to go though, so above technical description was a hidden call for advice from other developers... ;)

At first glance it looks like SongManager class was not designed to have several instances, on the other hand players have come to like "music continuity" (say you enter then exit a dungeon and the music hasn't changed), which I now interpret as a side-effect of having several SongManagers around...
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
The Holy Knight
Posts: 40
Joined: Wed Jun 26, 2019 11:51 pm

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by The Holy Knight » Tue Nov 26, 2019 10:28 pm

Alright I understand and thanks for the help :D

User avatar
Interkarma
Posts: 5137
Joined: Sun Mar 22, 2015 1:51 am

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by Interkarma » Tue Nov 26, 2019 10:30 pm

Dungeon music selection matches classic, as implemented by Allofich. Index in playlist is selected using a seed value in the dungeon header and bit-shifted region index. See line 294 of SongManager.cs for details. This also means dungeon music is fully deterministic - each dungeon has its own soundtrack.

I just visited three different dungeons (Privateer's Hold, Orsinium, and a random cemetery) and they all had the correct (and all different) song assigned. As far as I can see, this is working perfectly.

User avatar
The Holy Knight
Posts: 40
Joined: Wed Jun 26, 2019 11:51 pm

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by The Holy Knight » Tue Nov 26, 2019 10:39 pm

i don't know whats going on then. Pango said he is experiencing it as well. I did what i stated above and even switched saves in a Crypt then to a fortress and then to Privateers Hold and they all kept the soundtrack that played when i first entered the Crypt. i then restarted the game and loaded Privateers Hold and the soundtrack was the right one for it. I loaded my Crypt save and the soundtrack was still playing the Privateers Hold track instead of the Crypt Track from earlier

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

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by pango » Tue Nov 26, 2019 11:00 pm

During the same session? Because I can reproduce it with 0.10.12, with no mods;
Condensed log of fast traveling to PH, entering it, leaving, fast traveling to a different dungeon (Tricergon, Daggerfall), and entering it:

(Loading game in town)
(weather not set at first, selecting SunnySong)

Music context changed, currentPlaylist = song_gday___d,song_swimming,song_gsunny2,song_sunnyday,song_02,song_03,song_22

Select SunnySongs

AssignPlaylist(), currentPlayList = song_gday___d,song_swimming,song_gsunny2,song_sunnyday,song_02,song_03,song_22

Next weather change: Snow_Normal

Music context changed, currentPlaylist = song_gday___d,song_swimming,song_gsunny2,song_sunnyday,song_02,song_03,song_22

Select SnowSongs

AssignPlaylist(), currentPlayList = song_20,song_gsnow__b,song_oversnow,song_snowing

Music playlist changed

SelectCurrentSong()

currentPlayList ok

(Fast Traveling to PH, arriving near PH)

Music context changed, currentPlaylist = song_20,song_gsnow__b,song_oversnow,song_snowing

Select SnowSongs

AssignPlaylist(), currentPlayList = song_20,song_gsnow__b,song_oversnow,song_snowing
(no playlist change detected, keeping same song)

(approaching PH, entering dungeon exterior)

Music context changed, currentPlaylist = song_20,song_gsnow__b,song_oversnow,song_snowing

Select NightSongs

AssignPlaylist(), currentPlayList = song_10,song_11,song_gcurse,song_geerie,song_gruins,song_18,song_21

Music playlist changed

SelectCurrentSong()

currentPlayList ok

(entering PH)

Music context changed, currentPlaylist = song_gday___d,song_swimming,song_gsunny2,song_sunnyday,song_02,song_03,song_22 (SunnySongs again, because of different SongManager instance?)

Select DungeonInteriorSongs

AssignPlaylist(), currentPlayList = song_dungeon,song_dungeon5,song_dungeon6,song_dungeon7,song_dungeon8,song_dungeon9,song_gdngn10,song_gdngn11,song_gdungn4,song_gdungn9,song_04,song_05,song_07,song_15,song_28

Music playlist changed

SelectCurrentSong()

currentPlayList ok

Selecting a new dungeon song

(leaving PH)

Entering new map pixel X=238, Y=190

Music context changed, currentPlaylist = song_10,song_11,song_gcurse,song_geerie,song_gruins,song_18,song_21 (currentPlayList is NightSongs again, back to exterior SongManager)

Select SnowSongs (this is actually surprising, because I'm still in dungeon exterior, so it should pick NightSongs?)

AssignPlaylist(), currentPlayList = song_20,song_gsnow__b,song_oversnow,song_snowing

Music playlist changed

SelectCurrentSong()

currentPlayList ok


(Fast traveling to Tricergon dungeon, arriving near)

Next weather change: Sunny

Music context changed, currentPlaylist = song_20,song_gsnow__b,song_oversnow,song_snowing

Select SunnySongs

AssignPlaylist(), currentPlayList = song_gday___d,song_swimming,song_gsunny2,song_sunnyday,song_02,song_03,song_22

Music playlist changed

SelectCurrentSong()

currentPlayList ok

(approaching Tricergon, entering its exterior)

Music context changed, currentPlaylist = song_gday___d,song_swimming,song_gsunny2,song_sunnyday,song_02,song_03,song_22

Select NightSongs

AssignPlaylist(), currentPlayList = song_10,song_11,song_gcurse,song_geerie,song_gruins,song_18,song_21

Music playlist changed

SelectCurrentSong()

currentPlayList ok

(entering Tricergon)

Music context changed, currentPlaylist = song_dungeon,song_dungeon5,song_dungeon6,song_dungeon7,song_dungeon8,song_dungeon9,song_gdngn10,song_gdngn11,song_gdungn4,song_gdungn9,song_04,song_05,song_07,song_15,song_28 (DungeonInteriorSongs, current playlist of Dungeon's SongManager)

Select DungeonInteriorSongs

AssignPlaylist(), currentPlayList = song_dungeon,song_dungeon5,song_dungeon6,song_dungeon7,song_dungeon8,song_dungeon9,song_gdngn10,song_gdngn11,song_gdungn4,song_gdungn9,song_04,song_05,song_07,song_15,song_28

(no change of playlist detected, so not selecting a different song)
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
Interkarma
Posts: 5137
Joined: Sun Mar 22, 2015 1:51 am

Re: Dungeon Soundtrack does not change when entering another dungeon

Post by Interkarma » Tue Nov 26, 2019 11:00 pm

Thanks, I've been able to reproduce by switching saves inside two different dungeons. :)

Fix required in the dungeon song manager to update track selection when loading a dungeon save or entering a dungeon after playlist already set. Rather than using playlist change to detect this, events could also trigger a song index update. Thank you both, I'll move to bug reports.

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

Re: 0.10.12 - Dungeon Soundtrack does not change when entering another dungeon

Post by pango » Sun Dec 01, 2019 1:17 pm

I submitted a PR
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Locked