Installation¶
This page describes how to compile the three Zappy components from the repository. To launch them afterwards, see Launching.
Prerequisites¶
| Component | Required tools |
|---|---|
Server (zappy_server) |
g++ with C++17 support, GNU make |
GUI (zappy_gui) |
g++ C++17, GNU make and Raylib installed on the system |
AI (zappy_ai) |
Python 3.11+ (standard library only) |
| Launcher (optional) | clang++ C++17 and SFML (graphics, window, system, audio) |
Raylib is not bundled with the repository
The GUI assumes Raylib is already installed on the machine (distribution
package or built from source): it is dynamically linked
(-lraylib -lGL -lm -lpthread -ldl -lrt -lX11) and is neither vendored nor
downloaded automatically. The detailed procedure is on the
Installing Raylib page.
The AI needs no external dependency
zappy_ai is written in pure Python, with no third-party dependency
(pyproject.toml, dependencies = []). A Python 3.11+ interpreter is all
you need. No compilation is required for the AI.
Building with the root Makefile¶
The Makefile at the root of the repository orchestrates building all three
components and produces the binaries under the names mandated by Epitech:
zappy_server, zappy_gui, zappy_ai.
| Target | Effect |
|---|---|
make (= make all) |
Builds the GUI then the AI then the server, and writes the wrapper scripts zappy_gui, zappy_ai, zappy_server at the root |
make re |
fclean then full rebuild (all) |
make clean |
Cleans the GUI and server objects (not the AI) |
make fclean |
clean then removes the three wrapper scripts at the root |
Concretely, the all target runs:
make -C gui— compiles the binarygui/build/zappy_gui(g++ C++17, linked against Raylib);- the
aitarget — performs no compilation (interpreted Python), it merely writes the wrapper script; make -C server— compiles the network libraryserver/build/libnetwork.athen the binaryserver/build/zappy_server(g++ C++17).
make clean does not touch the AI
Since the AI has no build artifacts, make clean acts only on gui/ and
server/. Only make fclean also removes the zappy_ai wrapper.
The wrapper-script mechanism¶
The real executables are produced in sub-directories (gui/build/,
server/build/) and the AI runs from ai/. To honour the Epitech convention
requiring binaries named zappy_server, zappy_gui and zappy_ai at the
repository root, the Makefile generates three small shell scripts that move
into the right directory before running the actual program:
These wrappers (made executable via chmod +x) forward all their arguments
("$@") to the underlying program. The cd matters: it lets the GUI find its
assets (relative paths) and the AI find its src/ module.
graph LR
A["./zappy_server -p 4242 ..."] --> B["cd server/build/"]
B --> C["exec ./zappy_server -p 4242 ..."]
D["./zappy_ai -p 4242 ..."] --> E["cd ai"]
E --> F["exec python3 zappy_ai -p 4242 ..."]
Building a single component manually¶
Each component has its own Makefile, useful to rebuild just one part:
make -C server # server only -> server/build/zappy_server
make -C gui # GUI only -> gui/build/zappy_gui
Without wrapper
Building with make -C server produces the binary but does not write
the wrapper script at the root; to get the wrappers, go through make (or
the dedicated make server / make gui target) from the root.
The SFML launcher (optional)¶
An optional graphical orchestrator, written in C++17 with SFML, lets you configure then launch the whole stack from a window. It is not built by the root Makefile; compile it separately:
Its detailed behaviour (settings, launching) is described in Launching.
ia/ is a dead directory
The repository contains an ia/ directory which is legacy/obsolete: the
AI actually used lives in ai/ (it is the one referenced by the root
Makefile and the zappy_ai binary). Ignore ia/.