This project is a Godot 4.2 game implementation of a multiplayer game using an authoritative server architecture with client side prediction, server reconciliation, and lag compensation.
- Client side prediction and server reconciliation
- Lag compensation for hit detection
- Client/Server clock synchronization
- Pregame lobby
- Server mode, client mode and host mode
- Protobufs used for network messages
The MultiplayerManager contains the functions that send messages back and forth between the client and server. This also includes the logic for client side prediction, server reconciliation, and lag compensation
The GameManager is a state machine that switches between scenes and calls transition functions as needed.
The Clock is used to synchronize time between the server and the client.
The player contains the logic to apply player inputs and apply the game physics to the players in the shared world. The same code runs on both the server and the client (for client side prediction), which allows the server and client to be automatically in sync under perfect conditions.