'Pausing' the engine

After viewing this thread, I have been fiddling around a bit with the engine and docs, but haven’t been able to find how (and if) it is possible to ‘pause’ the engine (or rather, skip all animation / movement tasks the TaskMgr has, until an ‘unpause’ function is called). In effect, this should freeze the world, but continue sound, controller input/handling and, if neccesary, networking

The effect I’m hinting at is e.g. when you press the pause button in bioware’s infinity engine (user’s perspective), all movement would stop, graphical effects would remain in the position it was when the button was pressed and new orders could not be issued. One could however, still use the menu’s, logs and option screen.

Is there a way in panda to emulate this kind of behavior?

(Ofcourse, for not accepting orders and/or changing some behavior I could use a ‘paused’ variable, the main issue here is to find if there is a way to freeze all current animations, but keep i/o running)

Thanks,
Roel

I’m not entirely sure about this. But I would look at class ClockObject. Try getting the global clock using this:

ClockObject.getGlobalClock()

Then, try the following methods to slow it down.

Option 1:

use setMaxDt(0.0) to stop the clock, then use setMaxDt(0.2) to restore it.

Option 2.

use setMode(ClockObject.MSlave) to stop the clock, then setMode(ClockObject.MNormal) to restart it.

I don’t know if either will work, but both look promising.

I’d recommend option 2.

David

I’ve been trying them this morning and it seems option #1 does not work, because of this:

Option #2 works like a charm, except for the fact that the fist frame of a ‘new’ animation is shown when its initiated (e.g. when I press a button for a random animation, the character will pose in the first frame of the animation). I’m going to assume I must use my own code to prevent the animation from starting, which should be quite easy to accomplish if I disconnect my keyMapper :slight_smile:

thank you both!

edit:last one was a bad call, for i couldn’t unpause the game in that case either. Instead, i’ll just stop the handler for movement and player interaction