i_soundinbackground has side-effects

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
phantombeta
Posts: 1982
Joined: Thu May 02, 2013 1:27 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

i_soundinbackground has side-effects

Post by phantombeta »

The "i_soundinbackground" CVar also makes the game not automatically pause when focus is lost in single-player. Why, you ask? Because someone though it'd be a good idea to handle it inside S_SetSoundPaused.
Not sure why anyone thought this was a good idea, but ok.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 47987
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: i_soundinbackground has side-effects

Post by Graf Zahl »

WTF???
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: i_soundinbackground has side-effects

Post by Rachael »

Ooof. And here I was assuming that code didn't resort to such a hack.

If I am to be completely honest though - when this gets fixed I still would prefer to have the game run in the background, even if that's segregated into an option.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3110
Joined: Fri Apr 23, 2004 3:51 am
Discord: drfrag#3555
Github ID: drfrag666
Location: Spain

Re: i_soundinbackground has side-effects

Post by drfrag »

Graf Zahl wrote:WTF???
What do you mean? If the game is paused how could you have sound in the background? Besides vid_active in background doesn't prevent the game from being paused.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 47987
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: i_soundinbackground has side-effects

Post by Graf Zahl »

The issue here clearly is that the playsim isn't paused - it's clear that it cannot pause the engine, but that's a completely different thing.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3110
Joined: Fri Apr 23, 2004 3:51 am
Discord: drfrag#3555
Github ID: drfrag666
Location: Spain

Re: i_soundinbackground has side-effects

Post by drfrag »

But that's not a side effect, the idea was to have both sound effects and music in the background. The commit was "- implemented 'i_soundinbackground' to continue playing sounds and music while in the background." How to prevent the game from being paused then?
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: i_soundinbackground has side-effects

Post by Rachael »

drfrag wrote:But that's not a side effect, the idea was to have both sound effects and music in the background. The commit was "- implemented 'i_soundinbackground' to continue playing sounds and music while in the background." How to prevent the game from being paused then?
drfrag... you're missing the whole point.

The code that pauses the game is in the sound code, itself. It doesn't belong there.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3110
Joined: Fri Apr 23, 2004 3:51 am
Discord: drfrag#3555
Github ID: drfrag666
Location: Spain

Re: i_soundinbackground has side-effects

Post by drfrag »

That's why i'm asking where it should be. So i still don't see it as a side effect. :) :?
User avatar
Rachael
Admin
Posts: 12895
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: i_soundinbackground has side-effects

Post by Rachael »

It should probably be in the main loop where it checks whether the menu or pause is active, not in the sound code.
Gez
 
 
Posts: 17635
Joined: Fri Jul 06, 2007 3:22 pm

Re: i_soundinbackground has side-effects

Post by Gez »

This is something I wanted to complain about, but always just forgot.

I suffered from that while going through Avactor, where the maps are big enough that reloading a save took several seconds, causing me to alt-tab away. The save loading complete was indicated by hearing the marine's shout of pain as some random monster took potshot while I was busy elsewhere.

Anyway now I know I can get the old behavior back by turning off a CVAR.

Return to “Bugs”