Skip to content
Alrik Neihouser edited this page Jun 16, 2026 · 2 revisions

GUI

Status: Not yet started. The GUI will be built using Godot.

The GUI is a visualizer for the Zappy game. It connects to the server as a special observer client and renders the live game state — the map, players, resources, eggs, incantations, and team scores.

What it will do

From the project spec (PDF), the GUI must:

  • Display the toroidal Trantor map and all of its tiles.
  • Show players with their team, level, orientation, and inventory.
  • Show resources distributed across tiles.
  • Visualize eggs (laid by Fork, hatched on new player connection).
  • Highlight incantations in progress and their outcome.
  • Show the winning team when the game ends (seg event).
  • Let the operator query individual tiles, players, and the server time unit.

Server connection

The GUI connects exactly like a player but sends GRAPHIC\n instead of a team name after the server's WELCOME\n greeting.

Server → WELCOME\n
Client ← GRAPHIC\n
Server → (full game state snapshot)

The server immediately sends the full state on connection (gui_start): map size, all tile contents, team names, all current players with position/level/inventory, and the current time unit.

After that, the GUI receives passive events pushed by the server whenever something happens, without needing to poll. See the Server wiki page for the full event list.

GUI query commands

The GUI can also request data at any time:

Command Response
msz msz X Y — map dimensions
bct X Y tile resource counts
mct full map dump
tna list of team names
ppo #n player position and orientation
plv #n player level
pin #n player position + inventory
sgt current server time unit
sst T set server time unit

Technology choice

The GUI will be implemented in Godot. Godot's built-in networking (StreamPeerTCP) makes it straightforward to maintain a persistent TCP connection to the Zappy server and process newline-delimited messages in a game loop. The 2D tile renderer and scene system map naturally to Trantor's grid-based world.

Clone this wiki locally