# Gizmo Jam

A Godot party game for up to six players, in the spirit of early-2000s
console party minigames. Play on desktop, Android, or the web.

- **01 Spin Cycle** — reaction and survival. Six robot runners stand side by
  side on one wide spiral ramp around a reactor tower, jumping over low orange
  rods and ducking under high violet rods as they sweep round. The ramp
  accelerates; the seventh hit eliminates you. The last survivor wins.
- **02 Live Wire** — territory and chaos. Six runners paint a 169-tile hex
  reactor floor for 90 seconds; whoever owns the most tiles at the buzzer wins.
  Running over a tile makes it yours. Closing a loop captures everything inside
  it and locks those tiles for about ten seconds. Red surge lines charge across
  the floor and then fire: anyone still standing on one is stunned and loses
  their largest patch. A dash on a short cooldown gets you out of trouble and
  shoves whoever is in the way. The last 20 seconds are overdrive: more surges,
  and nothing locks.
- **03 Bumper Cars** — steer and boost to ram other cars off a floating dock.
  Five rings sink one at a time. Last car afloat wins.
- **04 Sumo** — shove rivals out of a fixed ring to score. Fallen robots
  respawn, and the high score after 90 seconds wins.
- **05 Orb Racing** — steer a rolling orb through ordered checkpoints.
  Drive over charge strips to refill your boost and finish three laps first.
- **06 Stampede Sheriff** — guide wind-up critters into your pen. Clap to
  scatter or steal a herd. Gold critters score double, and the highest score
  after 90 seconds wins. Requires Gizmo Jam 0.3.4 or newer.
- **07 Plate Panic** — tilt a shared table to roll marbles into your pocket.
  Place a wedge to redirect a marble. Most marbles banked in 90 seconds wins.
- **08 Salvage Line** — hook drifting cargo and tow it back to your harbor.
  Cut exposed rival ropes to steal a haul. Heavy crates move slower and score
  double. Most cargo weight delivered in 90 seconds wins.

## Play

Native builds are in `builds/`:

- Windows x64: `windows/GizmoJam.exe` or `GizmoJam-windows.zip`.
- Linux x64: `linux/GizmoJam.x86_64` or `GizmoJam-linux.zip`.
- macOS Intel and Apple Silicon: `macos/GizmoJam.zip`, containing a universal app.

Windows and Linux builds include the game data in the executable. No Godot
installation is needed to play. Linux may need `chmod +x GizmoJam.x86_64`
after extraction. The macOS development build is ad-hoc signed and unnotarized;
macOS may require local approval before it will open. Public
distribution should use Developer ID signing and notarization on a Mac.

Choose a game by clicking its card on the main menu; the selected card is
outlined in lime, the arena behind the menu changes to match, and the choice is
remembered. Each card has a **How to Play** button. **Play Solo** plays the
selected game against five bots, and **Host Party** opens a lobby on it. On desktop,
install additional games through **Game Library**. The public browser build and
Android app include them. Menus also work from the keyboard: the
main action is focused, so **Enter** or **Space** confirms it.

Keyboard or gamepad on computers, touch on phones and tablets. In every game
**Esc** or **Start** opens the menu, **Tab** or **Y** (held) shows names, and
**F11** toggles fullscreen.

- **Spin Cycle:** **Space / Up** to jump; **hold S / Down** to duck. On a pad,
  **A** or **up** jumps; **B**, **down**, a trigger or a shoulder (held) ducks.
  Jump temporarily overrides a held duck; holding duck resumes it after landing.
- **Live Wire:** **W A S D** or the **arrow keys** to run (hold two for a
  diagonal); **Space** to dash in the direction you are running. On a pad, the
  **d-pad** or **left stick** runs and **A** dashes. A direction held during
  the countdown counts from GO. Opening the menu, losing window focus or the
  end of the round lets go of everything.
- **Bumper Cars, Sumo, and Orb Racing:** **WASD**, **arrows**, the **left stick**,
  or the **d-pad** to steer. **Space** or **A** boosts in Bumper Cars and Orb
  Racing and shoves in Sumo. In Sumo, release movement to brace.
- **Stampede Sheriff:** **WASD**, **arrows**, the **left stick**, or the **d-pad**
  to move. Press **Space** or **A** to clap in your last movement direction.
- **Plate Panic:** **WASD**, **arrows**, the **left stick**, or the **d-pad** to
  move. Press **Space** or **A** to drop a wedge in your last movement direction.
- **Salvage Line:** **WASD**, **arrows**, the **left stick**, or the **d-pad** to
  steer. Press **Space** or **A** to hook, cut, or release the highlighted target.
  Tow cargo into your numbered harbor and tap the action again to deliver it.

#### Several players on one screen

Plug in (or pair) a gamepad per player. Player one is the keyboard plus one
pad: on a machine nobody has typed on yet, such as a TV box, the first pad to
press a button is player one's, and it also drives the menus (**d-pad** or
stick to move, **A** to confirm, **B** to go back). Every other pad joins as a
player of its own by pressing **A** or **Start** on the menu, or in the lobby
of a party this machine hosts, and leaves again with **B** or **Back**. The
menu lists who is playing on this screen, and **Play** starts a round with all
of them against bots for the empty seats. Hosting works the same way: the extra
players take seats in the party and remote players fill the rest, up to six.

A round with more than one player on the screen marks every one of their
runners and plates, calls each player's hits, clears, zaps and loops out over
their own plate, and leaves out the whole-screen hit effects. Unplugging a pad
mid-round hands its runner to a bot, exactly like a dropped connection. A
computer that joins somebody else's party has one player; there every pad
drives it. The extra seats are ordinary party seats owned by the host
computer, so older builds that join see them as more players.

**Phones and tablets** (the Android app, and the browser version on a device
whose main pointer is a finger) get touch controls and a larger interface.
Computers, including touchscreen laptops, keep the keyboard layout unchanged.

- **Spin Cycle:** **tap the right half** of the screen to jump, **hold the
  left half** to duck.
- **Live Wire, Bumper Cars, Sumo, Orb Racing, Stampede Sheriff, Plate Panic, and
  Salvage Line:** drag your **left thumb** to move. The stick appears under your
  thumb and follows it past the rim. **Tap the right half** to use your game's
  action.
