xonecas.ioDon't click! Sean Caetano Martin Sign in

tiny-adventure

A procedurally generated, tiny Dungeons and Dragons style campaign in the browser, played with painted miniatures on a tabletop board. A Go server generates the world from a seed. A Three.js client renders it. Fights play out automatically from unit stats, abilities and gear. Your decisions are where to walk, when to fight, where to camp, and what to buy, sell and equip.

JavaScript, 26 commits, last push 1 day ago

Tiny Adventure

A procedurally generated, tiny Dungeons and Dragons style campaign in the browser, played with painted miniatures on a tabletop board. A Go server generates the world from a seed. A Three.js client renders it. Fights play out automatically from unit stats, abilities and gear. Your decisions are where to walk, when to fight, where to camp, and what to buy, sell and equip.

Run

go run ./cmd/server

Open http://localhost:8080. Flags:

  • --seed N gives every new player campaign seed N. Without it, each player gets a random seed.
  • --addr :8080 sets the listen address.
  • --web web sets the static files directory.
  • --data DIR keeps every game as an action log in DIR, so games survive a restart. Without it, games live in memory.

Each browser gets its own board through a cookie. The title screen continues it, and New campaign starts another. docs/deploy.md covers the public server at tiny-adventure.xonecas.io.

Art

Everything is drawn at runtime, with no image assets. The board and miniatures take flat colours from one palette in web/js/paint.js. Tiles you have not explored stay unpainted grey primer. The UI uses the role tokens in web/js/theme.js: warm greys, one amber accent for the objective, selection and primary action, and red for danger. Sound effects are synthesized with Web Audio in web/js/sound.js.

How a campaign is built

The seed decides every system and its details:

  • Enabled systems: factions, hazards, side quests, and which POI kinds are on the map (village, ruins, mine, tower, beach, camp, crypt).
  • Factions: names, themes and power, which set the enemy types and strength.
  • Main mission: reach the first place, recover a key from each place after it, then face the boss. The slots (POI kind, faction, key) are filled from the seed. Swapping a mine and vampires for a beach and lizardfolk only changes slot values.
  • Side quests: a few smaller missions that reuse the same step types.
  • Spawn: the party starts at structures whose hints point to the first main step.
  • Party: classes, stats and starting gear are rolled per seed, and each hero draws 3 abilities from their class pool, at least one of them an attack. Some seeds give an awkward party. Gear is how you fill the gaps.
  • Progression: enemy level grows with distance from the spawn. Gear comes from loot found on the map and from fights. XP comes from fights. The boss fight unlocks after every other main step is done.

Beating the boss ends the campaign with a victory screen. If the whole party falls, it ends with a defeat screen. Both show the run's numbers and put its share link in the address bar. Copy link copies it. The link opens that result card for anyone, with a preview image for chat apps, and Play this seed starts the same campaign.

Playing

  • Click a hex to walk there. Roads are fast, hills, shallows and forest are slow. Hovering a hex marks the route and its length, warns when night would fall on the way, and shows the hp its hazards would cost. Click another hex while walking to change course, or Esc or a click on the party to stop. Right-drag or Q/E rotates, the wheel zooms.
  • The next main objective is always marked with a light beam and labelled with its level (Lv N), even in the fog. J opens the journal, which marks the next step.
  • Walking toward a place that is still held stops you next to it and shows its defenders, your chance to win, and how much health the fight should cost. Fight (Enter) or back off (Esc).
  • Every hex walked spends daylight, and fights take time too. A day is long enough for several fights, so wounds pile up and potions carry you between camps. After dusk, make camp (C) once to heal everyone and start a new day, away from enemies. Shallows, mountains and harsh biomes wear the party down as it walks. P drinks a potion on the selected hero.
  • Traders (T) work at the spawns and at camps and villages you cleared. They sell potions and gear.
  • Roaming bands chase a party that comes near, from farther away at night. Backing off from a band shakes it off for a few moves. Some chests are guarded, trapped, or mimics. Lookouts reveal the land, shrines heal, and old caches grant XP.
  • The main quest asks you to recover keys from the places it names. The top bar counts them, and the boss stays sealed until you hold them all.
  • Walking over loot picks it up. Each base item has its own stats: daggers trade attack for speed and crit, plate trades speed for defense. The inventory and the trader compare every item with the selected hero's gear. Items may carry a trait, paid for with a lower stat, and rare items also grant an ability. Enemies show their abilities, traits, weaknesses and resistances on the threat card. Prepare (G) opens the inventory with live odds, so you can gear for the fight in front of you.
  • Fights play out one turn at a time, and you don't control them. Each hero and enemy has a role: tanks hit whoever hurt them last, strikers go for the weakest foe, casters and supports pick at random. Every unit heals, taunts and dodges when it makes sense, buffs only when the buff adds more damage than the attack it costs, and otherwise uses its strongest attack against the enemies in front of it. Space or a click speeds them up. Heroes who level up hop on the board, and their gains rise above their cards. A lost fight ends the campaign.
  • A hero who drops to 0 hp falls and lies on the board, greyed out. They sit out fights and earn no XP until a potion (P) gets them up at half health, or a night at camp brings everyone back.
  • After a fight and a gear change, Give feedback? opens a short form. The note goes in with the game's anonymous log.
  • M toggles sound.

Combat in short

  • Seven damage types: physical and poison scale with attack, and fire, frost, lightning, holy and shadow with magic.
  • Defense always cuts physical damage. A guard trait on gear, such as Fireguard, makes it cut that type too, and spares the hero that type's hazards on the map. Unguarded fire, frost, lightning, holy, shadow and poison go straight through defense.
  • Enemies take 1.5 times damage from the types they are weak to, and their defense covers the types they resist.
  • A weapon edge, such as of Embers, turns the wielder's physical abilities into that type.
  • Each class has a pool: fighters tank or bruise, rogues hit hard and are hard to hit, mages blast and support, clerics heal, rangers mark and shoot lightning.
  • Effects like Taunt, Rage, Sneak, Dodge, Ward, Rally, Mark and Haste take the caster's action and last one turn of the unit they land on. Rage readies the caster's next attack, and Taunt decides each foe's next attack.

The full rules and numbers are in docs/api.md, under Combat.

Check

scripts/verify.sh <outdir> [seed] runs the live-game harness at every resolution. scripts/playthrough.sh <outdir> <seed> [width height name] plays a whole campaign from the title to the end screen with real clicks, using the same careful bot as the verify fast-forward (scripts/bot.mjs), records it, and fails on a softlock, a state mismatch, a layout problem or a console error. See docs/verification.md.

go vet ./...
go test ./...

API reference: docs/api.md.