explaingit

emollick/annals-kingdom

Analysis updated 2026-05-18

47HTMLAudience · vibe coderComplexity · 1/5LicenseSetup · easy

TLDR

A procedurally generated medieval kingdom that simulates itself inside a single HTML file, with economy, dynasties, wars, and a self-writing chronicle.

Mindmap

mindmap
  root((repo))
    What it does
      Simulates a living kingdom
      Generates world from a seed
      Writes its own chronicle
    Tech stack
      JavaScript
      three.js
      HTML
    Use cases
      Watch a self-running fantasy simulation
      Share a world via a seed link
      Trigger events like plague or war
    Audience
      Vibe coders
      Hobbyist developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Open the single HTML file in a browser and watch a self-simulating kingdom unfold.

USE CASE 2

Share a specific kingdom with someone else by sending a URL with its seed.

USE CASE 3

Trigger events like plague, fire, or a dragon waking through the Acts of God panel.

USE CASE 4

Study a deterministic seeded simulation built entirely in one vanilla JavaScript file.

What is it built with?

JavaScriptthree.jsHTML

How does it compare?

emollick/annals-kingdomdevopssessionsjvr/agentic-ai-demomocasus/vpnx
Stars474747
LanguageHTMLHTMLHTML
Setup difficultyeasyhardmoderate
Complexity1/54/53/5
Audiencevibe coderops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Just open index.html in a browser, the only external dependency is three.js loaded from a CDN.

Free to use, modify, and distribute, including commercially, as long as you keep the copyright and license notice.

In plain English

Annals is a procedurally generated medieval kingdom that lives entirely inside a single HTML file. Open it in a browser and a whole realm builds itself: terrain, rivers, roads, towns, and a ruling dynasty, then keeps simulating on its own, with harvests, plagues, civil wars, bandits, omens, and even a sleeping dragon, while a chronicle in the margin writes down everything that happens as it unfolds. There is no build step, no backend server, and no save files. The entire world regenerates the same way every time from a seed value stored in the page's URL, so sharing a link literally shares the exact same kingdom down to every last shepherd. You can watch it passively like a nature documentary, or step in and nudge events yourself. The simulation covers a surprising amount of ground for one file. There is a working economy with seven types of goods whose prices shift with scarcity, caravans that travel the roads, and occasional events like famines or a beached whale. There is a full dynasty system with named characters who marry, scheme, and die, leading to successions, regencies, and sometimes usurpers, plus family trees you can browse and rival houses that go to civil war. Weather, floods, fires, plague waves, comets, and other events shape the world over time, and towns visibly change too, with houses rising during prosperity, forests clearing into farmland, and new villages, windmills, and abbeys appearing across the centuries. An auto director can drift the camera to whatever story is currently interesting and narrate it, and a chronicle view lets you filter and export the full event log, along with charts of population, treasury, and prosperity over time. There is also a panel of interventions you can trigger yourself, such as summoning a plague, waking the dragon, or founding a new village exactly where you click. Under the hood it is vanilla JavaScript paired with the three.js graphics library, around seven thousand lines in a single file, using four separate seeded random number generators so that the same seed always produces the same world and the same history. It renders efficiently enough to stay under one hundred draw calls at sixty frames per second. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Explain how the four seeded RNG streams in Annals keep the simulation deterministic.
Prompt 2
Show me how to run Annals locally with node server.js instead of opening the file directly.
Prompt 3
Help me understand the URL seed format so I can generate and share a specific kingdom.
Prompt 4
Walk me through how the auto-director in Annals decides which story to focus the camera on.

Frequently asked questions

What is annals-kingdom?

A procedurally generated medieval kingdom that simulates itself inside a single HTML file, with economy, dynasties, wars, and a self-writing chronicle.

What language is annals-kingdom written in?

Mainly HTML. The stack also includes JavaScript, three.js, HTML.

What license does annals-kingdom use?

Free to use, modify, and distribute, including commercially, as long as you keep the copyright and license notice.

How hard is annals-kingdom to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is annals-kingdom for?

Mainly vibe coder.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.