- **MENU** (top right) pauses, with any finger.
- **Notches:** on a phone with a camera cut-out, the interface stays clear of
  it; the 3D scene still fills the screen.
- Touch sends exactly the inputs the keys send, so phones play in the same
  parties as computers, including 0.2.0 builds.
- **Testing:** `tests/test_touch.gd` runs in `run_tests.py`. To force the
  phone layout on desktop, pass `-- --handheld`; to simulate a camera
  cut-out, add `--safe-inset=<px>`.

### Spin Cycle HUD

During a round the HUD floats directly on the arena, with no panels. The
top-centre plate calls the next obstacle: an orange plate led by an up-pointing
wedge means **JUMP**, a violet plate led by a down-pointing wedge means **DUCK**.
Its chip counts down to impact and flips to **NOW!** when you need to act, and
the fuse bar under it fills as the rod closes in. Each runner has a plate along
the bottom in their own colour: a seven-block coil gauge that burns down one
block per hit (the number in its hub is the hits left), a large score, and a
name banner tagged **YOU**, **CPU** or **P2**–**P6**. Eliminated runners turn
grey and are stamped **OUT**. The top-left shows the round clock, the speed
multiplier and a stack of six bars, in seat order, comparing every runner's
score with the leader's. Press **Esc** for the menu, and hold **Tab** for names.

### Live Wire HUD

The same kit, laid out around the board so that no tile is ever covered.

- **Top-left:** the time remaining (it turns red and kicks every second for the
  last ten), a chip with the surge level (**Surge ×1 / ×2 / ×3**) in the stage
  colour, the stage name (warm-up, charged, overdrive · no locks) and the six
  standings bars, each as long as that runner's share of the leader's tiles.
- **Top-centre:** the surge call-out. It is empty until a line starts charging,
  then a gold **SURGE** plate drops in, led by a hex tile with a bolt, with the
  seconds until it fires and a fuse that fills. If *you* are standing on that
  line the plate turns red, grows, pulses and says **MOVE!**, and a thin hazard
  frame pulses around the screen until you step off. During the countdown the
  same slot shows the controls.
- **Feedback** pops just under the call-out, above the first row of tiles:
  **ZAPPED! −12 TILES** (with a screen rattle and the hazard frame),
  **LOOP! +9 LOCKED**, **DIRECT HIT!** when your dash shoves someone,
  **SHOVED!** when you are the one sent flying, and the stage changes.
- **Bottom:** six plates in seat order. The big number is the tiles that runner
  owns right now. The hex ring beside it is their dash: six blocks refill
  during the cooldown and the hub lights up with the dash chevrons when it is
  ready — on your own plate that is your dash, on the others it tells you who
  can shove you. A zapped runner's ring goes red under a **ZAP** stamp for as
  long as they are stunned. The leader carries a gold **1ST** tab and a
  gold-rimmed banner.

The round ends with **TIME’S UP!** over the frozen board, then the results:
winner or draw, and a table of tiles, peak tiles, loops closed, zaps taken and
shoves landed, on top of the finished floor. Behind the menu and the lobby, six
bots play an endless exhibition match on it.

## Updates

The game's version (for example **v0.2.0**) is shown small in the bottom-right
corner of the menu, lobby and results screens. Builds before v0.2.0 (the
2026-11-17 downloads, counted as 0.1.0) have no updater: replace them by hand
from <https://timholum.com/games/gizmo-jam/>.

From v0.2.0 on, the game checks for a new version once each time it starts, in
the background with a short timeout. Offline, or if anything goes wrong, it
shows nothing. **Check for updates: On/Off**, next to the version on the menu,
turns the check off; the setting is saved.

When a new version exists, a card in the top-right corner of the menu says
**Update available: v0.3.0**. **Notes** shows the release notes, **Later** hides
the card until the next launch, and **Update now** downloads the new build with
a progress bar, checks its size and SHA-256 against the signed manifest,
installs it next to the current one and restarts into it. The card never
appears during a round. In an online lobby or on online results it moves to the
bottom-right and installing is disabled until you leave the party, since
installing restarts the game. A download that finishes during a round waits as
**Ready to install** until you are back on the menu.

If anything fails, the card says what happened and offers the **Download page**.
In-place updates need a game folder you can write to: on Linux the folder that
holds `GizmoJam.x86_64`, on Windows the folder with `GizmoJam.exe`, and on macOS
the folder holding `Gizmo Jam.app` (for example Applications). macOS also
refuses to update an app it is running from a quarantined download location;
move the app to Applications first. A game run from source in the editor only
reports updates.

**Recovery.** The previous version is kept beside the new one
(`GizmoJam.x86_64.old`, `GizmoJam.exe.old`, or a hidden `.Gizmo Jam.app.old`)
until the new version reaches its menu, and is then deleted. If the new version
closes before reaching its menu, the old one puts itself back and says so. If
the new version never reached its menu (for example it crashed and you started
it again), it restores the previous version on that next start and launches it.
If even that fails, the previous version is still in the `.old` file or folder
and can be run directly.

## Graphics

The runners are six boxy toy robots, one per seat, each in the same saturated
colour as its HUD plate. They are one original Meshy-generated model, rigged
and animated: they jog, break into a sprint as the belt speeds up, leap the low
rollers, slide under the high ones, stagger when hit, and are bowled off down
the belt when their last coil goes. The winner cheers on a podium. In Live Wire
the same robots run flat out across the floor, lean into a dash, stagger when
shoved and reel on the spot, flashing white, when a surge catches them.

Spin Cycle's arena is a bright teal reactor shaft built in code from chunky flat-shaded
pieces: a glowing coolant core in a grey frame, a panelled conveyor deck with
painted chevrons that travel with the belt, light strips, yellow safety rails
and layered gantries fading into haze. Each rod is a striped roller on an arm:
a collar rides a rail on the core, a carriage rides the outer kerb. **Orange
rollers are low (jump), violet rollers are high (duck)**; nothing else in the
scene uses those two colours. Every runner has a ring in its colour on the deck
and a shadow that stays on the deck when it jumps. A lime bar across the deck
marks the line where the rollers meet the runners.

Live Wire's arena is a raised grey hex deck in the same teal reactor hall: cyan
light strips and orange safety rails round the rim, an emitter socket at both
ends of every line, reactor cores and gantries fading into haze. Tiles light up
in their owner's colour, locked tiles rise with a bright frame, a charging
surge is a hazard-striped cable between two emitters and a firing one is a fat
bolt. The hall swings to coral in overdrive.

