Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambience sound resets between screens #140

Closed
snouz opened this issue Jun 21, 2020 · 6 comments
Closed

Ambience sound resets between screens #140

snouz opened this issue Jun 21, 2020 · 6 comments

Comments

@snouz
Copy link
Collaborator

snouz commented Jun 21, 2020

Ambience sounds (i.e. Alexandrian, owl...) resets each time you change screen instead of blending.

@snouz snouz changed the title [Bug] Ambience sound resets between screens Ambience sound resets between screens Jun 21, 2020
@poepkat
Copy link

poepkat commented Oct 6, 2021

Hi,

Here are comparison videos. Sorry I can't contribute more, I'm not a programmer.

Bugged loop (list to the owl sounds, the start immediately after every screen change): https://streamable.com/pba6bx
Proper loop (I don't change screens so you can hear what the loop is supposed to sound like): https://streamable.com/k3bh1r

@Tirlititi
Copy link
Collaborator

Tirlititi commented Oct 6, 2021

Surely the issue has something to do with SceneDirector.ChangeScene that calls "StopAllSoundEffects". I don't know what happens for the whole game if we remove this line (maybe songs must stop but not sound effects, maybe one needs to be extra careful when moving to non-field scenes).

Field scripts have a system to stop sound effects correctly when leaving to a field that doesn't have the same effects, so no worries about that.

However, maybe one need to also make sure the sound effects don't play in duplicates (FF9Snd or down that), because both FF9SOUND_SNDEFFECTRES_PLAY and FF9SOUND_SNDEFFECTRES_VOL_INTPL are called when entering a new field even if the sound effect is already playing from a previous field.

I'll check that eventually.

@poepkat
Copy link

poepkat commented Oct 10, 2021

Hi,

Sorry is this is the wrong place to post noob questions. If you don't want to answer I understand. I've checked out the code you linked, and it got me intrigued to try and understand it a little bit.

First of all, how would one know StopAllSoundEffects are related to ambient soundtracks specifically?

Second

			if (this.CurrentScene != this.NextScene)
			{
				if (String.Equals(this.CurrentScene, "QuadMist"))
				{
					SceneDirector.FF9Wipe_FadeInEx(30);
				}
				if (String.Equals(this.NextScene, "MainMenu"))
				{
					SoundLib.StopAllSounds(true);
				}
etc. etc.

The he game calls StopAllSoundEffects if the current scene is not the same as the next scene ONLY IF any of the conditions of the string are met (so any of the code that comes AFTER if (this.CurrentScene != this.NextScene) or does it ALWAYS execute StopAllSoundEffects on EVERY screen change?

And as as follow op, am I reading this correctly: if the current scene is QuadMist (what is that, the Game Over screen or something?) and it's not the same as the previous scene, the game starts FF9_Wipe_FadeInEx, or of the next scene is MainMenu then SoundLib.StopAllSounds is executed, which probably disables both SoundEffects and the Music?

Cheers,

Tirlititi added a commit that referenced this issue Oct 11, 2021
@Tirlititi
Copy link
Collaborator

To answer your questions, Poepkat, the "ChangeScene" triggers on every screen change (except opening the menus and fake screen changes, like Iifa Tree roots for which several screens are actually the same field). QuadMist is the old/japanese name of Tetra Master. The "this.CurrentScene != this.NextScene" condition doesn't check if the screen changes but if the next module is the same as the previous module (is it a field, a world map, a battle, a Tetra Master game, a game over...).
"StopAllSoundEffects" doesn't apply to ambiant soundtracks only ("SNDEFFECTRES") but only them (and possibly songs) would be problematic because they would be never-ending if not handled properly.

I have not tested the fix I just did thoroughly in-game but that seems to work fine until at least disc 2.

@poepkat
Copy link

poepkat commented Oct 11, 2021

Would it be possible for you to provide a Assembly-CSharp.dll with the Ambience fix (#140?) that is compatible with Moguri/Alternate Fantasy; I'm assuming I can just replace the Assembly-CSharp.dll in the Steam game folder? I'm in a place with very bad internet currently so I cannot download any big programmes to (learn to) compile myself, but tomorrow I have a long flight home and I would like to play FF9 in the plane. Or can you tell me what I should do to apply the fix to Moguri/Alternate Fantasy without any big downloads?

EDIT: I've only ever did some light scripting and compiling for Skyrim... All of the code you showed me is very hard to grasp.

@Tirlititi
Copy link
Collaborator

I plan to add a release tomorrow or the day after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants