DigitalLife
PublicPlay god over a village of AI humans. Nothing is scripted. Not even their faith in you.
| Name | Size |
|---|---|
| public , directory | |
| src , directory | |
| .gitignore | 59 B |
| index.html | 15.0 KB |
| LICENSE | 1.0 KB |
| package-lock.json | 36.7 KB |
| package.json | 491 B |
| README.md | 8.8 KB |
| sim-test.ts | 15.0 KB |
| start-game.bat | 691 B |
| tsconfig.json | 475 B |
| vite.config.ts | 678 B |
DigitalLife
A civilization god-sim where every human is an AI. They work, fall in love, have kids, grow old, and die. None of them are told what to believe about you, the voice from the sky. Faith shows up on its own or it doesn't.
The humans think on a local model through Ollama, so after setup it costs nothing and nothing leaves the machine.
Quick start
- Open the Ollama app.
- Double-click
start-game.bat, or runnpm run devin a terminal.
The game opens at http://localhost:5173. The humans need a brain, a one-time 4.7 GB download:
ollama pull qwen2.5:7b
There is no backend and no CORS setup. The browser talks to Ollama through a Vite proxy.
How to play
Left-click a villager to select them. The right panel shows needs, faith, job, family, beliefs, and memories.
The chat box has four modes:
- Speak to selected. A private word in one mind.
- Broadcast to ALL. Your voice rolls over the valley and everyone reacts in turn, each by their own personality.
- As prophet. Speak through a devout villager (faith 55 or more). Their mouth, your words.
- Send dream. Whisper into a sleeper's dream. They wake with an omen and probably tell someone about it.
You can also give commands. "Go to Mira." "Walk to the river." "Gather food." "Sleep." "Stop." Whether they obey depends on their faith and their skepticism. A believer walks. A skeptic asks you to prove yourself, which I find is the fun part.
The toolbar in the top left holds the powers:
- Give Food, Smite, Bless. The classics.
- Rain, Storm, Sun. Instant weather. Rain makes crops grow about 1.6x faster.
- Resurrect. Click a grave. Whoever saw it either believes hard or has a small crisis about it.
- Plague and Famine. Sicken an area or blight it for two days.
- Raise, Dig, Plant, Clear. Reshape the land. Pathfinding updates on the spot.
- Chicken, Sheep, Fish. Chickens lay eggs a keeper collects. Fish jump and look nice.
Their life
Villagers pick a career when they come of age: woodcutter, miner, fisher, farmer, builder, chicken keeper, teacher, healer, priest, cook. The choice goes through the LLM with their personality and the village's needs. They work about six sessions a day and then go live their life, because they are people, not machines.
Love starts in conversations. Attraction builds, couples form, and one of them pops the question through the LLM. A yes means a builder raises their hut, and eventually there is a baby with blended traits and a belief or two taught by the parents. Kids grow up in about two days. Elders die peacefully around day fifteen, and the village gathers at the grave for a funeral with a spoken eulogy.
Their minds
Every villager carries a mood, a stress level, and permanent grit called resilience. Hardship hurts, and coping with hardship makes the next one easier to bear. Sheltered minds break faster. Survivors get tougher.
What they WANT matters now. A villager's dream ("I want to heal people", "I crave Mira's company", "I want to hear the Voice again") steers where they walk, who they seek out, and how their days feel. Ignored wants grind on them. The dream is born at coming of age and changes in nightly reflection, and you can read it in their profile.
Trauma is real. Violence witnessed, family lost, betrayal, starvation, your own smites: all of it lands on the mind. Rarely, a wound crystallizes into a disorder:
- Depression. They stop working, barely eat, wander alone. Friends sitting with them helps more than you'd think.
- Violent breaks. A stressed mind with a grudge snaps. The village never forgets.
- Paranoia. Trusts no one, refuses help, reads malice into kindness.
- Hearing voices. They cannot tell YOUR voice from illness, and asking "do you hear it too?" does not go over well. Sometimes it starts a strange little cult.
- Trauma triggers. A death like the one that hurt them makes them panic and flee.
Disorders heal with time, support, a healer's treatment, or your Touch of Peace. A healed survivor comes out harder than before.
The dark side
They lie. Dialogue can be false, and rumors about you ("the Voice is a demon") move faith as surely as truth does. Skeptics resist better.
They steal. The starving or the dishonest take from the stores, and getting caught marks them.
They fight. Grudges and tempers end in brawls: injuries, trauma, relations in pieces, and if a hot temper meets a helpless victim, sometimes a body.
They betray. Unhappy marriages stray. Discovery means divorce, gossip, vendettas.
They burn things. The envious trample crops and, rarely, torch huts.
Murder without witnesses becomes a whodunit: the body is found, suspicion falls on whoever held grudges, and the innocent can hang for it. You know the truth. The village does not. Reveal it through a prophet, or let them blame the wrong one.
Justice is vendetta and exile. The victim's family wants blood and may act on it. The village drives the worst offenders out beyond the camp's edge, alone, marked. Time forgives a behaved exile after five days, and so can you.
Institutions
The world begins as an old village: six huts in a ring, a kitchen, and a full granary, all solid and textured. Everyone gets a bed to sleep in. As the valley needs more, builders raise: a school (children attend mornings, learn twice as fast, and absorb the teacher's beliefs), a hospital (a healer treats wounds and slowly minds), a tavern (evenings of bonding and rumors, and the occasional drunk brawl), and a temple (a priest counsels grief, holds sermons, and interprets your will, sometimes wrongly).
Animals live here from the start: chickens peck around the camp (a keeper collects their eggs), sheep graze the meadows, and fish drift in the water. They amble about, pause to graze, and wander back toward camp when they stray too far.
Your toolkit for minds
- Touch of Peace: calm a troubled mind on click.
- Bless also relieves stress now. Smite traumatizes the witnesses.
- Your words carry stress_delta. Comfort them, threaten them, or make it worse.
- Talking to exiles hits hardest. They are alone out there.
Seasons run three days each, so a year is twelve days. Winter kills the crops and berries get scarce. The village survives on its stores, fish, and eggs, or it doesn't. That part is your problem, and honestly it is what makes being god interesting.
When average faith runs high enough, believers build a shrine. After that, seasons can bring a festival in your name. None of this is scripted. It emerges or it doesn't, and every world plays out differently.
The Chronicle button in the top bar opens the village history book, births and deaths and miracles, plus population and faith graphs over time.
Controls: scroll to zoom, right-drag or WASD to pan. Typing in the chat never moves the map.
If something breaks
- "Ollama is not reachable" means the app isn't running. Open it.
- Black squares on the map: reload the page first. If they stick around, open F12, check the console, and the failing file name will be printed right there.
- Missing model: run
ollama pull qwen2.5:7b. - Old saves migrate to the new format automatically.
- If everyone starved in winter, that is the game. Give food. Or turn up
BERRY_REGEN_WINTERinsrc/config.tsif you want it gentler.
Every knob lives in src/config.ts: day length, needs, seasons, job quotas, love thresholds, crime rates, disorder odds, power ranges, LLM budgets. The comments explain each one. Want a harsher world? Raise DISORDER_BASE_CHANCE. Want peace? Drop FIGHT_START_STRESS.
How the AI works
Routine actions like walking, chopping wood, and eating are cheap utility AI. The LLM wakes up for the moments that matter: talking to you, talking to each other, nightly reflection, coming of age, marriage proposals, funeral eulogies, dreams. Every human keeps an importance-scored memory log, and relevant memories get injected into each prompt. Reflections at night distill the day into beliefs, move their faith, and reshape what they want from life, filtered through how skeptical they are.
There is a headless integration test that runs three in-game days against your live Ollama, no browser needed:
npx esbuild sim-test.ts --bundle --platform=node --format=esm --external:localforage --outfile=sim-test.mjs && node sim-test.mjs
It caught two real bugs during development, one of them a starvation deadlock where a villager would stare at an unreachable berry bush until they died. It earns its keep.
Map tiles
The map uses Kenney's Tiny Town pack (CC0, license file included in public/assets/tiles). Open http://localhost:5173/tilemap-guide.html to see all 132 tiles with their indices. If a tree looks like a hut in-game, change the number in TILE_ASSETS inside src/render/textures.ts and reload. Thirty-second fix.
Roadmap
M4 would be 100 or more villagers, tech eras, and wandering prophets who leave to spread your word to other valleys. Not started.
License
MIT. Tile assets are CC0 by Kenney.