Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Collider Performance
#7
(31-07-2019, 04:16 PM)HenryChinaski Wrote: Thanks for the information. Could I ask you to elaborate shortly on the max timestep thing? Never changed that value. It is at the moment at 0.3333. I am targeting 30-45 fps. 

I also attach a screenshot of the deep profiling. When trying to click on the "Show related objects" button, Unity crashes.

Simply comparing two objects for equality is taking up 61 ms, because FixedUpdate is called 16 times per frame, for a total of +40.000 object comparisons per frame.

From the profiler numbers I calculate you have around 652 mesh colliders in your scene, is that correct? Maybe you can merge some of them together, use primitive colliders (which are always much, much cheaper than MeshColliders)), or add/remove ObiColliders dynamically.

Max timestep is a pretty critical setting, as it controls how many times is Unity allowed to recalculate physics per frame, when the frame rate suffers a hit for any reason. A too high value can quickly spiral out of control and make performance plummet, if the physics recalculation itself takes more wall-clock time than the game-time it is accounting for. Ideally it should be set to a multiple of the fixed timestep. Eg: If you want to allow a maximum of 2 physics steps per frame and your fixed timestep is 0.02, set max timestep to 0.04. A max timestep of 0.33 allows for 0.33/0.02 = 16.5 steps before Unity gives up and starts the next frame, which is exactly what's happening here.
Reply


Messages In This Thread
Obi Collider Performance - by HenryChinaski - 30-07-2019, 02:26 PM
RE: Obi Collider Performance - by josemendez - 30-07-2019, 02:51 PM
RE: Obi Collider Performance - by HenryChinaski - 30-07-2019, 05:08 PM
RE: Obi Collider Performance - by HenryChinaski - 30-07-2019, 09:36 PM
RE: Obi Collider Performance - by josemendez - 31-07-2019, 06:57 AM
RE: Obi Collider Performance - by HenryChinaski - 31-07-2019, 04:16 PM
RE: Obi Collider Performance - by josemendez - 31-07-2019, 06:21 PM
RE: Obi Collider Performance - by HenryChinaski - 01-08-2019, 01:29 AM
RE: Obi Collider Performance - by josemendez - 01-08-2019, 07:58 AM
RE: Obi Collider Performance - by HenryChinaski - 05-08-2019, 01:40 PM