**Graphics** has three levels, picked with the **Low / Balanced / High** keys at
the foot of the menu. All three use the same gameplay, collision timing and
network simulation.

- **High** adds 4× antialiasing, the full-detail robot mesh, a true silhouette
  shadow under every runner, drifting motes and a soft glow round the core (on
  Live Wire: antialiasing and the full-detail mesh; its tiles are unlit light
  panels).
- **Balanced** uses a lighter robot mesh (about 5,700 triangles) and soft blob
  shadows.
- **Low** is for old or weak GPUs, the Raspberry Pi and software rendering. On
  a GPU it keeps High's scenery, lighting and atmosphere: the full structure,
  all three gantry rings, the motes and glow veil, all three lights and the fog,
  High's full-detail robots over blob shadows, the deck's full pattern and the
  shade bands behind the HUD. The light and fog on the scenery are worked out
  ahead of time (per vertex, with the renderer's own formulas) instead of per
  pixel, and the deck's pattern is read from a texture made at start-up. What
  it gives up against High is MSAA, the silhouette shadows, a faint specular
  sheen and resolution: the 3D is drawn at 67% of the window's resolution and
  stretched up, while the HUD and menus stay at full resolution. That 3D
  resolution then follows the frame rate: it steps down when the game cannot
  hold 30 fps (never below 50%) and up when there is room (up to full); each
  round starts at 67%. On a software rasteriser Low is lighter still: the light
  robot mesh (about 2,100 triangles; the podium robot keeps Balanced's), a
  lighter cut of Spin Cycle's ramp and reactor frame, one ring of plain
  gantries, only the key light and no motes or veil. Rods keep their orange and
  violet, runners keep their team colours, and the jump, duck and hit poses are
  the same clips on the same clock on every level.

A new installation picks **High** on a hardware GPU and **Low** on a software
renderer (an adapter named llvmpipe, softpipe, SwiftShader, lavapipe or similar)
or a Raspberry Pi GPU (V3D or VC4).
The choice is saved as `graphics/level` in `user://settings.cfg`. A settings file
from an older build has only `graphics/detailed`, which is read as High (true) or
Balanced (false); new builds still write it for older builds to read.

Measured with the graphics probe at 1280x720 on Mesa llvmpipe under Xvfb, in a
full six-runner round (frames per second, ranges over interleaved runs; this
host had 24 cores and a load average of about 9–18):

| Round | llvmpipe threads | Low | Balanced | High |
| --- | --- | --- | --- | --- |
| Spin Cycle | all | 65 | 46–48 | 19 |
| Spin Cycle | 2 (a weak CPU) | 42 | 26 | 8 |
| Live Wire | all | 75–78 | 73–75 | 41 |
| Live Wire | 2 (a weak CPU) | 45–49 | 41 | 19 |

Low's 95th-percentile frame in Spin Cycle on two threads is 28 ms, against 44
ms on Balanced. Live Wire's room is already baked, unlit geometry, so Low gains
less there. The two-thread rows come from `LP_NUM_THREADS=2`, which stands in
for an old or heavily loaded machine.

On a Raspberry Pi 4 B (Mesa V3D, OpenGL ES 3.1; fan-cooled, no throttling),
fullscreen at 1280x720, Low runs Spin Cycle at about 29 fps with its 3D at
67% and Live Wire at about 39 fps at 87%; High manages 7 and 20 fps. Run the
Pi's output at 720p and let the TV scale it. A 30-second trace of either game
has no frame over twice the median once the countdown is over. What it took,
measured with `tests/perf_diag.gd` and `tests/quality_cost.gd` (A/B costs of
parts of a running round, and of each of High's features),
`tests/spike_trace.gd` (slow frames and what appeared in them),
`tests/low_bake_compare.gd` and `tests/low_vs_high.gd` (the looks):

- Low's reduced-resolution 3D goes through a SubViewport
  (`scripts/scaled_view.gd`): the root viewport's own scaled 3D cost ~9 ms a
  frame on the Pi even for an empty scene. (Drawing the root straight to the
  screen looked ~8 ms faster too, but only because on the Pi nothing reached
  the screen; don't.)
- On V3D any lit material costs ~4 ms and the engine fog ~4.6 ms, so Low bakes
  High's three lights and its fog into unshaded scenery shaders (`BAKED_LIGHT`
  in `scripts/arena_kit.gd`). The Compatibility renderer treats ALBEDO as sRGB
  for every material, so the baked shaders convert with its own functions.
- The HUD's shapes are batched (`Kit.Batch`): a player plate is 7 draw calls
  instead of ~60, on every level.
- Both games draw everything that would compile a shader or rasterise glyphs on
  first use during the countdown (rods, bursts, trails, sparks, effect rings,
  3D and HUD call-outs, identity tags): each of those first appearances cost
  75-150 ms on the Pi.

The levers that made no measurable difference on llvmpipe (a cheaper deck
shader, vertex lighting, unshaded robots, fewer particles, hiding the sky dome)
are not used. Frame timings are machine-specific; more evidence is under
`test-output/iterations/` (`art-pass-*`). Meshy generation and asset-build helpers are
development-only and excluded from exports; `assets/meshy/README.md` records
asset provenance, budgets and the build steps.

## Screens and windows

The game fits windows from 1024x576 up to 2560x1440 and beyond, at shapes from
4:3 to 21:9, windowed or fullscreen, with no black bars. Every screen lays
itself out against the visible area and follows the window when it is resized,
mid-round included. The menus keep a column on the left and slide the arena into
the space beside it; on short windows they switch to a compact rhythm. The
round HUD keeps its corners, centres its call-outs, and lines the six player
plates up along the bottom: on a narrow window they shrink together so none
overlaps another, on a very wide one they stay centred.

Scale rule: the UI is drawn at min(width / 1440, height / 900) of its design
size, clamped to between 0.85 and 1.5. The lower bound keeps 14 px text at about
12 px on a 1024-pixel-wide window; the upper bound stops it ballooning on a
2560x1440 screen. The 3D cameras keep the 16:10 design's horizontal view on
narrower screens, so the line of runners and Live Wire's board never lose their
ends, and Live Wire's camera also widens on short screens to keep the whole
board between the HUD bands.

On first launch the window is sized to fit the screen's usable area (taskbars
and docks excluded) and centred: 1280x800 where it fits, smaller where it does
not, never below 1024x576. **F11** toggles fullscreen.

## Audio

An original announcer calls the countdown, speed-ups, knockouts, the final two
and the winner. Sound effects cover jumping, ducking, clears, hits, knockouts,
rod warnings, menus and victory. Live Wire adds the announcer lines "Live
Wire!", "Surge incoming!", "Zapped!", "Locked in!", "Ten seconds!" and "Time's
up!", and effects for the dash, a shove, the zap, the tile tick, the loop
lock-in, and a surge charging and firing. The repeating ones are rate-limited:
the tile tick plays at most about seven times a second, lines that charge or
fire together make one sound, and "Surge incoming!" is kept for the first surge
of a round and for lines that start under your own feet. All voice lines and
effects were generated with ElevenLabs and ship as `.ogg` files in
`assets/audio/`. **Sound: On/Off** in the menu mutes everything. To regenerate or add lines, edit the manifest in
`tools/generate_audio.py` and run it with `ELEVENLABS_API_KEY` set (`--force`
regenerates, `--reprocess` rebuilds from the cached downloads).

## Network play: one server, up to six people

1. The server person picks a game, enters a name and clicks **Host Party**. The
   dialog asks for the UDP port (default **7777**), then **Open Lobby**. Permit
   the game through the host computer's firewall (see **Firewall** below). The
   lobby says **Visible on your network** while nearby players can find the
   party.
2. Other players on the same network click **Join Party** and pick the party
   from the list. Each entry shows the host's name, players **n/6**, and
   whether the party is in the lobby or mid-round. Click it, or press
   **Enter** on it, to join. The lobby accepts players without host approval.
   Parties mid-round, full, or from a different game version are listed but
   cannot be joined until that changes. If the party is not listed (internet,
   VPN, or a network that blocks broadcast), type the join address from the
   host's lobby and the same port into the fields under the list, then
   **Connect**.
3. The lobby's **Next Game** panel shows which game is up. The party host can
   switch it there between rounds; everyone's lobby follows, arena included.
4. The party host clicks **Start for Everyone**. All connected players enter
   the same round automatically. Open seats become bots.
5. After the round, the party host can replay or return everyone to the lobby.
   Additional players can join between rounds. A disconnected player's runner
   becomes a bot for the rest of the round.

For LAN play the list is all you need. The lobby also shows the server's LAN
IP, with a copy button, for typing in by hand.
For internet play, use its public IP and forward the selected **UDP** port to
the server computer. A routable VPN can also connect friends. There is no
matchmaking, relay service, automatic NAT traversal, or invitation account
system. Networks behind carrier-grade NAT may need a VPN or a reachable server.
Players can be on different versions (see **Games and mixed versions**). The server runs the only simulation of
either game and sends its state twenty times a second; clients draw from that
and submit nothing but their own inputs, which the server files under the
sender's own seat. Spin Cycle sends jump and duck. Live Wire sends a press
and a release for each held direction and a press for the dash; a game's
inputs are dropped while the other game is being played.

### Browser guests

Friends on the same network can join from a web browser without installing
anything. In **Host Party**, turn **Browser guests** on before opening the
lobby. The lobby then shows an address such as `http://192.168.1.20:7780`;
friends open it, type a name and press **Join the party**. Adding
`?name=SAM&join=1` to the address joins straight away.

- The host is always the installed game; browsers can't host or see the
  party list. The page is served by the host's computer, so no internet is
  needed, and it is always the host's own version.
- Browsers connect on **TCP port 7781** (next to the file port 7780). Allow
  the game through the firewall.
- The browser version starts on Low graphics and runs slower than the
  installed game, especially on older computers; it is the option for
  someone who can't or won't install. Browser sound uses an older audio path
  because the page is plain HTTP; if a browser stays silent, the game still
  plays.
- The host fetches the browser version (about 13 MB) from the download server
  the first time browser guests are turned on, checks it against the signed
  catalog, and keeps it.
- Native players are unaffected: with browser guests off, hosting is exactly
  as before, and with them on the installed players still use UDP.

### LAN discovery

While a party is hosted, in the lobby and during rounds, the server sends a
small UDP beacon about once a second to discovery port **7778**: to
255.255.255.255 and to each network interface's subnet broadcast address, so a
computer on Wi-Fi and Ethernet at once, or with a VPN, reaches every LAN it is
on. The beacon carries only the host's display name, the game port, players
connected and the six-seat maximum, whether a round is running, the game name,
the game's network protocol version, and a random number chosen each time a
party opens. Nothing else about the computer or player is sent. Beacons stop
as soon as the party closes, the host leaves, or the game quits. The Join Party
dialog listens only while it is open, and ignores anything that is not exactly
a Gizmo Jam beacon. An entry disappears about 3.5 seconds after its beacon
stops. If another program on the same computer already uses port 7778 (often a
second copy of the game), the dialog says so and the address fields still
work.

### Firewall

- **Host computer:** allow the game to receive on the **UDP game port** (7777
  by default), as before, and to send UDP broadcast to port **7778**. Outbound
  traffic is normally allowed already.
- **Joining computers:** allow the game to receive **UDP port 7778** on the
  local/private network, or the party list stays empty. Windows usually asks the first
  time you open Join Party; choose **Private networks**. Joining by address
  does not need this.
- Discovery works within one network segment. Routers do not forward
  broadcast, and many guest Wi-Fi networks block traffic between devices; use
  the address fields there.

## Switch Host

The **party host** controls starting games, replaying, and returning the party
to the lobby. This role is separate from the computer running the network server.

- In the lobby, results, or **Esc → Party Controls**, click **Vote Host** beside
  the person who should take over. The proposer automatically votes yes.
- A strict majority of the **other players**, excluding the incumbent host,
  transfers control. With six humans this takes three votes; with two humans,
  the other person can take over. Bots do not vote. Each computer gets one
  vote: players sharing a screen share their computer's.
- The current host can hand over voluntarily using **Pass Host**.
- Votes expire after 25 seconds. If a remote party host disconnects, leadership
  passes to a remaining player automatically.

**The original server computer must remain running.** Voting transfers party
controls; it does not migrate the ENet server or its IP address. If that computer
closes the game or loses its connection, players return to the menu and must
host/join a new session. Online rounds continue while a party menu is open.

## Games and mixed versions

Spin Cycle and Live Wire are built into the game. Other games come as **game
packs**: small files the game downloads when it needs them, so a release that
only adds a game is one pack, not a new build of everything.

- **In a party** the host can pick any game the host has. A player who lacks
  it gets it automatically, first from the host's computer (no internet
  needed) and otherwise from the download server. The lobby shows each
  player's state: *Downloading 40%*, *Needs update*, *Restart to update* and
  so on. **Start for Everyone** waits for players who are still downloading;
  **Start anyway** starts without them. Anyone who cannot play the chosen game
  sits that round out in the lobby while a bot plays their seat, and is back
  in for the next game they have.
- **Older versions** still play together. A v0.2.0 player joins as before and
  plays Spin Cycle and Live Wire; for games it does not have it sits the
  round out.
- **Signed packs only.** A pack loads only if the signed game catalog lists its
  exact size and SHA-256, whether it came from the host or the server, and it
  may only add files inside its own game folder. A newer version of a game that
  is already loaded is installed for the next start (*Restart to update*).
- The host's computer serves packs over **TCP port 7780** (or the next free
  one) while a party is open. Allow the game through the firewall as for the
  UDP port.

