The easiest AI game ever: one petitioner, two buttons. A Reigns-style kingdom game where every character who walks into your throne room is invented, live, by a local LLM running on your own machine. Flutter + Ollama โ no cloud, no API keys, fully offline.
A petitioner appears and asks for something. You press:
- ๐ Approve โ grant their wish
- ๐ Refuse โ send them away
That's it. Every choice pushes your four kingdom bars up or down:
| Bar | Dies when empty | Dies when full | |
|---|---|---|---|
| ๐ฐ | Gold | Unpaid servants carry the throne away โ with you on it | The nobles decide the crown looks better on them |
| ๐ | People | The people revolt and escort you to the border | Declared a living saint โ sainthood requires martyrdom |
| โ๏ธ | Army | A neighboring king simply walks in | The generals thank you for the swords. Coup. |
| ๐ฎ | Magic | Something old creeps out of the forest | The wizards turn the palace into a very pretty frog |
A bar that empties or overflows ends your reign โ so "always say yes" and "always say no" both get you killed. Each card shows which bars each choice touches (๐ ๐ฐ๐ฎ / ๐ ๐), but not by how much. Survive as many days as you can.
Every petitioner โ their name, title, and plea โ is written seconds before they enter by llama3.2 running locally through Ollama. In the screenshot above, "Baroness Aria Moonwhisper" and her "Luminous Requiem" ritual were invented by the model on the spot.
The architecture keeps the model out of the rules entirely:
Dart rolls one of 12 balanced petition archetypes โ effects are code-owned, always fair
โ
Local LLM writes the character around it โ name + one vivid in-character plea
โ
Lenient parse โ reject schema-parroting โ hand-written fallback (marked ๐)
โ
Next petitioners generate WHILE you decide โ "footsteps echo in the hallโฆ" if you outpace it
Built following two highly-starred community skills:
- game-design-fundamentals โ every choice is a real trade-off; a unit test enforces that no archetype has a dominant option
- llm-npc-dialogue โ consistency over variety, hide latency, fall back gracefully, never block on the model
# 1. Local LLM (free)
ollama pull llama3.2
# 2. The game
git clone https://github.com/oyekamal/tiny_throne.git
cd tiny_throne
flutter run -d linux # or: flutter build linux --releaseNo Ollama? The game still works with hand-written template petitioners.
flutter test # 13 tests: balance invariants, parser, freeze regression, full runs- LLM-written verdict reactions ("the Baroness storms out, muttering hexes")
- Chained storylines (petitioners who return angry after a refusal)
- Reign modifiers (plague year, war year) that reweight archetypes
- Android/iOS via flutter_gemma โ swap one class, fully on-device
- ๐ฎ hollow_market โ ghost-shop puzzle game, same local-LLM director pattern
- ๐ค offline-llm-chat โ LLM chat + arcade game running 100% in the browser
MIT
#flutter #dart #local-llm #ollama #llama #offline-ai #game #reigns #ai-game #procedural-generation #roguelike
