Skip to content

mathisbukowski/Zappy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zappy Project (Year End Project G-400)

A Tribute to Zaphod Beeblebrox

Description

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.

Project Architecture

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

Compilation

make zappy_server    # Compile the server
make zappy_gui       # Compile the graphical interface  
make zappy_ai        # Compile the AI client
make                 # Compile all binaries

Usage

Server

./zappy_server -p port -x width -y height -n name1 name2 ... -c clientsNb -f freq

Options:

  • -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

Graphical Interface

./zappy_gui -p port -h machine

Options:

  • -p port: Port number
  • -h machine: Server hostname

AI Client

./zappy_ai -p port -n name -h machine

Options:

  • -p port: Port number
  • -n name: Team name
  • -h machine: Machine name (localhost by default)

Game Rules

Trantor World

  • 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)

Resources

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

Elevation Rituals

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

Player Commands

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

Vision increases with level:

  • Level 1: Basic vision (3×3 centered on player)
  • Higher levels: +1 tile forward and on sides for each level

Installation and Dependencies

Make sure you have installed:

  • C compiler (gcc)
  • C++ compiler (g++)
  • Make

Usage Examples

# 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

Game Strategies

  1. Resource collection: Traverse the map to collect food and stones
  2. Survival management: Maintain sufficient food stock
  3. Team coordination: Use broadcasting to coordinate rituals
  4. Strategic reproduction: Increase team numbers
  5. Elevation rituals: Gather necessary resources and players

Building the Documentation

Prerequisites

Before building the documentation, ensure you have the following installed:

  1. Doxygen:

    • On Ubuntu/Debian: sudo apt install doxygen
    • On macOS: brew install doxygen
    • On Windows: Download and install Doxygen.
  2. Graphviz (for diagrams):

    • On Ubuntu/Debian: sudo apt install graphviz
    • On macOS: brew install graphviz
    • On Windows: Download and install Graphviz.

Steps to Build the Documentation

  1. Clone the Repository:

    git clone https://github.com/your-username/your-repo.git
    cd your-repo
  2. 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
  3. Generate the Documentation: Run Doxygen to generate the documentation:

    doxygen Doxyfile

    The documentation will be generated in the docs/ folder.


Documentation Output

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.html in your browser to view the documentation.
  • LaTeX Documentation (for PDF generation):

    • Location: docs/latex/
    • Navigate to docs/latex/ and run make to generate a PDF.
  • Other Formats (if enabled in Doxyfile):

    • docs/rtf/: RTF documentation.
    • docs/xml/: XML documentation.
    • docs/sqlite3/: SQLite3 database (if enabled).

Customizing the Documentation

To customize the documentation:

  • Edit the Doxyfile configuration file.
  • Add or modify comments in the source code using Doxygen syntax.
  • Rebuild the documentation by running:
    doxygen Doxyfile

Dependencies

  • Doxygen (>= 1.9.1)
  • Graphviz (for diagrams)
  • Doxygen Awesome CSS (included as a submodule)

Authors

  • Alexandre Detoeuf
  • Mathis Bukowski
  • Maxime Bertin
  • Rafael Drouart
  • Raphaël Richaud
  • Valentin Frappart

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6