Settings

Theme

Show HN: Dwarf.land – autonomous dwarf civilization SIM with AI model routing

dwarf.land

4 points by kulesh 2 months ago · 5 comments · 2 min read

Reader

I built this in one day using 4 Claude Code sessions (~7,600 lines total, 4,300 in a single HTML file). No React, just one canvas + Web Workers. Cloudflare Workers + D1 backend.

What it is: 300 dwarfs on a 2000x1000 tile globe across 125 cities. Each dwarf has D&D-style stats (STR/DEX/CON/INT/WIS/CHA), mental state metrics (faith, morale, ambition), an AI-generated backstory, and a craft inventory. They eat, sleep, trade, and sail ships autonomously. Starvation is real: no food for 30 days = death.

The AI architecture I'm most curious to get feedback on: - 4-level model routing: Gemini Flash Lite -> DeepSeek -> Claude -> GPT-4o - Fire-and-forget: the simulation never blocks on AI. Requests are sent async, results cached, dwarfs pull from cache when idle - $8.50/hr hard budget cap via OpenRouter - Craft system: 296 base recipes + Gemini-generated unknowns (Water + Fire = Steam, etc.)

By default every dwarf runs on Gemini Flash Lite. If you send $1-10, your sponsored dwarf exits auto-sleep and gets Claude Opus instead. That was the monetisation idea -- sorta validated it – got $3. "It's not much but it's honest work".

Click any dwarf on the map and read their bio (you can Pause to make the busy fellas stop running). Curious what breaks for people.

vunderba 2 months ago

Nice job - it reminds me a bit of Dwarf Fortress.

Small feedback: Unless randomly sized identical tile sprites represent a functional difference (e.g. a bigger leaf means a more arable area, etc.), I would take them out as IMHO it's very aesthetically unappealing.

  • kuleshOP 2 months ago

    My son suggested it; we love it. I guess it's a subjective thing.

    • vunderba 2 months ago

      Could be. I think part of the problem is that the larger it is, the more obvious that it looks like clip art.

      It also calls "attention" to it - which could work if a large mountain represented a mechanical difference - more or richer ore, etc.

      But I grew up playing classic tile based games (Civ II, Heroes of Might and Magic, etc), so I have a fairly critical eye for it.

gus_massa 2 months ago

It's quite slow in my machine.

How do I see the stats of a city?

When I use the "mine" tool, what happens? The nearest dwarf attempts to so the task?

  • kuleshOP a month ago

    I need to keep optimising it. I agree.

    > How do I see the stats of a city? Click the city tile.

    > When I use the "mine" tool, what happens? The nearest dwarf attempts to so the task? Dwarf live in mines, this is city extension tool basically.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection