A Tribute to Zaphod Beeblebrox
Zappy is a network game where several teams confront each other on a tile map containing resources. The goal is to be the first team to have at least 6 players reach the maximum level (level 8).
The game takes place on the planet Trantor, a zero-relief world where players collect resources and perform elevation rituals to progress in the Trantorian hierarchy.
The project consists of three distinct binaries:
- zappy_server: Server written in C that manages the world and its inhabitants
- zappy_gui: Graphical interface written in C++ to observe the world
- zappy_ai: AI client (free language choice) that controls an inhabitant
make zappy_server # Compile the server
make zappy_gui # Compile the graphical interface
make zappy_ai # Compile the AI client
make # Compile all binaries./zappy_server -p port -x width -y height -n name1 name2 ... -c clientsNb -f freqOptions:
-p port: Port number-x width: Width of the world-y height: Height of the world-n name1 name2 ...: Team names-c clientsNb: Number of authorized clients per team-f freq: Reciprocal of time unit for execution of actions
./zappy_gui -p port -h machineOptions:
-p port: Port number-h machine: Server hostname
./zappy_ai -p port -n name -h machineOptions:
-p port: Port number-n name: Team name-h machine: Machine name (localhost by default)
- Geography: Spherical world with no relief (exiting right brings back from left, etc.)
- Objective: First team with 6 players at level 8 wins
- Survival: Players must feed themselves (1 food = 126 time units)
The world contains 6 types of stones and food:
| Resource | Density |
|---|---|
| food | 0.5 |
| linemate | 0.3 |
| deraumere | 0.15 |
| sibur | 0.1 |
| mendiane | 0.1 |
| phiras | 0.08 |
| thystame | 0.05 |
Quantity formula: width × height × density
To level up, players must gather:
- A certain number of each stone
- A certain number of players of the same level on the same tile
| 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 |
| Action | Command | Time | Response |
|---|---|---|---|
| Move forward | Forward |
7/f | ok |
| Turn right | Right |
7/f | ok |
| Turn left | Left |
7/f | ok |
| Look around | Look |
7/f | [tile1, tile2, ...] |
| Inventory | Inventory |
1/f | [linemate n, sibur n, ...] |
| Broadcast message | Broadcast text |
7/f | ok |
| Connection count | Connect_nbr |
- | value |
| Fork player | Fork |
42/f | ok |
| Eject players | Eject |
7/f | ok/ko |
| Take object | Take object |
7/f | ok/ko |
| Set object down | Set object |
7/f | ok/ko |
| Start incantation | Incantation |
300/f | Elevation underway... |
Vision increases with level:
- Level 1: Basic vision (3×3 centered on player)
- Higher levels: +1 tile forward and on sides for each level
Make sure you have installed:
- C compiler (gcc)
- C++ compiler (g++)
- Make
# Launch a 10x10 server with 2 teams, 3 clients per team
./zappy_server -p 4242 -x 10 -y 10 -n team1 team2 -c 3 -f 100
# Launch graphical interface
./zappy_gui -p 4242 -h localhost
# Connect an AI client
./zappy_ai -p 4242 -n team1 -h localhost- Resource collection: Traverse the map to collect food and stones
- Survival management: Maintain sufficient food stock
- Team coordination: Use broadcasting to coordinate rituals
- Strategic reproduction: Increase team numbers
- Elevation rituals: Gather necessary resources and players
Before building the documentation, ensure you have the following installed:
-
Doxygen:
- On Ubuntu/Debian:
sudo apt install doxygen - On macOS:
brew install doxygen - On Windows: Download and install Doxygen.
- On Ubuntu/Debian:
-
Graphviz (for diagrams):
- On Ubuntu/Debian:
sudo apt install graphviz - On macOS:
brew install graphviz - On Windows: Download and install Graphviz.
- On Ubuntu/Debian:
-
Clone the Repository:
git clone https://github.com/your-username/your-repo.git cd your-repo -
Initialize the Doxygen Awesome CSS Submodule: The documentation uses the Doxygen Awesome CSS theme, which is included as a Git submodule. Run the following command to initialize it:
git submodule update --init --recursive
-
Generate the Documentation: Run Doxygen to generate the documentation:
doxygen Doxyfile
The documentation will be generated in the
docs/folder.
After running Doxygen, the generated documentation will be placed in the docs/ folder with the following structure:
-
HTML Documentation:
- Location:
docs/html/ - Open
docs/html/index.htmlin your browser to view the documentation.
- Location:
-
LaTeX Documentation (for PDF generation):
- Location:
docs/latex/ - Navigate to
docs/latex/and runmaketo generate a PDF.
- Location:
-
Other Formats (if enabled in Doxyfile):
docs/rtf/: RTF documentation.docs/xml/: XML documentation.docs/sqlite3/: SQLite3 database (if enabled).
To customize the documentation:
- Edit the
Doxyfileconfiguration file. - Add or modify comments in the source code using Doxygen syntax.
- Rebuild the documentation by running:
doxygen Doxyfile
- Doxygen (>= 1.9.1)
- Graphviz (for diagrams)
- Doxygen Awesome CSS (included as a submodule)
- Alexandre Detoeuf
- Mathis Bukowski
- Maxime Bertin
- Rafael Drouart
- Raphaël Richaud
- Valentin Frappart