Question about physics stability
by John Klimek · in Torque Game Builder · 09/15/2006 (7:33 am) · 1 replies
Back in beta releases of TGB (formerly T2D), the physics was really unstable and would speed-up or slow-down depending on the framerate. Now if I understand correctly there are new functions (eg. setPhysicsFPSActive) that will force the physics to perform at a consistant framerate.
Here are my questions:
1) What will happen in the simulation is unable to perform at that framerate (eg. the anti-virus program starts running and makes the computer run at a crawl)
2) Is there any way to allow the physics to not freak out when you alt-tab (eg. release focus) from the game? I know there is a resource to pause the simulation, but in a multiplayer game this isn't really feasible...
3) If I turn on the physics FPS limiter (for lack of a better term), will the physics basically perform the same on EVERY machine? I understand the exact collision points and such will be slightly different, but back in the beta they would be VERY different on every different machine.
Thanks in advance!
Here are my questions:
1) What will happen in the simulation is unable to perform at that framerate (eg. the anti-virus program starts running and makes the computer run at a crawl)
2) Is there any way to allow the physics to not freak out when you alt-tab (eg. release focus) from the game? I know there is a resource to pause the simulation, but in a multiplayer game this isn't really feasible...
3) If I turn on the physics FPS limiter (for lack of a better term), will the physics basically perform the same on EVERY machine? I understand the exact collision points and such will be slightly different, but back in the beta they would be VERY different on every different machine.
Thanks in advance!
About the author
Torque 3D Owner Luke D
Default Studio Name
1. setPhysicsFPSActive (which has been in since at least beta 1.0.2 btw) should greatly improve simulations thanks to swept collisions, however at very low framerates there is still some potential for unexpected results. This'll be true with any forced-realtime simulation; if you take longer processing the physics for a frame than the length of the frame itself, you're going to experience pain.
2. Sounds like you want to disable the engine's process-saving feature which lowers the game's processing priority and processes fewer game frames on purpose. This would make the game run as if it were in focus even when it wasn't. Of course, this makes other apps run worse. You could instead try to find a happy compromise, making it slightly higher priority and process slightly more frames in defocused mode. This is a source code change and I don't remember exactlt where the right place is to do this, but from what I recall it should be fairly easy.
3. In my experience back in 1.0.2 I had initially seen lots of varying physics between machines but the moment I turned on the physics FPS stuff it smoothed out fine. I don't use the physics for tons of intricate simulation though, just a handful of bouncing/floating objects bound inside a box.