Page 1 of 1

Taking hits after pausing

Posted: Tue Sep 21, 2010 1:00 am
by Cody
Took a mis-jump tonight… there I was, surrounded by half a dozen warships, and taking a hammering. I was about to hyperspace my way out of trouble, when the bloody phone rang. I hit ‘pause’… and watched amazed as a laser shot lanced across the screen, then ‘froze’, catching-up with the rest of the display, and I heard two hull hits… all after pausing the game. I dealt with the phone call, took the pic below, hyperspaced out (just in time), then went back to try it again, several times… same result. After pausing, I was taking two or three hits, then the laser beams would freeze… I even got killed a second after pausing, and got a frozen white explosion screen, before it eventually switched to the F5 screen… which was paused.

As I say, the laser shot in this pic appeared after I’d paused the game, and the rest of the display had frozen:

Image

1.74.2 on Win XP, with or without oxps (apart from Fighter Hud and a scuffed Griff Cobra).

Posted: Tue Sep 21, 2010 7:33 am
by Commander McLane
Very srane indeed. I occasionally have hit P the very moment a laser shot was fired, and so the beam stayed visible on the paused screen. But I never had the action going on after hitting P.

Maybe there are some script parts which are still executed when hitting P, and only stop when they're finished? Although it doesn't sound verly likely.

Posted: Tue Sep 21, 2010 10:34 am
by Svengali
Playing Sounds (internal and via SoundSources or Sound.playMusic()) are not stopped/paused when the game is paused (you can see it with Hyperradio or BGS).

And changing this behaviour would probably need bigger core changes, as Oolite would have to decide which one of the currently playing channels would have to be stopped/paused and which one should remain.

Posted: Tue Sep 21, 2010 11:38 am
by Cody
I can understand that with the sounds, but I’d expect the display to pause completely.
Taking hits, or even getting killed, a second after pausing is a bit odd… it’s no problem, though.

BTW Svengali, the latest version of BGS runs sweet… thanks.

Posted: Tue Sep 21, 2010 11:44 pm
by Cody
Odd… I can’t seem to replicate this in normal space.

I just got into a firefight with eight Vipers (now that’s what I call trouble)… every time I hit pause, everything stopped as it should. Tried it several times, with the same results… but if I mis-jump into interstellar space and get into a firefight with Thargoids, it’s really easy to replicate. I also noticed that the one or two ‘after-pause’ strikes made the energy banks flicker downwards, even though the game was paused.

Posted: Wed Sep 22, 2010 12:24 am
by aegidian
IIRC!

Pausing doesn't lock up the game, it just sets the time-elapsed-in-game for each screen update cycle to zero.

That means most events are paused.

Some events do not check how long it has been since the last frame (or the last time that event happened) before they occur and the thargoid laser is one of these (because the thargoid laser effectively never overheatsg, is how I recall I rationalised this).

Because of the way it is implemented, the pause doesn't quite work. It's a bug of some long standing (probably since the pause mode was added).

What's needed is to audit the code for events that do not check for time-elapsed or whether pause mode is active and include those checks.

Posted: Wed Sep 22, 2010 12:29 am
by Cody
Cool... and I actually understood the explanation. Thank you sir!

Posted: Wed Sep 22, 2010 1:19 am
by Switeck
It's probably brutally worse at framerates below 50 fps.
I've seen crazy-lag at <10 fps.