Skip to content

Latest commit

ย 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘‘ Tiny Throne

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.

Tiny Throne โ€” Baroness Aria Moonwhisper petitions the ruler

How to play (10 seconds to learn)

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.

๐Ÿง  Where the AI is

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

๐Ÿš€ Run it

# 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 --release

No Ollama? The game still works with hand-written template petitioners.

flutter test                  # 13 tests: balance invariants, parser, freeze regression, full runs

๐Ÿ—บ๏ธ Roadmap

  • 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

Sibling projects

  • ๐Ÿฎ hollow_market โ€” ghost-shop puzzle game, same local-LLM director pattern
  • ๐Ÿค– offline-llm-chat โ€” LLM chat + arcade game running 100% in the browser

๐Ÿ“„ License

MIT


#flutter #dart #local-llm #ollama #llama #offline-ai #game #reigns #ai-game #procedural-generation #roguelike

About

๐Ÿ‘‘ One petitioner, two buttons โ€” a Reigns-style kingdom game where every character is written live by a local LLM (Flutter + Ollama, fully offline)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages