Edouard Silvestre
Back to projects

Epitech · End of 2nd year · Group project

Zappy

A networked game where autonomous AIs cooperate through messages. Mine reach the maximum level.

  • C
  • C++
  • Python
  • Réseau
Try it
Period
June 2026
Team
Team project
Code
Private repository
elevation · level 8serveur C · select / epollIA Python · broadcastfig. 05 — Zappy · AIs cooperating over the network

The project

Zappy is a networked game: a TCP server in C handles many concurrent clients in real time (select, epoll), a C++ engine renders the game, and autonomous AI clients in Python play as a team.

Players gather resources and level up through collective rituals. They coordinate only through broadcast messages.

My part

  • I built the players’ AI: symmetric strategy, elevation rituals, supplier players.
  • It reaches the maximum level, level 8.

What was hard

  • The last two levels need 6 players on the same square, at the same time, with the right stones, for the whole ritual.
  • Three forces work against it: stones run out, searching for rare stones scatters the team, and waiting in place starves the players.
  • Meeting up without coordinates: the server only gives the direction a message comes from.

What I learned

  • Splitting the work instead of asking everyone to do everything: 6 players climb, 4 supply. With this idea, the success rate goes from 40% to 100% on our defence configuration.
  • Letting roles emerge without a hard-coded leader: every player runs the same code, and a shared rule decides each one’s role.
  • Planning for failure: if a player dies, another one takes its place automatically.

Try it.

A real game, replayed

I launched five of my AIs on a 42 × 42 map and recorded everything the server announces: moves, pickups, messages, rituals. The replay plays these events back as they happened. In this game, six players reach level 8 in just under 5 minutes, while four suppliers stay at level 1. The game runs on the reference server of the assignment.

The strategy

The last two levels need 6 players on the same square, at the same time, with the right stones. The whole AI is built around that problem.

  1. Step 1fork

    Growth

    The team grows from 5 to 10 players: 6 for the rituals, 4 suppliers.

  2. Step 2symétrique

    Roles without a boss

    Every player runs the same code. The 6 oldest become ritual players, the others suppliers. If one dies, another takes its place.

  3. Step 3broadcast

    Meeting point

    The oldest one settles and broadcasts a beacon. The others converge by sound: the server only gives the direction of a message.

  4. Step 4

    Supply

    Suppliers shuttle back and forth and drop food and stones on the ritual square, so that the 6 never have to leave.

  5. Step 5incantation

    Rituals

    The leader only counts the ritual players on its square, then starts the elevation when everything is there.