Zappy a epitech project
In order to compile and run the project you need the following dependencies
Raylibmakegccrustcargog++asios
When all of those will be installed you can run
makeIt will compile 3 binaries:
zappy_guiA Graphic renderer for the projectzappy_serverA Server to make the guis and ais work togetherzappy_aiAn ai to play the game with
If you want to compile only one of the binaries you can use the following command
make <binary>In order to run the project you just need to run the binaries using the appropriate argumets.
It is advised to run zappy_server first
./zappy_server -p port -x width -y height -n name1 name2 ... -c clientsNb -f freqportis the port numberwidthis the width of the worldheightis the height of the worldnameXis the name of the team XclientsNbis the number of authorized clients per teamfreqis the reciprocal of time unit for execution of actions
It can also be runned using docker, by either building the image yourself or using the docker compose.
If you want to configure the server using the docker compose you have access to multiple env vars:
ZAPPY_LOG_LEVELfor the log level-lZAPPY_TEAM_NAMESfor the team names-nZAPPY_CLIENT_NUMBERfor the client count-cZAPPY_FREQUENCYfor the frequency-fZAPPY_WIDTHfor the width-xZAPPY_HEIGHTfor the height-y
./zappy_ai -p port -n name -h machineportport numbernamename of the teammachinename of the machine; localhost by default
Protocol of broadcasts done by the AI(s) to the server:
Each following broadcasts are formatted like this as requests to the server:
Broadcast <command>\n| Command | Definition | Sent by |
|---|---|---|
<ID> waiting |
Wait for AI Queen to join at same tile |
Queen |
<ID> assign <role> <pID> |
assign role to a new AI (by default considered a Queen) |
Queen|Knight |
ID=AIID (based off of Connection)role= role ofAI, aka {Bot | Fetus | Knight}pID= player ID of anAI(based on assignation, by default is0)
./zappy_gui -p port -h machineportport numbermachinename of the machine; localhost by default
The AI has a logging system that can be enabled by setting the ZAPPY_LOG environment variable to debug, trace or info before running the binary. For more information about it see the env_logger crate documentation.
ZAPPY_LOG=info ./zappy_aiThe server also have a logging system implemented with multiple level.
The levels are set using the -l argument and are the following.
ERRORWARNING(default)INFODEBUGDISABLE
The gui as a debug mode by adding the argument -d and the value true or false to enable or disable the log from raylib
| Key | Use |
|---|---|
ESCAPE |
Close in Menu | Switch betweens settings and game |
DELETE |
Close GUI window |
P |
Switch betweens 3D and 2D |
F |
Switch betweens perspective and free camera |
C |
Enable and Disable cursor |
R |
Reposition the camera to focus in the map center |
Menu and settings are accessible at the start. In the game, you can only access to the settings with ESCAPE and return to the game with the same way. Connection with server is only after clicked at the start button in menu.
Click button with cursor or move with arrow keys and Enter.
Sound and Music are editable in settings.
- Select a Tile or a Player with you cursor to see details
- Edit the Tick Duration, click and enter a new tick duration
- View logs with message box at bottom left
you can use A | Z | E | Q | S | D | CTRL | SPACE | ARROW KEYS to move the camera.
There are two main directories for the code documentation. They can be generated using make docs.
The directory doc/gui is for everything about the gui.
The directory doc/server is for everything about the server.
The directory doc/ai is for everything about the ai.
As the ai is in rust it is the only one not using a doxygen but a cargo doc format.
Lou Onezime |
Martin Fillon |
Alexandre Vigoureux |
Tiphaine Bertone |
Manuel Tome |
Rahul Chander |
|---|