- GDScript 86.1%
- JavaScript 9.7%
- CSS 3%
- HTML 0.5%
- GAP 0.4%
- Other 0.3%
| assets | ||
| audio | ||
| boards | ||
| docs | ||
| locale | ||
| scenes | ||
| scripts | ||
| shops | ||
| tests | ||
| tools | ||
| ui | ||
| web | ||
| .gitignore | ||
| default_bus_layout.tres | ||
| DESIGN.md | ||
| project.godot | ||
| README.md | ||
Party Board Game
A 3D party board game for 4–8 players, built in Godot 4. See DESIGN.md for the game design.
Current state
- Phones are the controllers (any device with a browser): everyone scans the code to join, and each phone is that player's private screen.
- Lobby: three screens. The title (Play, Options, Quit, with every character on a stage and the join code in the corner); Who's playing?, where everyone joins, picks one of 20 characters on their phone (each only once) and taps Ready; and the game setup: board (with a preview), turns, time per turn (30–90 s or unlimited), duels, bot seats and skill, and practice minigames. The host (the first person to join) moves between them on their phone; the TV works with the mouse and keyboard too.
- Boards: Gloomwood Manor (night-time manor grounds where the Phantom hunts the leader; at midnight it moves further and the manor doors open), Sunny Side Fair (an amusement park: ride the roller coaster across the park, invest in stalls) and Tidewater Harbor (a fishing town: the tide floods the low wharf, a drawbridge toll, the cannery belt). Boards are built from a kit of gimmicks (switches, day/night, flooding, investments, conveyors, a bomb, toll roads, a shifting maze), all on the Gimmick Playground test board.
- Board camera: follows the action (whoever is still moving, events, the crown) and pulls back to an overview while everyone plans; a minimap shows the whole board.
- Board engine: everyone rolls at the same time on their phone, then everyone moves at once, tick by tick, deciding as they arrive: forks, the crown (buy one or two), shops and steal spaces (waypoints, which don't use a step). The final 3 rounds are announced with the standings: blue and red spaces count double and the music speeds up. Duels, landing spaces, items (Double Die, Precision Die, Trap Kit, Shield), hidden traps and the turn limit work.
- Dev menu: swipe up from the bottom of a phone in a game for coins, crowns, the next roll and skipping a minigame (a lobby setting, on by default when run from the editor; every use shows in the TV's log).
- Minigames: a framework (free-for-all, 1 vs all, 2v2 / 3v3 / 4v4, 2v2v2 / 2v2v2v2 and duels; bots for every game; a roulette picks each one on the TV) and twenty-two minigames: Coin Scramble (grab coins, dash to knock them loose), Tug of War (mash A; team strength is averaged), Unique Pick (secret number picks), Pachinko Drop (aim and drop balls through pegs), Quick Draw (reaction time, timed on the phone so Wi-Fi lag doesn't matter), Color Echo (repeat the sequence on your phone), Mole Bop (whack-a-mole on your own phone, live race on the TV), Ledge Walk (split screen: walk a narrow, windy ledge to the goal), Lucky Doors (pure luck: pick a door, avoid the ghost), Bumper Ring (dash others off a shrinking ring), Sweeper (jump a speeding beam with one button) Stopwatch (stop a hidden timer at exactly the target time) and Turf Paint (cover the floor in your colour; SPLAT paints a circle and stuns rivals; teams share territory) and Row Row Race (split screen, a column per team: everyone is an oar, row on the beat and steer by pace), Push Ball (teams shove a giant ball into the other goal), Mind Meld (teams score when teammates secretly pick the same answer), Balloon Volley (keep the balloon off your side), Shark Tank (1 vs all: the shark must catch every swimmer before the pool shrinks away), Stomper (1 vs all: hide in a lane, or stomp them, more feet each round), Tile Stomp (Stomper on a 5×5 floor: stomped rows and columns break for good), Button Mash (mash for 10 s; the secret counts climb together at the end) and Raise the Flag (spin a crank on your phone; teams crank one flag). They run after every round and for duels, or on their own via practice mode.
- Sound: music for the lobby, each board and minigames, and effects for board events
(dice, steps, coins, crowns, duels, traps, the Phantom), the minigame countdown and
minigame moments. All CC0; see
audio/CREDITS.md.
Running
Open the project in Godot 4.7+ and press Play, or:
godot --path .
Joining
Scan the QR code on the TV with a phone on the same Wi-Fi (any device with a browser works) and enter a name; "Leave" on the phone leaves. Each browser tab is its own player, so for testing on one PC you can open the controller page in several tabs.
The lobby (scenes/main.tscn, scripts/lobby/lobby.gd) has three screens; the host (first
person to join) moves between them on their phone, and the TV's buttons work with the mouse:
- Title: Play, Options (language, music and sound volume, dev menu) and Quit.
- Who's playing?: a seat card per player with their character in 3D. Phones show all 20
characters (
assets/portraits/, served as/portraits/<id>.png); each can be taken by one player, and the phone remembers its last pick. Everyone taps Ready; when all connected players are ready, the host goes on to the setup. - Game setup: the host's phone opens the setup sheet (board, rules, Start, Practice); everyone else can still change character. After a game, the lobby comes back to Who's playing? with nobody ready; after practice, to the screen it left.
- Settings (and the Music and Sounds volumes) are remembered between launches in
user://settings.cfg; tests and smoke runs neither read nor write it. - Bots fill empty seats when the game starts (setting "Bots": fill to N players, or none), each with a random name and leave when you return to the lobby.
Developer shortcuts in the lobby: F5 start, F4 practice, Enter next screen, F11 fullscreen,
Esc back (quits on the title). -- --lobby-shots=DIR saves a TV screenshot every second.
On the board, phones show each decision as buttons, roll an animated die, and have a Map
button: an interactive board map (drag, pinch, double-tap to reset, tap a space for details)
showing everyone's position and the crown, plus private overlays only you see: your hidden
traps and where your roll can land. At a fork, the phone draws the fork: tap the arrow for the way
you want. Each way shows a trail of where your remaining steps go, where you'd stop, and how far
the crown is that way. If time runs out, remaining decisions take their default. Esc twice (within 3 s) returns to the lobby.
The TV's player bar is sorted by placement. Whenever a phone shows its board screen (lobby, board,
watching), a row of emotes (Nice!, Haha!, Oh no!...) along the bottom pops a speech bubble
with your name on the TV (Overlay autoload, scenes/ui/overlay.tscn). At each minigame's
ready-up, phones show your team or role, the rules and the controls.
At the end, the TV reveals the final standings (last place first) and up to four just-for-fun awards (Minigame Star plus a random few of Explorer, Rotten Luck, Shopaholic, Trickster, Pickpocket and High Roller). The host then picks Play again (same players, bots and settings) or Back to lobby on their phone; on the TV, click a button or press F5 (play again) or Esc (lobby).
Minigames
Each minigame is a scene in scenes/minigames/ (camera, lights, sky and arena, built in the
editor) whose root has a Minigame script from scripts/minigames/games/, and a
MinigameDefinition node in the scene (id, title, rules, controls, compositions, min and max
players; problems show as warnings on the node). MinigameRegistry finds every scene there with
one, reading the node without building the scene. Adding a minigame is the scene and its
script. The script spawns only what depends on the players, reads their
PlayerInput, provides a BotBrain for bots, and ends with placements (best first, ties
grouped). It runs in an isolated SubViewport. Editor tool nodes in scripts/minigames/props/
generate adjustable pieces, e.g. Pachinko's PegGrid and SlotRow, and Ledge Walk's
LedgeCourse. The Minigame base has helpers for common kinds of game: spawn_character()
(still until GO, stopped at the end), knock_out() / is_decided() / finish_by_survival()
(last one or last team standing), points and points_line() (score tallies), and
collect_app_answers() (a round of answers from the phone apps).
Compositions (Composition): each minigame lists the ones it supports. Free-for-all (2+
players; board duels use free-for-all games too), 1 vs all (3+), even teams 2v2, 3v3 and 4v4,
and pairs 2v2v2 and 2v2v2v2. Team compositions need their exact player count, so 5 or 7
players only get free-for-all and 1 vs all. Each round, MinigameDirector picks a category
(about 25% teams, 15% 1 vs all, otherwise free-for-all, when the player count allows it and a
game fits), then a composition in it, random teams, and the game, avoiding recent ones; the
select screen (MinigameSelect) shows up to five fitting games and spins onto that one.
Split screen: a minigame that returns views from split_views() is shown split screen, each
area a SplitView (scenes/ui/split_view.tscn) that follows the view's camera, with its label
and a colour strip. Views are per player (player_view(), e.g. Ledge Walk) or per team
(team_view(), e.g. Row Row Race). split_layout() arranges them: a grid (2 side by side,
then 2 x 2, 3 x 2, 4 x 2; the default), columns (tall strips side by side) or rows (wide strips,
stacked).
A minigame chooses what phones show with phone_layout(): a joystick and buttons named for
what they do ("buttons": [{"id": "a", "label": "Jump!"}]; "a" is the primary action and
the biggest button; with no joystick the buttons fill the phone), prompts, or
a phone app ({"mode": "app", "app": name}): a small app in web/js/apps/<name>.js
(listed in web/js/apps/index.js) that the minigame talks to with send_app() / app_messages(). Bots answer
through their BotBrain (on_app() / app_outbox), so every app game works with bots.
Players.pad_layout() and Players.app_layout() build these. MinigameHost handles intro,
countdown and results. Prizes (RoundLogic): free-for-all 10/7/5/3/2/1/1 by place, and
nothing for whoever is last on their own; teams by the team's place (2 teams 10/0, 3 teams
10/5/0, 4 teams 10/6/3/0); 1 vs all 20 for a solo win, 10 each for the others; a draw 5 each.
Making a board
Boards are scenes in boards/, built in the Godot editor; every .tscn there shows up in the
lobby. docs/making-a-board.md is the full guide: a quick start,
paths and space types, every gimmick's settings, testing, design tips and troubleshooting.
The Gimmick Playground (tests/fixtures/gimmick_playground.tscn, in the lobby while the dev
menu is on) is a working example of every feature.
Shops: every shop space sells its own stock. Pick a ShopStock in the space's shop field:
the ready-made ones are in shops/ (general, dice, travel, tricks), or make one in the inspector
(a title, a short tag shown on the space, an emoji for the phone map, and items with optional
prices; 0 means the catalog price in scripts/board/items.gd). Empty means the general store.
Phone controllers
The game hosts a small web server on the local network:
http://<lan-ip>:8080/serves the controller page (web/index.html,web/style.cssand the modules inweb/js/:main.jswires them up, and each part (pad, prompts, map, lobby, apps...) registers for its own messages withnet.on())ws://<lan-ip>:8081/carries input and messages
Nothing needs installing on the phone. Phones that lock their screen or reload the page rejoin as the same player.
Firewall: phones must be able to reach ports 8080 and 8081. With firewalld (openSUSE, Fedora) open them for your Wi-Fi's zone, for this session only:
sudo firewall-cmd --zone=home --add-port=8080-8081/tcp
Add --permanent and run sudo firewall-cmd --reload to keep the rule. Check your zone with
firewall-cmd --get-active-zones.
Tests
Unit tests live in tests/suites/*_test.gd, one file per area. Each extends TestSuite
(check(), make_player() and shared helpers), and every method named test_* runs, in
order. Add a test by adding a method; there's no list to update. New class_name scripts need
a class cache refresh first (godot --headless --editor --quit, or open the editor once).
# Rules: board loading/validation, movement, crown, duels, payouts, compositions, every gimmick
# (--suite=<name> runs one suite, e.g. -- --suite=minigames)
godot --headless --path . tests/run_tests.tscn
# Full game: 4 bots play 3 rounds at 8x speed, then it quits. Options:
# --turns=N, --players=N (bots), --turn-time=S (0 = unlimited),
# --board=res://boards/<file>.tscn (any board, e.g. tests/fixtures/gimmick_playground.tscn),
# --join-wait=S (seconds for test phones to join; default 2),
# --set=Node.property=value (change a board node's setting, e.g. --set=Bomb.start=1),
# --place=SPACE (everyone starts there), --first-roll=N (everyone's first roll),
# --items=cursed_die,swap_card (everyone starts with these items),
# --choose=SPACE (bots take that way whenever a fork offers it),
# --composition=C (every round's minigame in that composition if it fits, e.g. 2v2v2v2),
# --language=sv (play in another language; works for any run, not just smoke tests),
# --shots=DIR [--shot-every=S] (save TV screenshots; needs a display).
# Bots start with two random items, and private actions are printed as PRIVATE lines.
godot --headless --path . -- --board-smoke
# Watching a game: record it with Godot's Movie Writer (1 frame a second is plenty to check
# what's on screen; log lines then show their frame number)
godot --path . --write-movie /tmp/movie/f.png --fixed-fps 1 -- --board-smoke --time-scale=1
# Every minigame in every composition (and as a duel) with bots at 8x speed, then it quits
# (--minigame=<id> runs just one, --players=N plays with N bots, --join-wait=S as above;
# for any smoke test,
# --time-scale=1 runs at real speed; --repeat=N plays the list N times, --bot-level=Easy|Normal|Hard
# sets the bots' skill, --stats records the runs, see "Minigame stats" below)
godot --headless --path . -- --minigame-smoke
# QR encoder: writes PNGs to verify with an external decoder such as zbarimg
godot --headless --path . -s tests/qr_selftest.gd -- /some/output/dir
Minigame stats
For tuning the bots: while the dev menu is on, every minigame played (on the board or in
practice) is appended to user://stats/minigames.jsonl (on Linux
~/.local/share/godot/app_userdata/Party Board Game/stats/), one JSON line per game. Each line
lists every player: their name, human or bot (with the bot level), team, place, points,
knock-out time, when they were done early, and the game's own numbers: falls and finish time
in Ledge Walk, reaction times in Quick Draw, misses in Stopwatch, strokes on the beat in Row Row
Race... (Minigame.stats_of; games add theirs with stat_add, stat_set and stat_push).
Smoke runs only record with --stats, so bot-only test runs don't mix in by accident.
# Averages per minigame, humans vs each bot level (also written to user://stats/summary.csv);
# options after --: --source=board|practice|smoke, --minigame=<id>, --real-speed
godot --headless --path . tools/minigame_stats.tscn
# Bot averages: every minigame, 5 times, with Hard bots, at real speed
godot --headless --path . -- --minigame-smoke --stats --bot-level=Hard --repeat=5 --time-scale=1
Languages
The game is in English and Swedish. The whole table shares one language: Language in the lobby setup (remembered; it starts as the computer's language if the game has it). The TV and every phone switch together, and the phones get their text from the game.
- Code: wrap player-visible text:
I18n.t("%s found a coin purse!") % name(translate first, then fill in) andI18n.n("%d crown", "%d crowns", n) % nfor plurals. Write whole sentences; don't glue English words together, since other languages order them differently. - Constant lists of text (hazard texts, item names, emotes) can't call functions: end each
line with
# i18nand translate where it's used (I18n.t(HAZARD_TEXTS.pick_random())). A line with text that's not for players (debug output, ids) can end with# no-i18n. - Scenes: Labels and Buttons translate their own text. Minigame info files, board names,
descriptions and fork labels are extracted too. The game translates them where they're shown
(
info.shown_title(),Board.label_for...). - Phone page:
t("Map"),t("You rolled %d!", n)andtn("%d step", "%d steps", n)fromweb/js/i18n.js, anddata-i18non fixed HTML text. - Board-author text (validation errors, editor warnings) stays English.
The test tests/suites/i18n_test.gd fails if player-visible text isn't wrapped, or if a string
has no Swedish translation. To update after changing text:
godot --headless --path . tools/make_pot.tscn # regenerates locale/messages.pot
msgmerge --update locale/sv.po locale/messages.pot # then translate the new entries (e.g. Poedit)
To add a language: create locale/<code>.po from messages.pot (e.g. msginit or Poedit), add
it to Project Settings → Localization, and to I18n.LANGUAGES. --language=<code> on the
command line plays in it (for checking without changing the saved setting).
Sound
scenes/audio/sound.tscn is the Sound autoload. Each child of Cues is an
AudioStreamPlayer named after a cue (coin_gain, dice_roll, count_3, ...), usually with
an AudioStreamRandomizer holding a few takes and some pitch variation. To change a sound,
open the scene and swap the stream; to add one, add a player and call Sound.play(&"name").
Music cross-fades: the lobby, minigame and default board tracks are set on the Sound node, a
board picks its own with the music property on its BoardDefinition, and a minigame can
override its track with music on its root. Music files are imported with looping on.
Volume goes through the Music and SFX buses (default_bus_layout.tres).
Scenes and styling
Everything visual is a scene you can open in the editor: the lobby (scenes/main.tscn), the
UI in scenes/ui/, each minigame, each board and the props in scenes/props/. Scripts only
fill in what depends on the game (players, names, scores). UI styling comes from one theme,
ui/theme.tres: Fredoka for headings and Nunito for body text (assets/fonts/, SIL OFL),
rounded buttons (PrimaryButton is the gold one), and named styles such as HeaderLabel,
MutedLabel, CardPanel and SolidPanel picked via each node's Theme Type Variation. The lobby
background is a shader (ui/party_background.gdshader); the crown and coin icons are SVGs in
ui/icons/. Players are Kenney Mini Characters (scenes/props/character.tscn, a CharacterModel): all 20
are in CharacterModel.MODELS, each player picks one in the lobby (Player.character; bots get a
random free one), a ring at its feet shows the player's color, and play("walk") etc. runs
the model's animations. The Phantom is Kenney's animated ghost; the crown and coins are from a
CC0 treasure pack.
The Transition autoload (scenes/ui/transition.tscn) fades between screens: use
Transition.change_scene(path) instead of changing scenes directly. The phone page uses the
same fonts (served at /fonts/...) and tints its background with the player's color.
Layout
boards/ Board scenes (.tscn)
scripts/board/ Board model, round rules (pure, tested), game loop (BoardGame, and its parts:
Planning, Traps, StealSpace, Shop, ChanceSpaces, MinigameDirector, GameEnd,
DevTools), GameHost (what gimmicks may use), view, camera, HUD, board rules
scripts/board/authoring/ Editor nodes for building boards: BoardDefinition, BoardPath, BoardSpace
scripts/common/ Scene-building helpers, board preview/minimap, placeholder character, Palette, UiText
scenes/minigames/ Minigame scenes (each with a MinigameDefinition node)
scenes/ui/ UI scenes: board HUD and its player cards, minigame overlay (intro, results), results,
setup panel, lobby cards, split view, transition
scenes/props/ Reusable props: player character, crown, coins, Phantom
scenes/audio/ The Sound autoload scene: effect cues and music tracks
assets/models/ CC0 3D models (Kenney kits) and CREDITS.md
assets/fonts/ Fredoka and Nunito (SIL OFL) and CREDITS.md
scripts/board/props/ Board props built in code: coaster, Ferris wheel, carousel, bunting
audio/ Sound files (sfx/, voice/, music/) and CREDITS.md
ui/theme.tres The shared UI theme (project default): panels, fonts, label styles
scripts/minigames/ Minigame framework (base, host, registry, compositions, select screen, bot
brains, practice), games/, props/
scripts/net/ PhoneServer autoload (HTTP + WebSocket), PhoneClient, QR encoder
scripts/input/ PlayerInput and its phone and bot implementations
scripts/players/ Players autoload (seats), Player, Prompt (private questions)
scripts/lobby/ Lobby menu and game setup panel
scripts/session.gd Session autoload: game settings, board list
locale/ Translations: messages.pot (the template) and sv.po (Swedish)
tools/ make_pot.tscn: regenerates the translation template; board_stats.tscn: a board's
loops, forks and crown distances; character_portraits.tscn:
renders the character pictures for phones (needs a display)
web/ Phone controller page: index.html, style.css, js/ (ES modules; js/apps/ has one
file per minigame phone app)
When exporting, add web/* (its * covers the subfolders too) and assets/fonts/*.ttf to
the export preset's "non-resource files" filter so the controller page and its fonts are
included.