Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Client/Server Reconciliation

Discussion in 'Multiplayer' started by allencook200, Jan 12, 2021.

  1. allencook200

    allencook200

    Joined:
    Oct 2, 2020
    Posts:
    178
    Hi, I'm making a multiplayer first person shooter game and currently writing the netcode, more specifically, the client prediction and reconciliation. How do I implement this properly? Do I just teleport the client back to the correct spot and then run physics.simulate on the inputs that occurred after that point in time, all in one frame? My player uses a rigidbody to move.

    Question #2: Physics.Simulate is fairly new, so how on earth did multiplayer devs run reconciliation on physics objects before 2017? Or did they just teleport the client back without replaying the movements? Is this such a bad idea? You're probably also going to tell me they just used a library, but how did the library do it?

    Question #3: Unity3d is non deterministic, but I've found that my client and server sync pretty well and the positions are only off by about a thousandth of a decimal point, without the client fixing his position. Is this only because I'm running it on the same machine? Should I expect extremely different results on other machines?
     
    Last edited: Jan 12, 2021