0

I started a new project, a fast-paced online game (some sort of 2D MOBA). I encountered a problem with the part of netcode about client prediction & server reconciliation.

Game Mechanics: 2D - Platformer (MOBA)
Movement: WASD (jump / left / down / right)
Abilites & Autoattack: J/K/L
Architecture: Client/server (authoritative)

My netcode is using these techniques:

  • Client-side prediction & server reconciliation
    • Server is sending position & data to the player, the player is replaying the last unprocessed inputs
    • Client is sending input each frame at a fixed timestep (60 times/sec) which are processed on the server-side
  • Other entities are interpolated
  • Bullets/abilities are extrapolated (Dead reckoning)

So far, this is working good on clients. My question is, how to handle some sort of forced movement?

For example, another player stuns or slows down you, on the server, you will be slowed down or stunned, but you will not know it before the packet arrives, since you are predicting the next state, it will teleport you back because your speed was changed to 0 or lower (in case of slow), it will immediately turn you back (teleport).

What is a good way to handle this technique? I was thinking about interpolating between the current position and the position on the server, but it is not working well for me.

saqirmdev
  • 65
  • 6
  • 1
    https://arstechnica.com/gaming/2019/10/explaining-how-fighting-games-use-delay-based-and-rollback-netcode/ – Martheen May 17 '21 at 03:29
  • @Martheen hey martheen, thanks for your reply. There is lot of reading, i will take a look! But after a short review, is those techniques use-able for Server-client architecture? It looks more like peer to peer based? – saqirmdev May 17 '21 at 04:12
  • You can treat local encounter peer to peer and only validate the result after someone disengaged or defeated – Martheen May 17 '21 at 04:33
  • Not sure if this can fit my game, coz game will be 3 vs 3 with spectators and more – saqirmdev May 17 '21 at 04:41

0 Answers0