ZAPPY is a multiplayer real-time strategy game where several teams compete on a toroidal tile-based map to elevate their players through resource collection, coordination, and survival. The first team to have six players reach the maximum level wins.
zappy_server/— Main server written in C++zappy_gui/— Graphical interface written in C++ (using Raylib)zappy_ai/— AI client written in your language of choice (Python)
Gui and Server are compiled via makefile
./build.shThe Client can be compiled thanks to the following command
python3 Client/client.py --port [PORT] --team [TEAM]Each team controls several drones (players) that spawn on a shared tile-based world called Trantor. Drones must:
- Gather food to survive
- Collect resources (7 types)
- Collaborate to perform elevation rituals to gain levels
A player dies if they run out of food. Elevations are cooperative and require exact conditions to succeed.
- The world is a wrap-around 2D map (toroidal)
- The map is populated with food and six resource types:
linemate,deraumere,sibur,mendiane,phiras,thystame - Resources respawn every 20 time units
The number of resources at spawn time is calculated using:
quantity = width * height * density
./zappy_server -p PORT -x WIDTH -y HEIGHT -n TEAM1 TEAM2 ... -c CLIENTS_PER_TEAM -f FREQ| Flag | Description |
|---|---|
-p |
Port to listen on |
-x |
Map width |
-y |
Map height |
-n |
List of team names |
-c |
Number of clients per team |
-f |
Game frequency (time unit reciprocal) |
./zappy_gui -p PORT -h HOSTThe GUI connects to the server and visualizes the world in 2D (SFML-based). It receives real-time updates for tiles and player actions.
./zappy_ai -p PORT -n TEAM_NAME -h HOSTThe AI controls one drone. It sends commands to the server autonomously to:
- Gather food/resources
- Track inventory
- Coordinate elevations
- Reproduce (fork command)
- Communicate via broadcast
- Each team starts with
Nplayer slots (eggs). - Drones connect and spawn randomly.
- Players must collect food to stay alive (
1 unit = 126 time units). - Players must gather specific resources and team members to level up via the incantation command.
- Level 8 requires a full group of 6 to win.
| Level | Players | Linemate | Deraumere | Sibur | Mendiane | Phiras | Thystame |
|---|---|---|---|---|---|---|---|
| 1→2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| 2→3 | 2 | 1 | 1 | 1 | 0 | 0 | 0 |
| 3→4 | 2 | 2 | 0 | 1 | 0 | 2 | 0 |
| 4→5 | 4 | 1 | 1 | 2 | 0 | 1 | 0 |
| 5→6 | 4 | 1 | 2 | 1 | 3 | 0 | 0 |
| 6→7 | 6 | 1 | 2 | 3 | 0 | 1 | 0 |
| 7→8 | 6 | 2 | 2 | 2 | 2 | 2 | 1 |
All players involved in an incantation must be of the same level. Stones are consumed if elevation succeeds.
Clients communicate with the server using simple newline-terminated strings. Here's a few core commands:
| Command | Description | Time Cost (in f units) |
|---|---|---|
Forward |
Move forward | 7/f |
Right/Left |
Turn right/left | 7/f |
Look |
Get visible surroundings | 7/f |
Inventory |
Get current inventory | 1/f |
Broadcast |
Send a message | 7/f |
Connect_nbr |
Remaining egg slots for the team | instant |
Fork |
Lay an egg | 42/f |
Take/Set |
Pick up or drop a resource | 7/f |
Incantation |
Start level-up ritual | 300/f |
If a command is invalid or fails: server replies with ko.
When a player uses Broadcast, all other players receive:
message K, text
Where K is the direction (tile ID) relative to the receiver's orientation.
- All sockets are handled via
poll()(non-blocking I/O) - Protocol is fully ASCII, line-based
- GUI identifies itself by sending
GRAPHICas team name - AI clients are autonomous after launch
- Multiple clients can run on localhost for testing
- Real-time tile updates
- Resource and player display
- Support for player events: moves, pickups, drops, deaths, elevations
- Optimized updates via tile-based event broadcasting
The game ends when one team has at least six players at level 8.
zappy_gui: SFML (>= 2.5)zappy_server: C standard library onlyzappy_ai: no constraints, can use any libs
Developed as part of the Epitech YEP project.