### Game library

**Game Library** (above the game cards) lists every published game with its
version and size. **Install** gets one ahead of time, for solo play or a
party without waiting; **Remove** deletes it (it stays playable until the
next start); **Update** fetches a newer version for the next start. **Check
for new games** fetches the latest catalog. Changes are disabled while in a
party.

### Developer mode

**Developer mode** (bottom-right of the menu, off by default) lets **unsigned**
packs load, for making and testing games without publishing them. Turning it
on asks first. Packs dropped into the `dev-games` folder of the game's data
folder load as **UNTRUSTED**: the card, the lobby and the round HUD all say so.
When a host in developer mode picks an unsigned game, each player in
developer mode is asked before anything downloads (and asked again for every
rebuilt pack); players without developer mode sit the round out. An unsigned
pack can do anything Gizmo Jam can do on that computer, so only accept them
from people you trust. Making a game: [docs/making-a-game.md](docs/making-a-game.md).

## Development

Open `project.godot` in **Godot 4.5.1 standard** (no .NET dependencies), then F6/F5
or run `godot --path .`. The compatibility renderer targets desktop OpenGL 3.3.
No external libraries or generation services are required to play. The original
Meshy-generated robot runner is bundled with the game.

Install the matching standard export templates through Godot's export-template
manager. Presets for all three desktops are in `export_presets.cfg`.

