Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Dragonfly

ZDoom ACS - Is it possible to detect if the player paused the game?

Question

I'm fixing up my 'vinesauce entry' from last year for release, and one of the core issues with the map is that the light show, which is ACS powered, de-syncs from the music if the game is paused. I have made it so the music is actually a sound effect so it still pauses when you pause the game, but it seems like the script advances by a tic or two before the music cuts back in, meaning every time the player pauses, the light show de-syncs by a minute yet noticeable amount.

 

Is there any method within ACS to check if the player has paused? All I need it to do is essentially set a boolean variable to TRUE if the player paused since the last time it was checked.

 

I assume this isn't possible, have looked around online but can't find anything, so looking to you guys for the final answer!

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 2

How are you supposed to detect if the game is paused while it's paused? Any solution to this would break the fundamental principle of a paused game.

Share this post


Link to post
  • 0

I've solved my issue - turns out I had this desync regardless of pausing. The desync became an issue when I went from using 'music' instead of 'sound effects' to play the mp3. To fix that issue I used sound precaching via MAPINFO.

 

I would still like to know if detection of game pause is possible however, I've thought of some quirky and creative uses for such a feature, should it exist.

Share this post


Link to post
  • 0
53 minutes ago, Edward850 said:

How are you supposed to detect if the game is paused while it's paused? Any solution to this would break the fundamental principle of a paused game.

Precisely what I expected. I assumed that IF it was possible it would be done in a fashion similar to below:

 

Script 1 AFTERPAUSE {
    //Code to execute when game is unpaused.
}

 

Share this post


Link to post
  • 0
2 hours ago, Dragonfly said:

Precisely what I expected. I assumed that IF it was possible it would be done in a fashion similar to below:

 


Script 1 AFTERPAUSE {
    //Code to execute when game is unpaused.
}

 

I'd argue that would still break the same fundamental concept (a game's world should not be aware of variables that don't affect its outcome). i.e Pausing a game should be treated as a halt, not a modifier, need I point out any game where pausing allows you to manipulate RNG tables or movement in some way, but then ZDoom likes to do a lot of weird things so who knows what it allows now.

 

Further more, what you want will not actually fix your problem. Sound these days is multi-threaded, especially in ZDoom. The simple process of playing back the sound is enough to cause it to desync due to gamespeed drifting from the sound thread. What you would need is a system to coordinate sync points between your scripts and the sound itself. 

Edited by Edward850

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×