Skip to content
Ethan CharpentierPortfolio

2025

Zappy

A network multiplayer survival game in C — server, AI client, and graphical client communicating over TCP sockets to race teams toward elevation.

Role
Developer
Tags
game, C, network, system-programming, 2year
Team
  • Charles Mahoudeau — Developer
  • Ewan Czarny — Developer
  • Jhong Almacin — Developer
  • Noé Caillaud — Developer
  • Thomas Boucard — Developer
Zappy — hero image

A network survival game built around three cooperating binaries: a single-threaded server simulating a tile-based world, an autonomous AI client driving a player through it, and a graphical client rendering the whole thing live — all synchronized purely over TCP sockets.

The problem

The server has to run as one process, one thread, multiplexing every connected client socket with poll and never busy-waiting — while simultaneously managing a toroidal tile map, resource spawning, food-based survival timers, a strict elevation ritual with per-level requirements, direction-aware sound broadcasting, and a request queue per client capped at 10 pending commands. On top of that, the AI client has to autonomously drive a player — foraging, coordinating elevation with teammates, and reproducing via fork — with no communication channel to other clients except what the server relays, while the GUI has to stay in sync with world state through incremental, event-driven updates rather than full redraws.

What We did

  • Implemented the server's core event loop around poll, handling all client sockets (AI clients and the reserved GRAPHIC team) in a single thread with zero blocking waits, dispatching buffered commands in received order and respecting the 10-request queue limit per client.
  • Modeled Trantor's toroidal world: resource spawning at startup and every 20 time units following the density formulas, food-based life countdown, and the full command set (Forward, Right, Left, Look, Inventory, Broadcast, Fork, Eject, Take, Set, Incantation) each with its own execution time scaled by 1/f.
  • Built the elevation ritual end-to-end: verifying stone and player-count requirements at both the start and end of the incantation, freezing participants for its duration, and leveling every same-level player present on success.
  • Implemented direction-aware Look (tile enumeration by distance and vision radius scaling with level) and Broadcast sound propagation, computing the shortest path around the wrapping map to determine the originating tile direction for each listener.
  • Wrote the autonomous AI client in C, connecting over the WELCOME/TEAM-NAME/CLIENT-NUM handshake and driving a player's full lifecycle — foraging, coordinating group elevation with teammates, and reproducing via fork — with no inter-client communication outside the server protocol.
  • Built the C++ graphical client following the mandatory GUI protocol, rendering the world in 2D and consuming the server's incremental tile-change events rather than polling full world state.

Outcome

A fully working three-binary network game — server, AI, and GUI — where teams autonomously forage, communicate by broadcast, and race to get six players through every elevation level, all driven by real socket-level multiplexing and protocol discipline rather than shortcuts.

  • Zappy — gallery image 1
  • Zappy — gallery image 2
  • Zappy — gallery image 3