```sh
python3 tools/build.py --godot /path/to/godot
python3 tests/run_tests.py --godot /path/to/godot
```

Game packs: `tests/test_packs.gd` checks the registry, party messages, the
signed catalog (forged, tampered, older and misdirected catalogs refused), the
pack file-table reader and path rule against crafted packs, and plays the
example game's model. `tests/run_packs.py` (also run by `run_tests.py`) plays
two real three-process parties with a throwaway signing key: a guest
downloads the example pack from the host and plays it while a real **v0.2.0**
guest sits the round out, then all three play Spin Cycle; and an unsigned
pack is offered to a developer-mode guest (asked, accepts) and to one without
developer mode (sits out). `tests/run_compat.py` plays online rounds between
this tree and v0.2.0 in every host/guest direction; `--binary` adds the
published v0.2.0 executable. Screens: `tests/pack_ui_shots.gd`.

```sh
python3 tests/run_compat.py --binary builds/linux/GizmoJam.x86_64   # a v0.2.0 build
```

The tests cover Spin Cycle's collision timing, scoring, seven-hit
elimination, rankings, snapshots, bot takeover, vote thresholds and vote
identity, and Live Wire's rules (`tests/test_livewire.gd`: claiming, loops and
locks, surges, dash and shove, overdrive, the packed snapshot, bots). They then
launch **six real Godot processes** (`tests/network_peer.gd`) for three rounds:
Live Wire on the real model, where every seat must move only the way its own
peer steers and the two dashes must land on their own seats; Spin Cycle
under a newly elected host; and Live Wire again, where one client disconnects
mid-round and its seat must become a bot on every remaining peer. Along the way
they check registration, game choice by the leader only, majority host
transfer, lobby return and relaunch. Last, `tests/run_online.py` plays one
online Live Wire round between **three copies of the real game**, driven
through its buttons and key events: the host switches games in the lobby, a
client's keys move its own runner and nobody else's in both the server's model
and its own snapshot copy, a player who leaves is replaced by a bot, and
everyone reaches the results and the lobby. Gamepads are driven the same way,
as real pad events with their own device ids: `tests/test_gamepads.gd` joins
and leaves pads on the menu, plays both games from several pads at once, pauses
and unplugs one mid-round; `tests/run_gamepad_online.py` has a host with a
second pad player and a remote guest play a Live Wire round, each seat moving
only for its own pad or keys on the server and in the guest's copy.
`run_tests.py` runs the online rounds as its last stages; on its own, and with
screenshots of what the joining player sees (`test-output/online-*.png`):

```sh
python3 tests/run_online.py --godot /path/to/godot
xvfb-run -a python3 tests/run_online.py --godot /path/to/godot --shots
```

LAN discovery is checked too: the beacon format and its strict validation
(malformed, oversized and hostile packets), soft failure when the discovery
port is taken, and expiry. Then **two real game processes** run, where one
hosts a party and the other finds it in the Join Party list, presses Enter on
the entry and checks the joined roster. That run sends beacons to 127.0.0.1 on
ports chosen by the test, with junk packets sprayed at the listener throughout,
so it is deterministic. A second run uses real broadcast and reports, rather
than fails, if the environment blocks it.

To verify the UI and render screenshots on Linux:

```sh
xvfb-run -a godot --path . --audio-driver Dummy --script tests/smoke_ui.gd
```

Additional presentation regressions check obstacle identity across menu/replay,
held duck at GO, client visual response, the robot's rig, clips and team tints,
what each quality level switches on (Low, Balanced and High), how old settings
files map to a level, the scale rule, and celebration cleanup:

