Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
class_name SampleBoard
extends RefCounted
## The example board: road encounters, loot chains, a d100 ranged travel table
## and a d100 table of 100 unique trinkets.
const TRINKETS : = [
" A brass key that ' s warm to the touch " , " A glass eye that follows movement " , " A tin whistle only dogs can hear " , " A pressed flower that never wilts " ,
" A tiny portrait of a stranger " , " A compass that points to the nearest well " , " A wooden die with seven sides " , " A silver spoon bent into a ring " ,
" A sealed letter addressed to you " , " A bell with no clapper that still rings " , " A jar of buttons from a hundred coats " , " A dragon scale the size of a coin " ,
" A candle that burns cold " , " A deck of cards missing every queen " , " A bird skull painted gold " , " A map of a city that doesn ' t exist " ,
" A thimble of sand that never spills " , " A ribbon embroidered with your name " , " A clockwork beetle that wants winding " , " A pebble that is always wet " ,
" A fishhook carved from bone " , " A coin from a kingdom that fell " , " A lock of silver hair tied with string " , " A broken hourglass, sand still falling " ,
" A soup recipe written in blood " , " A doll with one button eye " , " A chess piece shaped like a crow " , " A vial of fog " ,
" A tooth with a tiny keyhole " , " A feather that falls upward " , " An empty locket that hums " , " A spool of thread that never runs out " ,
" A ring too small for any finger " , " A wax seal of a three-eyed owl " , " A shell that whispers in a strange tongue " , " A rusted crown sized for a cat " ,
" A knot no blade can cut " , " A page torn from a spellbook " , " A marble with a storm inside " , " A tiny saddle for a mouse " ,
" A mirror shard that shows yesterday " , " A reed flute that plays by itself " , " A holed stone that shows stars at noon " , " A child ' s drawing of you " ,
" A spice tin of dried fireflies " , " A wooden sword notched for every win " , " A pair of dice that always roll the same " , " An acorn that grows back each night " ,
" A tarnished medal for bravery " , " A bottle with a ship of bones inside " , " A glove that ' s always warm " , " A bookmark from a library that burned " ,
" A walnut that rattles " , " A copper ring stamped with a moon " , " A lantern wick that relights itself " , " A painted egg that is far too heavy " ,
" A bag of salt from a distant sea " , " A wanted poster with no face " , " A spinning top that never falls " , " A snuff box full of teeth " ,
" A crystal that glows near goblins " , " A riddle carved into a spoon handle " , " A scarf that smells of summer rain " , " A key with no teeth " ,
" A thumb-sized statue of a sleeping god " , " A bone flute with one hole " , " An inkwell that refills with black water " , " A quill that writes only in red " ,
" A pocket watch running backwards " , " A wedding ring with both names scratched out " , " An eggshell painted with a map " , " A pouch of mismatched dice " ,
" A tinderbox that sparks blue " , " A prayer bead from an unknown faith " , " A playing card with your face on it " , " A cracked monocle " ,
" A tiny cage with the door open " , " A pressed four-leaf clover " , " A seashell found far inland " , " A gold tooth " ,
" A badge from the city watch " , " A charm bracelet with one charm missing " , " A bundle of letters tied with twine " , " A chip of a giant ' s fingernail " ,
" A rope that ties itself " , " A stone that floats " , " A song trapped in a bottle " , " A carved wooden fish " ,
" A toy soldier missing an arm " , " A coin that always lands on its edge " , " A candle stub that smells of home " , " A brooch shaped like a spider " ,
" A sliver of moonlight in a vial " , " An arrowhead made of glass " , " A dried rose from a grave " , " A bone die marked with runes " ,
" A tiny shield with an unknown crest " , " A horseshoe for a six-legged horse " , " A note: “Don ' t trust the innkeeper” " , " An egg that is warm and ticking " ,
]
static func create ( ) - > TowerBoard :
var trinket_rows : Array = [ ]
for s in TRINKETS :
trinket_rows . append ( [ s ] )
2026-11-08 12:11:43 -06:00
# [id, name, position, entries: [text, pipes?, range?, {details?, weight?}?], options?]
# options: dice, collapsed, details, tags, card_mode
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
var spec : Array = [
[ " wilderness " , " Wilderness Travel " , Vector2 ( 40 , 180 ) , [
2026-11-08 12:11:43 -06:00
[ " Travelers on the road " , [ " road " ] , [ 1 , 30 ] , { " details " : " Most days the road is just the road. Roll on the Road Encounter table to see who is on it. " } ] ,
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
[ " Beasts on the hunt " , [ " monsters " ] , [ 31 , 50 ] ] ,
[ " A peddler ' s cart " , [ " wares " ] , [ 51 , 65 ] ] ,
[ " Something glints in the grass " , [ " loot " ] , [ 66 , 80 ] ] ,
[ " A stranger at the campfire " , [ " names " ] , [ 81 , 95 ] ] ,
[ " An odd find " , [ " trinkets " ] , [ 96 , 100 ] ] ,
2026-11-08 12:11:43 -06:00
] , { " dice " : " 1d100 " , " details " : " Roll once per [b]travel day[/b]. Each result sends you to a table for the details of what the party meets. " , " tags " : [ " travel " ] } ] ,
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
[ " road " , " Road Encounter " , Vector2 ( 390 , 40 ) , [
[ " Bandits ambush the party " , [ " loot " ] ] , [ " A merchant caravan " , [ " wares " ] ] ,
[ " Something big in the trees " , [ " monsters " ] ] , [ " A quiet stretch of road " ] ,
[ " A sudden storm rolls in " ] , [ " A lost traveler " , [ " names " ] ] ,
] ] ,
[ " trinkets " , " Curious Trinkets " , Vector2 ( 390 , 420 ) , trinket_rows , { " collapsed " : true } ] ,
2026-11-08 12:11:43 -06:00
[ " monsters " , " Monsters " , Vector2 ( 740 , 20 ) , [
[ " Owlbear " , [ " loot " ] , null , { " details " : " [b]Owlbear[/b]: AC 13, 59 HP. Multiattack: beak and claws. Grabs and crushes anything that comes close to its nest. " } ] ,
[ " Giant spider " ] ,
[ " Troll " , [ " loot " ] , null , { " details " : " [b]Troll[/b]: AC 15, 84 HP. Regenerates 10 HP each turn unless hit by [i]fire[/i] or [i]acid[/i]. " } ] ,
[ " Wyvern " ] ,
] , { " tags " : [ " combat " ] } ] ,
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
[ " wares " , " Merchant Wares " , Vector2 ( 740 , 300 ) , [ [ " Bolts of silk " ] , [ " Rare spices " ] , [ " Lamp oil " ] , [ " A crate of strange eggs " ] ] ] ,
[ " loot " , " Loot " , Vector2 ( 1090 , 60 ) , [
2026-11-08 12:11:43 -06:00
[ " A pouch of gold " , [ ] , null , { " weight " : 3 } ] , [ " A weapon " , [ " weapons " ] ] , [ " A healing potion " ] ,
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
[ " A torn map " ] , [ " A gemstone " ] , [ " Nothing but lint " ] ,
2026-11-08 12:11:43 -06:00
] , { " tags " : [ " treasure " ] } ] ,
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
[ " names " , " Traveler Names " , Vector2 ( 1090 , 400 ) , [ [ " Aldric " ] , [ " Brenna " ] , [ " Corvin " ] , [ " Dagny " ] , [ " Elowen " ] , [ " Fenn " ] ] ] ,
[ " weapons " , " Weapons " , Vector2 ( 1440 , 60 ) , [ [ " Dagger " ] , [ " Sword " , [ " quality " ] ] , [ " Hand axe " ] , [ " Shortbow " ] ] ] ,
[ " quality " , " Sword Quality " , Vector2 ( 1790 , 130 ) , [ [ " Rusty " ] , [ " Notched " ] , [ " Fine " ] , [ " Elven-forged " ] ] ] ,
2026-11-08 12:11:43 -06:00
[ " party_roles " , " Party Roles " , Vector2 ( 1440 , 330 ) , [
[ " Scout " ] , [ " Map keeper " ] , [ " Quartermaster " ] , [ " Lookout " ] , [ " Cook " ] , [ " Diplomat " ] ,
] , { " card_mode " : true , " details " : " Hand out one role per player. Each role is dealt once until everyone has had one, then the deck is reshuffled. " } ] ,
[ " weather " , " Weather " , Vector2 ( 1790 , 380 ) , [
[ " Storm " , [ ] , [ 2 , 3 ] ] , [ " Rain " , [ ] , [ 4 , 5 ] ] , [ " Overcast " , [ ] , [ 6 , 8 ] ] ,
[ " Clear skies " , [ ] , [ 9 , 10 ] ] , [ " Heat wave " , [ ] , [ 11 , 12 ] ] ,
] , { " dice " : " 2d6 " , " details " : " Roll [b]2d6[/b]. Middling weather is the most common. " } ] ,
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
]
var board : = TowerBoard . new ( )
for s in spec :
var t : = RollTable . new ( s [ 0 ] , s [ 1 ] )
t . position = s [ 2 ]
var opts : Dictionary = s [ 4 ] if s . size ( ) > 4 else { }
2026-11-08 12:11:43 -06:00
t . dice = str ( opts . get ( " dice " , RollTable . DEFAULT_DICE ) )
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
t . collapsed = bool ( opts . get ( " collapsed " , false ) )
2026-11-08 12:11:43 -06:00
t . details = str ( opts . get ( " details " , " " ) )
for tag in opts . get ( " tags " , [ ] ) :
t . tags . append ( tag )
t . card_mode = bool ( opts . get ( " card_mode " , false ) )
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
for row in s [ 3 ] :
var e : = TableEntry . new ( TowerBoard . new_id ( " e " ) , row [ 0 ] )
if row . size ( ) > 1 :
for p in row [ 1 ] :
2026-11-08 12:11:43 -06:00
e . add_pipe ( p )
if row . size ( ) > 2 and row [ 2 ] != null :
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
e . has_range = true
e . range_lo = row [ 2 ] [ 0 ]
e . range_hi = row [ 2 ] [ 1 ]
2026-11-08 12:11:43 -06:00
if row . size ( ) > 3 :
e . details = str ( row [ 3 ] . get ( " details " , " " ) )
e . weight = int ( row [ 3 ] . get ( " weight " , 1 ) )
Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.
- core/: data model (RollTable, TableEntry, TowerBoard), sample board
with a d100 table of 100 trinkets and a weighted d100 range table,
and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
cards, result tray with earlier rolls, undo toasts, and a Collapse all
/ Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00
t . entries . append ( e )
board . tables . append ( t )
return board