Possible Bug in AGS, System.Volume is not set when loading a saved game.

Started by Joacim Andersson, Mon 06/02/2023 22:53:45

Previous topic - Next topic

Joacim Andersson

I don't know if this is a bug in AGS, but I have created a GUI for changing the System.Volume and the Game Speed. However when I open or restore a previously saved game the System.Volume isn't restored to what it was in the saved game. However when I open my "control panel" GUI, the slider for the Volume is still set lower than the maximum.

If I read what System.Volume is set at it reads 13, yet the music and sound effects are playing as if it was set to 100.

As a workaround I put the following code in the on_event handler:
Code: ags
if (event == eEventRestoreGame)
{
  if (System.Volume < 100)
  {
    System.Volume = System.Volume + 1;
    System.Volume = System.Volume - 1;
  }
  else
  {
    System.Volume = 99;
    System.Volume = 100;
  }
}
But it's seems to be a bit redundant to have to do this,

Crimson Wizard

Please tell, which version of AGS are you using exactly? This may be found either in the Editor Help->About menu, or during the game by pressing Ctrl+Alt+V.

I did a quick test in the latest 3.5.1 and 3.6.0 versions, and do not observe same problem, but maybe there are other unknown factors that cause this issue.

Quote from: Joacim Andersson on Mon 06/02/2023 22:53:45If I read what System.Volume is set at it reads 13, yet the music and sound effects are playing as if it was set to 100.

Judging by what you say, System.Volume's value is restored properly, but music & sound do not get it applied.
Does this effect occur only to the clips that were playing when saving the game and continue after it is restored, or to any newly played sounds too?

Joacim Andersson

I use version 3.5.1.23. And the sound remains high regardless if it starts a new song or plays a sound effect. My workaround does fix it but there must be some underlying faulty behavior.

Crimson Wizard

I apologize for this month-long delay, I was planning to look again into this, but constantly got distracted by something.

After making another, different test, I was actually able to reproduce this effect. (Tbh I don't know what did I do differently this time)
Here I will put a download link for a test game I'm using:
https://www.dropbox.com/s/csom9y8ksnuit78/test--systemvolume.zip?dl=0

The problem reproduces in 3.5.1, but not in 3.6.0 (it was likely fixed between the versions).

To reproduce:
When you run the game, the music is playing repeatedly.
Put slider to a high value. Notice how music became louder. Save the game in slot A.
Put slider to a low value. Notice how music became quieter. Save the game in slot B.
Now, restore the slot A. Notice how music did not become loud again, until you move the slider a bit.
Now, restore the slot B. Notice how music did not become quiete,  until you move the slider a bit.

Joacim Andersson

I'm glad that you could confirm this as a possible bug. If you just come to this site to download AGS you also get version 3.5.1, I don't know if 3.6 is still in preview or what but it doesn't seem to be the current official release version.

Crimson Wizard

This seem to be a pretty old regression, looks like it's been there for a few versions at least...

I will be releasing another small patch to 3.5.1 soon then.

3.6.0 is currently in "release candidate" state, and we are working on some last-moment fixes:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-6-0-release-candidate-rc1/
There should be a download link on the AGS front page too, but it's hidden under some collapsable "More Downloads" link, so not standing out.

Joacim Andersson

Yeah, that's what I thought, I usually don't download release candidates or beta versions.

Crimson Wizard

I released another patch for 3.5.1, may be found on downloads page, or here:
https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-3-5-1-patch-19/

This bug was present at least since AGS 3.4.0, but somehow nobody reported it since.

Joacim Andersson

Thanks buddy. Since I've already released my game I'll just use my own workaround but it's good to know that for the future that this has been mended.

SMF spam blocked by CleanTalk