So I have a scene with around 250 Dynamic boxes sitting on static terrain. When I start the physics engine I get low FPS as all the objects settle and come to rest on the terrain then finally go to sleep. Once they are asleep everything is fine. I guess what Im trying to do is eliminate that initial slow down. What strategies have other used?
Is there a way to force everything to sleep? Only a few boxes will be moving at any one time.
Is there a way to poll the physics state so I can detect when settling has completed? As I could fade the scene in once that is complete.
If neither of those are possible Iāll need to start looking at tricks to reduce the number of dynamic objects at any one time.
yeah, setting the threading mode to parallel should help but itās a high load until theyāve settled anyway. you can also tune the accuracy and the step size to adjust performance but probably youāre looking for a way to detect when everything has settled
I wasnāt using the parallel thread mode so thanks for that suggestion. I was playing around with leaving everything static until some action is taken then switching them to dynamic. That should work also right?
I havenāt had initial slowdown with physics, but most of my projects take a good 5-20 seconds to start running stably, lots of geometry loading and generating, light probe rendering⦠There is no easy way around this, optimizing loading routines takes way to long, so I just dont āstartā the game until its stable, and hide it behind a loading screen.
Staggered loading can help in physics, loading in boxes in small groups over several frames, to average out slow down
It may be possible to take a snap shot of the position states for all boxes once they have settled, and use that for their inital positions for future loads, this may reduce the time it takes for them to āsettleā.
I dont know about polling the physics space, you could check say 10 random boxes every frame, mark if they are asleep, continue untill all are marked asleep ?
Keep in mind this slow down might be on your machine only, it may be a pile of crap, so judging slowdown by using number of asleep objects may not be accurate, it may be better to check the average frame rate, wait until that hits your target fps and is stable, BAM run your game and profit.