Saqirm Posted May 16, 2021 Share Posted May 16, 2021 (edited) 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. Edited May 17, 2021 by Saqirm Rephrased article Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.