- Server should be running on one computer.
python3 backend.py
- Clients should be connected to same LAN. The client app discovers the server automatically.
python3 frontend.py
- Agar.io clone
- To make the game more competitive, adding some challenges like reducing the player mass
- Real-time gaming experience with low latency
- Preventing glitch in player movements
- TCP packets increases the network load.
- This reduces experience of real-time gaming as number of players increases.
- So, we decided to use UDP.
- resolved:
- with timestamp for each packet in order to ignore old packets
- sending same packets more than once in order to reduce chances of missing packets
- Firstly, our server was the only global source of game state. User inputs are sent to the server directly and new state is calculated on the server and this new state is streamed to clients.
- At this case, server response was lagging behind the clients’ keyboard input due to the round trip time. This means that users could not see their position change immediately.
- To solve this problem, we separated the clients' own state from server state. So, users does not see any delay for their keyboard inputs.