Zappy a epitech project
In order to compile and run the project you need the following dependencies
Raylib
make
gcc
rust
cargo
g++
asios
When all of those will be installed you can run
make
It will compile 3 binaries:
zappy_gui
A Graphic renderer for the projectzappy_server
A Server to make the guis and ais work togetherzappy_ai
An 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 freq
port
is the port numberwidth
is the width of the worldheight
is the height of the worldnameX
is the name of the team XclientsNb
is the number of authorized clients per teamfreq
is 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_LEVEL
for the log level-l
ZAPPY_TEAM_NAMES
for the team names-n
ZAPPY_CLIENT_NUMBER
for the client count-c
ZAPPY_FREQUENCY
for the frequency-f
ZAPPY_WIDTH
for the width-x
ZAPPY_HEIGHT
for the height-y
./zappy_ai -p port -n name -h machine
port
port numbername
name of the teammachine
name 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
=AI
ID (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 machine
port
port numbermachine
name 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_ai
The server also have a logging system implemented with multiple level.
The levels are set using the -l
argument and are the following.
ERROR
WARNING
(default)INFO
DEBUG
DISABLE
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 |
---|