Do good multiplayer/mmo client<>server games use latency within movement calculations?

前端 未结 5 1594
灰色年华
灰色年华 2021-02-03 16:27

There\'s a couple of questions here.

Imagine I have client A who\'s going to send the following message to Server: \"START MOVEMENT FORWARD\".

The server will no

5条回答
  •  天涯浪人
    2021-02-03 16:55

    for Q1: that looks right to me.

    Q2: The way I've done this in the past is: if you want things to feel responsive, start executing the action instantly on the client's simulation, then the server simulates forward in game-time when the person initiated the action. i.e. the client knows at what ms in the game-simualation time it started, so the server can start it at that time also (note: this is always backwards in time from the server's current tick, so you have to save state back in time to do this).

    Q3: the clients only really need to know that they are simulating at time X, and the server says the set of events {A,B,C} happened at times {X,Y,Z}. Then client and server can simulate forward with the same info and generally stay in sync (except when simultaneous conflicts occur). In those cases you have the server re-sync things so you usually end up within a pretty tight margin of error and a mostly smooth experience.

    If your goal is to improve a perception of latency you might also just try trusting the client.

提交回复
热议问题