Skip to content

lorenzolarc/Zappy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪐 Zappy

🔧 Description

Zappy is a multiplayer network game where artificial intelligences (AIs) control players on a tile-based map. Teams compete to evolve their members through incantation rituals. The winning team is the first to have 6 players at level 8.

🧩 Components

  • zappy_server (C): game server
  • zappy_gui (C++): graphical interface (2D with SFML)
  • zappy_ai (C++): autonomous AI client

⚙️ Compilation

$ make

Will compile all the project

$ make clean

Will delete all object files

$ make fclean

Will delete all object files and the binary

$ make re

Will execute fclean rule and compile the project

Targets:

  • zappy_server
  • zappy_gui
  • zappy_ai

🚀 Launch

Server

./zappy_server -p <port> -x <width> -y <height> -n <teamname1> <teamname2> ... -c <clientsNb> -f <freq>
  • <port> Is the port of the server
  • <width> <height> Are respectively the width and the height of the map of the server
  • <teamname> Are the names of the different teams
  • <clientsNb> This is the number of client authorized by team
  • <freq> This it the time frequency of the server, it will define the speed of the game

AI Client

./zappy_ai -p <port> -n <team> -h <host>
  • <port> Is the port of the server
  • <team> Is the name of the team it plays for
  • <host> Is the hostname of the server, localhost by default

Graphical Interface

./zappy_gui -p <port> -h <host>
  • <port> Is the port of the server
  • <host> Is the hostname of the server, localhost by default

The graphical interface identifies itself using the reserved team name GRAPHIC.

🌍 Game Mechanics

  • Taurus map (exiting one side wraps to the opposite)
  • Resources: food, linemate, deraumere, sibur, mendiane, phiras, thystame
  • Survival: 1 food = 126 time units
  • Vision: increases with level
  • Reproduction: Fork → egg → new slot for team
  • Elevation through incantation (see table below)

🧙 Elevation

  • Ressources and player required to complete the elevation
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

📡 Network Protocol

  • Communication via TCP sockets
  • Commands sent as plain text, separated by \n
  • Server and client uses poll() for socket multiplexing

📑 Server → GUI Protocol

Examples:

  • msz X Y: map size
  • bct X Y q0...q6: content of one tile
  • pnw #n X Y O L N: new player connection
  • ppo #n X Y O: player position
  • plv #n L: player level
  • pin #n X Y q0...q6: player inventory
  • pic / pie: start / end of incantation
  • pdr / pgt: drop / take object
  • smg: server message
  • seg: end of game

👥 Credits

About

This is the end year project for Epitech 2nd year

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published