#Server Reconciliation with Rigidbody

1 messages · Page 1 of 1 (latest)

static sierra
#

In short: Can't seem to figure out how to speed up Physics simulation for the rigid body of a Client's car when it needs to reconcile with the server.

In Detail

Goal: I have simulated my car's movement solely based on Rigidbody by handling suspension and applying force/throttle at four different positions of the body (i.e. tires) and I am really satisfied with it. And now I want to test it out further with Client Prediction + Server Reconciliation (aiming at Server Authority).

Problem: When the client's prediction deviates from the server's authoritative movement (both are based on same input and on the same tick/timestamp), I need to revert the client's car to the server's position+rotation+velocity to sync them back in. And then re-apply the clients inputs again back to the current tick/timestamp This means I have to speed up the car up to where it is supposed to be at the current time so that it is also in the correct place with the correct velocity. But to do this, I have to somehow speed up Unity's physics for only that one car's rigid body. AND I DON'T KNOW HOW.

If someone has already done this or knows how to do it, they would understand and even see through my poor explanation. I would really appreciate any help.

This post is my last hope, if I don't find an answer here, I'll change the car's logic to simple arcady simulation through transform.position and manually simulate everything (movement, collisions, etc.)

You can find my Car script attached. (It's messy because I'm still testing out things)

floral pebble
#

Yea. PhysX does not support rollback. The best you can do is make the rigidbody kinematic and rollback the transform and reapply any inputs/forces

floral pebble
static sierra
#

Yeah I recently discovered that Netcode for Entities has Client Prediction/Server Reconciliation as default but if I decide to switch to Netcode for Entities, I'd have to learn and get familiar with the DOTS system first...which could prove to be beneficial but I think I'll try to simulate car physics by myself and if I still can't get it then I'll switch to NFE.

P.S. I heard that you can still work with Game Objects using NFE but I haven't researched that much so I'll look into it if I fail this last attempt.

floral pebble
#

Yea. Using Dots would be a fairly large rewrite depending on how far along your project is. You can technically use Gameobjects as a visual layer on top of entities. But monobehaviors and Dots systems don't interact with each other and requires a lot of glue to work properly.