Avoiding Physics Processing Overload #1841
Replies: 1 comment 5 replies
-
|
A physics update of 300 ms is a lot. I don't think I've ever managed to create a scene that does that. E.g. this scene of 160 ragdolls runs in about 3 ms on my computer, and it sounds like it has far more collisions than your scene has. You probably have some sort of configuration error, but without more info there's very little I can do to help you. What hardware are you running on? What configuration of Jolt are you using? Do you have a profile of this scenario (you can use Jolt's built in profiler or an external tool)? What does the rest of the scene look like? Did you setup your broadphase in separate layers for moving / static bodies? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the Jolt physics working with my game engine just fine. I notice that when i have enough collisions taking place simultaneously, especially when several bodies are impacting each other (more than just one on one interaction), things begin to slow down. In my case it has to do with a tank model that has three rigid bodies (base, turret, and barrel) and about a dozen wheels. When they spawn on top of each other or are driven into each other and a pile of them forms, the physics can crush the CPU. And while I know this is not typical of a game in general, it is a "possibility" of occurring.
The problem I am having is that when it happens, the frame rate can drop to the point that recovering control is practically impossible due to the frame rate dropping to around 3 fps. Again, i know this is unlikely to happen, but it can, and it can leave my game engine in a state where playing the game is no longer feasible and terminating the game becomes the only viable choice.
My question is, what are some of the best practices to keep the physics system from blindly going off into the step world function without awareness it won't come back for 300ms? How should i go about handling these kinds of scenarios so that the frame rate never drops below say 20fps due to the stepping taking too long?
Beta Was this translation helpful? Give feedback.
All reactions