Dominayt! - Multi-Player Socket Game
Network Programming, Game Development
Fall 2023Python
PyGame
Sockets
Concurrency
Overview
Dominayt is a real-time multi-player game that blends territory control with "bullet-hell" dodging mechanics. The project serves as a practical exploration of low-level network programming, requiring high-frequency state synchronization between a server and multiple clients to ensure a fair and responsive gameplay experience.
Gameplay Mechanics
The objective is twofold:
- Domination: Players must reach and stay within the center of the game grid to accumulate points.
- Evasion: A central cannon fires bullets at players; getting hit resets your progress or position, forcing a balance between aggressive point-scoring and defensive movement.
Technical Implementation
- Socket Programming: Implemented a custom communication protocol using Python's library. The server acts as the "source of truth," managing player coordinates, bullet trajectories, and collision logic.
socket - Concurrency: Used multi-threading on the server side to handle multiple simultaneous client connections without blocking the main game loop.
- State Synchronization: Developed a serialized data exchange format to broadcast the positions of all players and projectiles across the network at 60 frames per second.
- Client-Side Rendering: Built the visual interface using PyGame, transforming raw coordinate data from the server into a smooth graphical experience.
Project Structure
| File | Responsibility |
| --- | --- |
| server.pyclient.pymy_classes.py
Key Challenges
One of the primary hurdles was managing network latency. To prevent players from "teleporting" due to lag, I implemented basic client-side interpolation and optimized the data pickles to be as lightweight as possible, ensuring that the game felt "snappy" even with multiple players on the grid.
Repo Link
Repo : here