Both profiler pics clearly show 5 (!) physics steps per frame.
In Unity, you can tell because next to the FixedUpdate.ScriptRunBehaviourFixedUpdateCall, in the "Calls" column, it says '5'.
The Oni profiler shows 5 separate physics updates per frame. (5 columns of spaced apart stuff).
This is typical a case of death spiraling. Reduce your max fixed timestep setting, or optimize the simulation (by reducing the amount of iterations, using a larger timestep, using a smaller neighborhood radius...) until the spiral is no longer triggered.
If this happens without fluid present in the scene, it means your game is just too heavy for the device it is running on. Frames take too long to render, and this forces the physics engine(s) to run several times per frame in order to catch up with rendering, which further worsens performance.
(11-11-2020, 08:49 AM)josemendez Wrote: [ -> ]Both profiler pics clearly show 5 (!) physics steps per frame.
In Unity, you can tell because next to the FixedUpdate.ScriptRunBehaviourFixedUpdateCall, in the "Calls" column, it says '5'.
The Oni profiler shows 5 separate physics updates per frame. (5 columns of spaced apart stuff).
This is typical a case of death spiraling. Reduce your max fixed timestep setting, or optimize the simulation (by reducing the amount of iterations, using a larger timestep, using a smaller neighborhood radius...) until the spiral is no longer triggered.
If this happens without fluid present in the scene, it means your game is just too heavy for the device it is running on. Frames take too long to render, and this forces the physics engine(s) to run several times per frame in order to catch up with rendering, which further worsens performance.
I just noticed the time settings photo wasn't uploaded. The VR headset runs on 90 fps thus fixed timestep is 0.011;
I've tried playing with these settings, however, nothing seemed to make things better. Obi is also set to 1 physics step per frame with no substeps.
I'm not entirely sure what do you mean by "using a smaller neighborhood radius", could you elaborate?
(11-11-2020, 10:45 AM)SyDRoX Wrote: [ -> ]I just noticed the time settings photo wasn't uploaded. The VR headset runs on 90 fps thus fixed timestep is 0.011;
I've tried playing with these settings, however, nothing seemed to make things better. Obi is also set to 1 physics step per frame with no substeps.
I'm not entirely sure what do you mean by "using a smaller neighborhood radius", could you elaborate?
I think there's a big misunderstanding here: in a fixed-timestep scheme like Unity's,
you have no direct control over how many physics steps per frame are taken.
This is entirely decided by the engine, based on 3 factors:
- How much "wall-clock" time the last frame took to render.
- How much "game time" is simulated by a single timestep.
- How much "game time" we're allowed to simulate in a single frame.
Physics steps have a fixed duration in seconds (the "fixed timestep" value in your Time settings). If a frame takes a long time to render for whatever reason (including physics calculation itself), to keep up with rendering it might not be enough to simulate physics just once during the next frame. Two, three or more physics steps might be necessary in a single frame.
Updating physics isn't free though, so taking more than 1 step might make the current frame to take even longer to render than the previous one, worsening the situation. This causes a downwards performance loop that will only stop once you reach Unity's
max allowed timestep setting. However the game might not be able to recover from it at this point. So you can't conclude that having a refresh rate of 90 fps and a step duration of 0.01 (which is quite small), only one step will be taken. This situation is known as
death spiraling (aka well of despair, timestep crunch, and many others).
The hallmark of death spiraling is FixedUpdate() appearing more than once per frame in the profiler. In your case, max fixed timestep is set to 0.055, and fixed timestep to 0.011, so under performance stress your game is taking: 0.055 / 0.011 =
5 steps per frame. The profiler isn't lying
.
Long story short: use a longer timestep or reduce your max timestep.