```sh
.tools/Godot_v4.5.1-stable_linux.x86_64 --headless --path . --script tests/test_presentation.gd
xvfb-run -a .tools/Godot_v4.5.1-stable_linux.x86_64 --path . --audio-driver Dummy --disable-vsync --script tests/graphics_probe.gd -- --iteration=current
```

The graphics probe takes `--level=low|balanced|high` (or `--high`),
`--size=WxH` and `--game=twisted|livewire`. To measure at 1280x720, give Xvfb
and Godot the same size:

```sh
xvfb-run -a -s "-screen 0 1280x720x24" .tools/Godot_v4.5.1-stable_linux.x86_64 --path . --audio-driver Dummy --disable-vsync --resolution 1280x720 --script tests/graphics_probe.gd -- --iteration=low --level=low --size=1280x720
```

`tests/screen_sizes.gd` lays every screen of both games out at 1024x576,
1024x768, 1280x720, 1366x768, 1440x900, 1920x1080, 2560x1080 and 2560x1440,
resizing the window live between them, and checks that buttons and fields are
on screen and apart, dialogs fit, label text is at least 11 px, the HUD plates,
call-out, status and menu key do not collide, Spin Cycle's runners, action line
and incoming rod are in view above the plates, Live Wire's whole board is in
view and under no HUD widget, and the menus' runners or board stay clear of the
column. `run_tests.py` runs it headless (geometry only). With screenshots, in
`test-output/sizes/<W>x<H>/`:

```sh
xvfb-run -a -s "-screen 0 2560x1440x24" .tools/Godot_v4.5.1-stable_linux.x86_64 --path . --audio-driver Dummy --script tests/screen_sizes.gd -- --capture
```

Automated full matches use production key events: two Spin Cycle rounds,
a max-speed drill, and a 90-second solo Live Wire round in which an autopilot
runs, paints and dashes with W A S D and Space until the buzzer:

```sh
.tools/Godot_v4.5.1-stable_linux.x86_64 --path . --fixed-fps 60 --script tests/playthrough.gd
.tools/Godot_v4.5.1-stable_linux.x86_64 --path . --fixed-fps 60 --script tests/playthrough.gd -- --only=livewire
python3 tests/run_latency.py
```

The latency test routes two real ENet peers through a private delay/loss proxy;
it does not change host network configuration. Full-match automation is not a
human feel test. Hold **Tab** during play to inspect all runner names.

The graphics probe records frame timings and staged action/result screenshots.
Xvfb generally uses software rendering; use an accelerated display for GPU data.

The HUD widgets can be checked pixel for pixel after a change to how they
draw: `tests/hud_batch_shots.gd` renders every plate, status, cue and slam
state at 1280x720 and 1920x1080 and prints draw calls per widget;
`tests/hud_batch_compare.py` diffs two runs.

```sh
xvfb-run -a .tools/Godot_v4.5.1-stable_linux.x86_64 --path . --audio-driver Dummy --script tests/hud_batch_shots.gd -- --out=/tmp/hud_before
# ...change the drawing code, then shoot again to /tmp/hud_after...
python3 tests/hud_batch_compare.py /tmp/hud_before /tmp/hud_after --crops /tmp/hud_crops
```

The updater has unit tests in `tests/test_update.gd` (run by `run_tests.py`,
including manifests signed by `tools/release.py` with a throwaway key) and
these slower checks:

```sh
# The update card in every state, rendered on the real menu and lobby (test-output/update-*.png).
xvfb-run -a .tools/Godot_v4.5.1-stable_linux.x86_64 --path . --audio-driver Dummy --script tests/update_ui_shots.gd
# Linux end to end with real exports (~35 s): builds A (project version) and B (+1),
# serves B from a private 127.0.0.1 http.server and checks success, tampered
# manifest, bad hash, bad size, read-only folder, failed start, second-start restore.
python3 tests/update_e2e.py --godot .tools/Godot_v4.5.1-stable_linux.x86_64
# The Windows code path under Wine (headless, throwaway WINEPREFIX).
python3 tests/update_wine.py --godot .tools/Godot_v4.5.1-stable_linux.x86_64
# Real HTTPS against Wasabi using throwaway objects under games/gizmo-jam/updates/test/,
# deleted afterwards. Needs the publisher credentials; run update_e2e.py first.
python3 tests/update_wasabi.py
```

The end-to-end scripts sign their manifests with the release key, on a `test`
channel that the shipped game never accepts on its own. They temporarily bump
`project.godot` to build B and restore it afterwards. The test-only game
arguments are `--update-manifest=<url>` (another manifest URL; signatures are
still required, and plain `http://` is allowed only with it),
`--update-channel=<name>`, `--update-autoclick` (the card presses its own
**Update now** button) and `--no-update-check`.

The UI smoke test sends a keyboard event and follows menu → host → lobby →
round → party menu → results → lobby → menu. Images go to `test-output/`. The
Join dialog is captured searching (`join-dialog`), with parties listed
(`join-dialog-parties`), and with the discovery port taken (`join-dialog-busy`). It
also captures the HUD states a calm frame never shows (`countdown-slam`,
`countdown`, `clear`, `hit`, `eliminated`, `late`) and the solo winner screen
(`results-solo`). It then does the same for Live Wire: picking it on the menu
and in the lobby (`menu-livewire`, `rules-livewire`, `lobby-livewire`,
`lobby-guest`), the arena swap in every direction, a round played through real
key events (held directions, dash, pause, focus loss), every HUD state
(`livewire-countdown`, `-game`, `-surge`, `-danger`, `-zapped`, `-loop`,
`-overdrive`, `-final`, `-timeup`), the results (`livewire-results`,
`livewire-results-solo`), switching games between rounds, leaving, and a failed
connection. `-- --only=livewire` runs just that half.

File map:

- `scripts/main.gd` — screens, menus, the shared frame of the round HUD, and the
  hand-off to whichever game is being played. It knows the games only through
  the small surface described at the top of `scripts/game_spin_cycle.gd`.
- `scripts/game_spin_cycle.gd`, `scripts/game_livewire.gd` — one module per game:
  its model and arena, round HUD, key mapping, sounds, how-to-play dialog and
  results rows.
- `scripts/round_model.gd`, `scripts/livewire_model.gd` — the two independent
  simulations, with the same interface. `scripts/livewire_grid.gd` is the hex
  board shared by Live Wire's model and renderer.
