All writing
Engineering4 min read

Introducing Oakhollow: A Village Where Every Villager Thinks

Oakhollow is a free, open-source village simulation for the browser. An AI decides what every villager does: work, trade, marry, vote, invent and die.

ZZ
Zinadin Zidan
50 reads

Villagers in most games run on a script. The blacksmith hammers from nine to five, the innkeeper has three lines, and nothing they do surprises you twice. I wanted to watch a village where nobody follows a script, and see what the people in it would do.

So I built Oakhollow: a free, open-source village simulation that runs in your browser. An AI model makes every choice each villager makes, from what to eat to whom to marry. You watch, read what happened, and now and then whisper in someone's ear.

Watch the 4½-minute tour of Oakhollow on YouTube.

What you can do with it today

  • Watch a village live its own life. Villagers work, trade, open businesses, court, marry, have children, fall sick, steal, vote and die. None of it is scripted.

  • Follow one person. Click anyone to see their needs, skills, belongings and memories, and the reasons behind each friendship or grudge ("shared a drink with me +5").

  • Read the story as it happens. The Chronicle lists every birth, crime, promise and new idea, with filters to narrow it down.

  • Speak as a voice in their head. Whisper to a villager. They decide what the voice is, whether to answer, and whether to do what it asks. When they're stuck, they pray to you.

  • Change the world. Announce a fire or bandits, write a law, bring in a newcomer or hand a house to someone, and see how people react.

  • Leave it running. The village saves itself every minute and carries on when you come back. An optional helper, the keeper, answers prayers while you're away.

The villagers decide, not a script

For each decision, the game lists everything a person can do right now, usually 50 to 120 options. An AI decision model, Jev from TypeSafe AI, picks one from what that person knows: their mood, money, memories, plans, and what they think of the people around them. A small text model then writes what they say.

The choice is drawn from the model's odds, not taken from the top answer, so the same situation can go different ways. About once a game day, people also invent new things to do. The game checks each idea against its rules before anyone can use it, so nothing comes from nothing.

The world underneath is ordinary code that follows real models where it can. Sickness spreads the way epidemics do, a water mill makes as much power as the river's flow allows, and prices rise when goods run short. When villagers want to know something, they walk to the Library and look it up on Wikipedia.

If you've played RimWorld or The Sims

Some of this will feel familiar: a storyteller that sends wolves and storms when things go quiet, opinions with reasons that fade over time, and separate settings for each person's gender, pronouns and who they're drawn to. The difference is that you don't control anyone. You can only watch, nudge and whisper. The tutorial walks through the controls in about 10 minutes.

What it isn't, yet

Oakhollow is about a month old, and I'd rather say so up front:

  • There's no installer yet. You run it from the source code with Node.js 22 or newer and one command. There's no hosted version to open in a browser.

  • The best part needs an API key. Without one, a simple built-in brain keeps the village alive, but it isn't very interesting to watch. With a key, decisions cost about $0.06 per game day and speech about $0.01, measured with 6 to 8 villagers.

  • Days are slow. At normal speed a game day takes 12 real minutes. You can speed it up to 8×.

  • People still do odd things. Villagers sometimes get stuck or make strange choices. Each one I find becomes a fix and a test.

Under the hood

For the developers reading: Oakhollow is plain JavaScript modules with no build step and no runtime dependencies, plus a small Node server that passes requests to the AI models. The code is split into layers (world data, social life, the village, actions, minds, interface) that only import downward. New actions and effects register themselves instead of growing a long switch. Files stay under 200 lines, and lint rules and a pre-commit hook enforce all of it.

The minds borrow from published research: a memory stream and daily plans from Generative Agents, inventions that are written and checked as in Voyager, and lessons from failure after Reflexion. Each villager also has a small neural network that learns when an action tends to pay off. The tests replay two game days on fixed seeds and compare the result, so a refactor can't change behaviour by accident. How the minds work has the details.

Thank you

Oakhollow stands on other people's work. The ideas behind its minds come from the researchers who published Generative Agents, Voyager, Project Sid and Reflexion, and what the villagers read comes from Wikipedia's editors. Thank you.

Try it

  1. Get the code from Oakhollow on GitHub and run npm start. The README has the three lines you need.

  2. Open localhost:3000/?offline to try it without a key, or follow the tutorial.

  3. Tell me what your villagers did, or what broke, by opening an issue on GitHub.

And if you like where it's going, a star on GitHub helps more people find it.


RimWorld and The Sims are trademarks of their respective owners. Oakhollow is independent and not affiliated with them.

#open-source#oakhollow#simulation#ai-agents#javascript#browser-game

Keep reading

All writing →