Hey folks, I’ve been struggling with this issue for a while and I sure could use a hand!
In my project, after loading a 10+ hour game, some (and only some) of the physics are in the 40-70ms/f range. It actually gets progressively worse as I re-save and load the game.
Specifically it’s the ScScene.postBroadphase stat under “stat PhysxTasks” (attached a screenshot of it).
I’ve ruled out a bunch of things so far:
- The number of actors and components are stable. I count them using TObjectIterator and there are no extra objects after loading the game.
- Pruning methods don’t seem to affect postBroadphase. I’ve tried both MBP and SAP.
- The problem is carried along with the save game, so loading the game on another computer will have the same problem.
- Destroying all the actors (using the DestroyAll) improves postBroadphase BUT if I start walking around with the character, it jumps all the way back to 40-70ms/f
I’ve profiled and found that the slowdown is within a function
void SimpleAABBManager:postBroadPhase(PxBaseTask*, PxBaseTask* narrowPhaseUnlockTask)
But I can’t figure out how to use this information because this is in the third party Physx files and I can’t debug them or modify them (This is the file that function is from:
Source\ThirdParty\PhysX3\PhysX_3.4\Source\LowLevelAABB\src\BpSimpleAABBManager.cpp
I could really use some help figuring this out if anyone has any suggestions?
EDIT:
This turned out to be an engine bug ( Unreal Engine Issues and Bug Tracker (UE-76873) ). Calling RecreatePhysicsState in key places resolved the issue for me.