My game is very physics intensive, I’m not sure how else I can optimize our game,
I’ve tried all sorts from, using only primitive colliders on rigidbodies, ensuring my physics layer matrix is correct,
changing my Broadphase to Multibox Pruning as we have quite a big world, which loads around the player.
We’ve even tried adjusting the Fixed Timestep and Maximum Allowed Timestep, but as our game uses the Fixed Update for our Multiplayer Snapshot Interpolation Buffer we can’t reduce the Fixed Timestep as this would result in even more input latency
Any advice would be great, I’ve attached a few screen shots
Do you even need physics on the clients? What I’ve done with a similar high physics usage issue is disable pretty much all colliders on the clients and just do physics on the server. I don’t do rendering on the server so the server has the extra CPU cycles. As you’ve already done I adjusted physics fixed timestep to the minimum where my physics still works correctly. I also disable all terrain colliders where the players cannot actually get to.
So on the server I do the physics simulation, then send position updates instead of syncing physics to the clients, and on the clients I interpolate those positions.
We already do that, as with snapshot interpolation there is no need to run physics on clients.
Disabling all terrain colliders? That’s something I haven’t done, is this a big win?
Just from my experience, I have a sail boat game with giant scenes, but sail boats can’t go far inland or underwater, so I was able to disable between 1/3 and 1/2 of the terrain colliders in my scenes. I saw a roughly 40% CPU use reduction for physics on the server in my case from that change. Disabling pretty much all colliders on the clients has reduced physics CPU usage on the clients to close to zero. This is with a dedicated authoritative server network set up with no client side prediction, just interpolation.
I would consider switching to a dedicated server network model. You could still have player hosted games, and run the server as a separate application or separate instance. That would probably only run poorly on low core count hardware.
Yeah, sadly our game is more of a Party/Open world game.
I’m looking to lower my fixed time step from 1.0f / 60 to 1.0f / 30 however I use my FixedUpdate to send Snapshots so lowering my fixed time step will lower how frequently I send snapshots.
The issue I have is I need to send these snapshots when something moves, I’ve tried Update but it seems stuttey, my guess is because the transform.position doesn’t update untill Physics.Simulate is called
Do you know how to access the interpolation values in Rigidbodies, as that’s what I need as then I can send snapshots in Update and achieve the 60 snap shots per second while maintaining the 30 physics frames