- `scripts/arena.gd`, `scripts/livewire_arena.gd` — the 3D art of each game.
  Only the one that belongs to the game on screen is shown. `scripts/arena_kit.gd`
  holds Spin Cycle's building pieces and the shared shaders, and
  `scripts/runner_visual.gd` animates one robot runner for both games.
- `scripts/session.gd` — ENet, the roster, the game choice, input routing and
  host voting.
- `scripts/discovery.gd` — sends and receives the LAN party beacons.
- `scripts/updater.gd` — checks, downloads, verifies, installs and recovers
  updates. `scripts/update_core.gd` holds its pure logic (versions, manifest
  validation, signatures, swap plans), `scripts/update_notice.gd` draws the
  version tag and update card, and `scripts/update_keys.gd` lists the trusted
  release keys.
- `scripts/ui_kit.gd` — the shared palette, fonts and chunky drawing helpers,
  and `Batch`, which gathers a widget's shapes into one triangle list (the
  engine's own antialiasing geometry) so a HUD plate is a handful of draw
  calls rather than ~60. Widgets that redraw often call `Kit.begin(self)` at
  the top of `_draw()` and `flush()` at the end.
- `scripts/hud_*.gd` — the HUD widgets: `hud_cue` (the top-centre call-out, for
  rods and for surges), `hud_status` (clock, stage chip, standings), `hud_slam`
  (call-out text), `hud_plate` (Spin Cycle's player plate with the coil
  gauge) and `hud_wire_plate` (Live Wire's, with the hex dash ring).
- `scripts/audio.gd` — announcer and sound effects.

New minigames use the game-pack interface in [Making a game](docs/making-a-game.md).

## Releases

Game packs are published separately from the game; see **Game packs** below.

Each release has a version and a build number in `project.godot`:
`application/config/version` (semver, shown to players) and
`application/config/build` (an integer, raised by one every release; the game
compares builds, never version strings). The Windows and macOS version fields
in `export_presets.cfg` are empty, so exports take the project version.

To cut a release:

1. Bump `config/version` and `config/build` in `project.godot`, and commit.
2. Publish the browser build first (see **Game packs** below):
   `python3 tools/release_games.py --web --publish`. New hosts look for it in
   the catalog as soon as they update, and the website plays it. The same
   command then builds the Android app and releases it on Google Play (see
   **Android** below).
3. Dry run: `python3 tools/release.py --godot <godot> --notes "What's new"`.
   It builds all three platforms with `tools/build.py`, writes and signs the
   manifest under `builds/release/<version>/`, checks the live manifest and the
   release folder, and prints every upload without making any.
4. Publish: run the same command with `--publish`. It loads the Wasabi
   credentials from `~/.config/wasabi-timholum/publisher.env` (never from
   `~/.aws`), refuses to run if `releases/<version>/` already exists or the
   version and build are not newer than the live manifest, uploads the three
   builds, checks them over public HTTPS, and uploads the signed manifest.
   On stable it also publishes the website catalog, updating the download
   links and version shown on timholum.com.

Wasabi layout, bucket `timholum.com`, region `us-central-1`, public base
`https://s3.us-central-1.wasabisys.com/timholum.com/`:

- `games/gizmo-jam/releases/<version>/GizmoJam-Windows.exe`,
  `GizmoJam-Linux.x86_64` and `GizmoJam-macOS.zip`: immutable, never overwritten.
- `games/gizmo-jam/web/<version>/GizmoJam-web-<version>.zip`: the browser
  build party hosts serve; `web/<version>/play/`: the website's standalone
  export, with wasm, pck and js gzipped (`Content-Encoding: gzip`).
- `games/gizmo-jam/updates/catalog-stable.json`: the signed game catalog.
- `games/gizmo-jam/updates/stable.json`: the signed manifest, `Cache-Control:
  no-cache`. Its URL is a constant in `scripts/update_core.gd`.
- `games/gizmo-jam/site/catalog.json`: the public website catalog, also served
  with `Cache-Control: no-cache`. It references screenshots under `site/img/`
  with content hashes in their URLs so browsers can cache them long-term.

The manifest is JSON inside a signed envelope, so the signature and the
manifest are always uploaded together:

```json
{"format": "gizmo-signed-manifest/1", "alg": "rsa-pkcs1v15-sha256",
 "key_id": "gizmojam-e66eee89ecb223d4",
 "payload": "<base64 of the manifest bytes>", "signature": "<base64 RSA signature>"}
```

The payload it carries:

```json
{"schema": 1, "game": "gizmo-jam", "channel": "stable",
 "version": "0.3.0", "build": 3, "released": "2026-12-04",
 "notes": "New minigame: Sumo.", "min_updater_build": 0,
 "download_page": "https://timholum.com/games/gizmo-jam/",
 "platforms": {
   "windows": {"url": "https://…/releases/0.3.0/GizmoJam-Windows.exe", "size": 99636960, "sha256": "…"},
   "linux":   {"url": "https://…/releases/0.3.0/GizmoJam-Linux.x86_64", "size": 73176528, "sha256": "…"},
   "macos":   {"url": "https://…/releases/0.3.0/GizmoJam-macOS.zip", "size": 66192485, "sha256": "…"}}}
```

The game rejects any manifest that does not verify against a trusted key, is
for another `game` or `channel`, has an unknown `schema`, or is over 64 KiB.
It rejects any download whose size or SHA-256 differs from the signed values.
Builds older than `min_updater_build` are sent to the download page instead of
updating in place (`--min-updater-build`). Another game or channel can reuse the
same format with its own `game` id and `<channel>.json`.

### Signing key

The signature is RSA-3072, PKCS#1 v1.5 over SHA-256, made by `openssl` and
checked with Godot's `Crypto.verify`. The private key is at
`~/.config/gizmojam/release-signing.key` (mode 600, outside the repository);
only public keys are committed, in `scripts/update_keys.gd`. `tools/release.py`
refuses to sign with a key the game would not trust.

**Back the private key up now**, offline and encrypted (for example in a
password manager or on an encrypted USB drive). The bucket alone cannot push an
update: whoever holds this key can, so guard it like a password.

**Rotation**, while the old key still works:

1. Make a new key: `python3 tools/release.py --generate-key --key ~/.config/gizmojam/release-signing-2.key`.
   It prints the line to add to `scripts/update_keys.gd`. Keep both keys listed.
2. Release with the **old** key and `--next-key <new public key PEM file>`.
   Every game that installs or checks that manifest saves the announced key
   (in `user://update_keys.json`) and trusts it from then on.
3. Later releases are signed with the new key (`--key …-2.key`). Remove the old
   public key from `update_keys.gd` once no supported build needs it.

**If the key is lost or leaked**, installed games cannot be moved to a new key:
they trust only the keys they already know, so nothing signed with a new key
will install. Players must download the next version from the website once;
that build embeds the new key and updates normally from then on. If the key
leaked, also remove its entry from `update_keys.gd` in that build and delete
`stable.json` until the new build is published.

### Game packs

```sh
python3 tools/release_games.py --game sumo            # dry run
python3 tools/release_games.py --game sumo --publish
python3 tools/release_games.py --remove sumo --publish
```

It builds `games/<id>/` into a pack (`tools/build.py --pack <id>`), adds it to
the live catalog with its size and SHA-256, raises the catalog's serial, signs
the catalog with the release key, and uploads the pack to
`games/gizmo-jam/packs/<id>/<version>/` (never overwritten) and then the
catalog to `games/gizmo-jam/updates/catalog-<channel>.json`. A game is
republished only with a higher `version` in its `game.json`; change `net`
whenever the new version cannot play online with the old one. Games marked
`"publish": false` (the example) are refused.

Party hosts serve the browser version to browser guests, and it must be
exactly the host's build, so publish it with every core release (before
`tools/release.py --publish`):

