DigitalPulseSoftware / BurgWar

Burg'war est un jeu de plateforme/combat multijoueur en 2D écrit en C++17/Lua avec mon propre moteur de jeu : Nazara Engine.
MIT License
52 stars 9 forks source link

Client side prediction #8

Closed SirLynix closed 5 years ago

SirLynix commented 5 years ago

Big (mosly client-side) change to add client-side prediction and reconciliation.

It does so by updating inputs client-side at the same time they are sent server-side, with the client trying to guess the server tick at inputs arrival (with server correction over time). When the server sends inputs back the client will then recompute all predicted inputs starting from the server position/rotation (reconciliation).

To help debugging, this commit also add "server ghosts", a means of seeing immediate server entities positions in localhost (using another socket), and some (disabled by default) file logging of the entities position and velocity.