Game Dev · · 8 min read
Tiny World: Letting players in, and watching it overnight
What a player can do in a world that does not need them, and how a world running all night tells you things no test ever will, including why one village had no stone.
A player in a world that does not need one#
The first version of the player could walk about, fight, talk to villagers, take a quest to clear out some wolves, and come back to life at a village. It worked and it felt thin. No bag, no character, nothing much to do except hit things.
So we settled on a direction. A wandering hero in a living world, who can also become the patron of a settlement. It went in as four steps, each one playable and deployed before the next one started.
First, choose your people. An account can have several characters, each of them human, dwarf or goblin, starting at their own home. Your own people are friendly and the others are not, so village guards go for a goblin player and the goblin camps welcome one. Players can only hurt players of another people.
Second, a real bag. Twenty slots plus weapon, armour and ranged gear, each people with their own weapons, and the dwarves get muskets. Beasts and goblins drop loot. If you fall you drop half your bag and a quarter of your gold where you fell, and get up again at home.
Third, skills and work. Humans fell trees and fish, dwarves break rock and prospect the mountains for ore and gold and gems, and goblins raid village stores and rally the camp to follow them. Six skills level with use, alongside heavy blows, dodging, blocking and throwing.
Fourth, the council. Become a friend of a village and you get a say in what it builds next and what it works at. As a hero you can have it raise a palisade, or rename it. A goblin raider with enough standing can send a camp's war band out.
The rule running underneath all of that is that players use the same rules as everybody else. Wood a player sells goes into the stores and gets carried about by villagers like any other wood. The council changes a village's priorities, it does not build anything by magic. The world does not have a special case for the human in it, which is the entire point of building the simulation first.
A live world needs watching.#
Once a world runs all day, it works on my machine stops meaning anything. Things go wrong on day thirty that cannot happen in a test, because a test does not have thirty days in it.
So most of the later work was not features at all, it was watching.
There is a status page reporting the game day, how many things are alive, who is connected and how long a tick takes. There are soak tests, where a script runs a full size world headless for forty to sixty game days in a few minutes and logs every village's population, food, wood and stone, along with every birth and death and its cause. There is a pathing checker that flags anybody turning back and forth, stuck, standing in water or walking on a palisade, with a small map around each one, because people notice a character twitching on the spot faster than almost any other kind of wrongness.
And then there is the spectator that watches for me. A headless browser joins the live world, follows the tour from the first post, and takes a screenshot every minute for an hour, recording the event log, the village panel and anything the browser complains about. That is how I check on a world I am not sitting in front of.

The working rule for the overnight sessions was to commit before and after every change, run the tests, deploy, and watch the next hour. When something broke, the commit before it was one revert away.
How the overnight sessions actually went.#
This is the part I most wanted to write down, because it is the clearest picture of how this project gets made.
I set it running with a list of things I wanted, and the instruction to keep watching and keep fixing. Then I went to bed. Claude Code worked through the night, watching the world, finding the thing that looked wrong, fixing it, running the tests, deploying and watching again.
In the morning I read what had happened and decided what to keep.
That sounds like an abdication and it is not, quite. Every one of the fixes below came from noticing a number that looked wrong and asking why, which is a skill, and it is a skill I was asleep for. But the calls about what the world should be like are still mine, and the clearest proof of that is the one I threw away.
What a night of watching found.#
One village sat at zero stone for days. Its quarry had nobody at it, because every single man in the village was a guard. Guards are capped at a third of the adults now, and traders go out for stone when it runs short. That village finished on thirty two stone, all of it traded from the dwarves.
Two villages with two woodcutters each had almost no wood, which made no sense at all. A woodcutter was being sent to clear a road ninety tiles from home. Anybody more than fifty tiles out gets called back, and road clearing was not on the list of exceptions, so they walked out, turned round at fifty tiles, came home, and set off again, all day, every day. One line of code took that village from fifty or eighty wood to about two hundred and twenty five.
A villager said "morning" at six in the evening, which is small and exactly the sort of thing a person notices.

The log announced that Wat had come of age, twice in two days. That was not a bug, there were simply two boys called Wat, but it reads like one, so newborns now get a name nobody in their village already has.
And a bandit gang was wiped out "by someone", because the elves were missing from the lookup that turns a killer into a name.
Not everything worked. Letting women be guards would have fixed the labour shortage cleanly and it broke eight tests by shifting who ended up doing which job, so I backed it out.
That is the one I keep coming back to. It was a good change, it was correctly implemented, the tests that failed were mostly failing for silly reasons, and I still threw it away, because it was four in the morning in game terms and I was not prepared to take eight unexplained failures into a live world on a hunch. Being able to produce a change in ten minutes makes it much easier to throw away, which is a benefit nobody mentions.
The tests in a tiny world are sensitive to luck, and several times a change somewhere else made an unrelated test fail. The right fix there was usually to make the test calmer, no wolves, daytime, full stores, rather than to undo the change.
Where it is now.#
On day seventy two the island has seven villages, three of them founded by settlers from the first four.
The biggest, Ravenbury, keeps a standing platoon that marches out against bears and wolf packs and comes home again. Two others had platoons until their settlers left and are growing back towards one. There are dwarf holds trading stone for berries, elves in their groves, goblin camps rising and falling, travellers on the roads, a bandit gang or two, and the occasional earthquake or plague to keep everyone honest.
At dusk, somebody walks round and lights the torches one at a time.
It runs on one small server at about five to ten milliseconds a tick, and it will still be running tomorrow whether anybody logs in or not.
That was the point, and it has been four days.
What four days taught me about working this way#
I have written two other build diaries on this blog and neither of them mentions how the code got written, because in both cases it got written the usual way, slowly, by me, in the evenings.
This one is different and I wanted to say so plainly rather than let it sit there unremarked.
Four days, a hundred and one commits, twenty two thousand lines and a world that has been running ever since. I could not have built that in four days. I am not sure I could have built it in four months, and I am certain the version I built alone would have had fewer animals in it and no elves at all, because I would have been rationing my own evenings.
What has not changed is the part that matters. Every judgement in these four posts is mine. The rule that nothing appears out of thin air. Deciding that a village which keeps shrinking should be abandoned rather than propped up. Throwing away a change that would have fixed the labour shortage because eight tests said something I did not understand. Noticing that a villager saying good morning at six in the evening is worth stopping for.
Nobody told me any of those. They came from sitting and watching the thing, which turns out to be the job, and it is a better job than typing was.
Next time, giving these people lives to go with their jobs.
You can watch it yourself at tinyworld.simontasker.co.uk.