```sh
python3 tools/release_games.py --web --publish
```

It also uploads the build unpacked to `web/<version>/play/` for the website's
**Play on the web** button. Opened over https rather than from a party host,
the browser build plays solo against bots, with the games in the signed
catalog at export time bundled into the build. Its party button opens the
download page because an HTTPS page cannot open a plain WebSocket to a
computer on the LAN. To ship a new pack with the next web version, include
it in the same release command, for example
`python3 tools/release_games.py --game bumper_cars --web --publish`. The stable
publish also refreshes the website catalog, including its browser link.

`tools/build.py --web` builds it alone into `builds/web/` and
`builds/GizmoJam-web-<version>.zip`. Pass `--bundle <id>` for each extra game
to include in the standalone export at `builds/web-play/<version>/`.
`tests/run_browser.py` (also run by
`run_tests.py` when Node and Google Chrome are installed) has headless Chrome
load it from a host on this machine's LAN address, join, play and press keys.

### Website catalog

Edit [web/site/catalog.json](web/site/catalog.json) for carousel order,
descriptions, and controls. For a new pack, add a `minigames` entry with
`desktopLibrary: true` and use its pack ID with hyphens in place of underscores.
Put WebP screenshots in `web/site/img/` and include the full image dimensions
and alt text. Smaller images can go in `sources`, keyed by width in pixels.
Use backticks around key names in `controls` to render keycaps.

Stable pack publishes add or remove games from the site according to the signed
pack catalog. The browser link follows the latest signed web build while the
desktop links, size, and release date follow the signed desktop manifest.
To preview a content edit, run `python3 tools/release_site.py`. It writes
`builds/release/site/catalog.json`. Run the same command with `--publish` to
publish a content-only edit or retry a failed website update.

### Android (Google Play)

There is no separate step. After every catalog it publishes, `release_games.py
--publish` builds the Android app and releases it on Google Play. That covers
the core release's `--web` step as well as each new game, so phones get both
with no extra command (`--no-android` skips it). If the Android part fails, the
catalog stays live, and the script prints the command to retry:
`python3 tools/play_publish.py --serial <n>`.

- **The app carries every game.** `tools/build.py --android` bundles exactly
  the games in the live signed catalog and refuses one whose `game.json`
  differs from the published version. The app has no updater, pack downloads,
  developer mode or browser guests; those are switched off by
  `PackManager.store_app`. Desktop and web builds are unchanged.
- **Version code:** `config/build × 10000 + catalog serial × 10 + revision`, so
  it rises with every core release and every game release. The revision is 0
  unless an Android-only rebuild of the same version needs a new code
  (`--android-revision 1`, up to 9); Play never accepts a version code twice. The version name is
  `config/version`.
- **Output:** `builds/android/GizmoJam-<version>.aab` for Play (with a `.json`
  beside it recording the version code, bundled games and SHA-256), and a
  `.apk` signed the same way for sideloading.
- **Track:** `TRACK` in `tools/play_publish.py`, currently `internal`. Set it
  to `production` once the phone controls are done.
  `python3 tools/play_publish.py --check` shows every track without changing
  anything.
- **Hardware:** `build.py` marks landscape and Wi-Fi optional in the Gradle
  template's manifest on every build, and fails if the app requires either:
  Play will not send such a release for review.
- **Toolchain:**
  - Android SDK in `~/Android/Sdk`: platform-tools, build-tools 35.0.1,
    platforms 35 and 36, NDK 28.1.13356709 and CMake 3.10.2.
  - JDK 17, set as `export/android/java_sdk_path` in the Godot editor settings.
  - Godot 4.5.1's Android export templates.
  - Godot's Gradle template goes into `android/`, which is gitignored, on the
    first build.
  - The app targets API 36, as Google Play has required for new apps and
    updates since 2026-08-31.
- **Secrets**, all in `~/.config/gizmo-jam/` (mode 600, never in the repo):
  - `android-upload.jks`, the upload keystore, and `android-upload.env`, which
    names it and holds its password. Google Play re-signs every release with
    the app signing key it keeps. Back up both files: a lost upload key can be
    reset through Play support, but that takes days.
  - `play-service-account.json`, the publishing key: a Google Cloud service
    account in project `gizmo-jam-publisher`, invited in Play Console with
    release rights on Gizmo Jam.

## Credits and licenses

Gizmo Jam is an independent game. Its code, models, environments, UI and
sounds were made for it. The code and those assets are released under the
MIT License (see `LICENSE`); the fonts keep their own licenses, below.

Built with [Godot](https://godotengine.org/) 4.5. The Lato fonts
are bundled under the license in `assets/fonts/LICENSE.txt`. The display face is
Kanit Black Italic (Copyright 2020 The Kanit Project Authors), bundled under the
SIL Open Font License 1.1 in `assets/fonts/Kanit-OFL.txt`. If that file is
missing the UI falls back to an emboldened, slanted Lato.
