Dekiro Dev Blog

Part 24 of 28

A Tavern, Named Hens and Cats: The Small Stuff

88 more townsfolk walk the roads out of every town, a tribe of brewers got a tavern, seven hens got names, and a route checker now makes sure nobody walks through a wall to get to work. None of it changes a single fight, and all of it came out of the first playtest.

I would also like to name the chickens: Stefan, Gerrit, Mars, Daria, Gitti, Mike and Nici.

— the developer

"Everything is happening in the center" #

The living-world post1 "Making a Generated World Feel Lived In" (16): clutter by rules, houses, cats you can pet, and the first townsfolk. ended with 66 townsfolk on routines: Old Marta sweeping the square, two gossips at the well, children chasing a dog. It worked, and the first playtest found its weak spot within minutes:

Non-player-relevant NPCs should be scattered a bit out on the roads to the north, east, west and south. Right now everything is happening in the center.

True. Every town had a lively square and four empty streets leading out of it. You walked out through the gate past nobody, which is the opposite of how a town works: the square is where people meet, but the roads are where they come from.

The Vale's north gate: a guard pair now stands at every gate of every town

Out onto the roads #

One agent took every town, the Vale first, then the other five, and lightly the three gate camps. Some existing people moved out (Joss to the north gate, Brann to fish from the pond bridges, Xiao the courier to a loop through all four gates), and 88 new people moved in:

Town Townsfolk before After
Sanctuary Vale 17 41
Marsh Camp 8 20
Ranger Outpost 8 21
Pilgrim's Rest 8 22
Oasis Town 8 22
Pass Hut 8 19
Forge Camp, Warden's Watch, Last Lantern 3 each 4 to 5

That's 88 in the six towns, plus five at the camps: data/townsfolk.json went from 66 people to 159. Every town now has a guard pair at each gate, and one pair per town has something to say to each other. In Duskmoor:

"How many tonight?" "Twelve strokes. Then one more." "There is no thirteenth hour." "Tell that to whoever's ringing." "...Light the gate lantern. Both wicks."

In the desert, a guard has noticed that the big dune by the cairn was left of the cairn this morning and is right of it now. Nobody goes north today.

Between the gates there are carters with things to carry: Gerd pulls a cart through the Vale, Sun the Porter pushes a wheelbarrow, Dirk hauls peat in the Marsh, Torvald drags a sled of firewood through Frostpeak, and Grom brings ore to the forge camp ("Ore for Kael!"). Carts are a new routine option, a clutter model the person pulls behind or pushes ahead. They were invisible at first: the person walked along the street holding nothing, miming a cart, until a one-line fix.2 In scripts/world/ambient_npc.gd. A townsperson's cart (data/townsfolk.json) is one of cart, wheelbarrow or sled, a clutter model pulled behind or pushed ahead. There are also sweepers, travellers walking in and out, pilgrims and beggars by the gates, farmers working the field edge just outside them, recruits jogging laps, an herbalist shouting the name of a plant ("Feverfew!"), and pairs of children on the ring roads playing tag and freeze ("Freeze!" "Didn't move!").

A carter heading out of the Vale's north gate, past the guard pair

Each one has a name in the game's European and wuxia mix, a few lines when you talk to them, barks when you pass, and a look in their region's palette.3 From data/npc_looks.json: a seeded archetype plus a regional palette, so the same person looks the same on every machine. The HD-2D post (12) has the sprite side. Townsfolk animate only near the camera, so 88 more of them cost very little.

A checker that walks the routes #

A routine is a loop of stops, and a person walks in a straight line from one stop to the next. Townsfolk have no collision: they're presentation, and nothing may depend on where they stand. That makes them cheap, and it means nothing in the game stops a baker from walking through the bakery's back wall to reach the square.

tools/mapgen/town_life.py already checked that every stop stood somewhere sensible: not inside a building, a prop, clutter or water, and inside the town's sanctuary. For the roads it got stricter. It now also walks every leg of every routine in 0.75 m steps and complains if the line passes through a building, a wall, clutter with a collider, or water off a bridge, and it checks that each stop lasts long enough to cover the walk there at the person's speed:

  ! carter_gerd 3->4 walks through house at (41.2, -18.5)
  ! sweeper_bao stop 2: 12 s is too short for the 19 s walk there

Two typical complaints, made up for this post.4 The real output, python tools/mapgen/town_life.py, is one line per map, and now every one of them says "0 problems".

The first run of the stricter checker over the existing routines, before any new person was added, found about 120 problems. People had been walking through walls for over a week, and nobody noticed, because on screen a person passing through a house corner for half a second looks like a person walking past it. All of them are fixed now. The generators route walks around buildings themselves through extra "walk" stops, a stop can say how long to stay instead of how long it takes in total (the walk is worked out), and the dresser keeps clutter off people's walking lines.

Two limits remain, and the agent wrote them down rather than working around them. People can't stand further out than the sanctuary's edge, so "just outside the gate" means at most about 6 m outside. And routines can't depend on the time of day yet, which matters for exactly one person, introduced below.

The Bierlinger Tribe #

The next request came in the same playtest, between a bug report and the chickens:

I would also love to have a "bar" style of house that contains NPCs of the "Bierlinger Tribe", who have the names Stefan, Sebastian, Alexander, George, Bernhard and Dominik (plus a title that fits the theme).

Buildings in Dekiro have no interiors, so a bar has to be a place where the party happens outside. The tavern is a new building type from the Blender pipeline: a two-storey izakaya with red lanterns along the eaves, a long noren curtain, stacked straw-wrapped kegs, a cedar ball over the door, a balcony and a tall sign. It replaced the first house down the Vale's east street. The beer garden in front uses two new clutter pieces, a long table with benches and a keg rack, plus banner poles and barrels. Like every building, it comes in regional variants (desert, snow, swamp, ember), for whenever another town gets thirsty.

The Bierlinger tavern on the Vale's east street, with the tribe in the beer garden

The tribe got the titles, all six distinct and all short enough for a name tag:

Name Title
Stefan Bierlinger Brewmaster
Sebastian Bierlinger Hop-Sage
Alexander Bierlinger Toastmaster
George Bierlinger Barrel-Keeper
Bernhard Keeper of the Tap
Dominik Last to Leave

They share an amber trim in their outfits, and the writing stays in the game's voice: no real-world brands, and the lore leaks in. Stefan claims the tribe brewed in the Vale "since before the walls. We were here first. The walls came for the beer." Sebastian grows his hops "on the north side of the wall, where the shard's song is faint. They come up bitter and proud." George counts kegs: "Twelve. Should be thirteen. Somebody's been brave in the night." They have two timed conversations. Stefan and Sebastian argue about hops:

"It needs more hops, Stefan." "It needs fewer opinions." "A brew without bite is just wet bread." "And yours is a bite without bread. Drink." "...It is good, though." "Of course it is. I made it."

and Alexander toasts, with Bernhard keeping count:

"To the Sanctuary Stone, that keeps the night outside!" "That's your third toast to the stone." "It's a very good stone." "Then let it drink water. Here." "To water! ...No. To the tribe!"

At level 15 Stefan offers your character a cup "on the tribe, for the hero". Nobody actually gives you a drink. It's a tavern without an inside.

Dominik is the time-of-day problem. The brief said one of them should stumble home along a street at night. Routines can't depend on the clock's hour yet, so Dominik walks home on a loop, at 0.8 times normal speed, day and night, and comes back for one more. His lines cover it: "Home is up the street. The street is longer at night. I've measured."

The same tavern at night: lanterns lit, the tribe still at it

Seven hens with names #

The same message asked for the names at the top of this post: Stefan, Gerrit, Mars, Daria, Gitti, Mike and Nici, for the chickens.

Dekiro's animals are presentation like townsfolk: built from map data on every machine, run from the wall clock, no network traffic. Named animals get a name tag; the Vale already had Mochi the cat, Lady Plum, Old Bao and Tofu. So this was a list in the Vale's generator:

# The named hens (the user's): two in the town's yard behind the tea house, five at the farmstead nearest the town.
HEN_NAMES = ["Stefan", "Gerrit", "Mars", "Daria", "Gitti", "Mike", "Nici"]

Stefan and Gerrit live in a yard behind the tea house, among the market stalls. Mars, Daria, Gitti, Mike and Nici live at the farmstead nearest the town, out in the Whispering Fields.

Gerrit and Stefan in the town yard

Yes, there is now a Stefan the hen and a Stefan the Brewmaster. The name check that keeps people's names unique covers NPCs, townsfolk and companions, not animals, and the brief said the overlap was intended. The brewer knows. One of his barks:

"Someone named a hen after me. I'm honoured. I think."

Mars, Daria, Mike, Gitti and Nici at the farmstead

Petting, briefly #

The living-world post covered petting: press F next to a cat or a dog, your character kneels, a heart pops up, and you get Content, 2% movement speed for five minutes, once per animal per world day. It's the one piece of animal life the server checks, loosely, against where the animal's schedule says it should be.

Hens are not on that list, named or not. In data/animals.json, cats and dogs belong to a pettable group and hens have a scatter rule instead: run through them and they bolt 2.4 m at 3.4 m/s for about a second, with a sound, then go back to pecking. So you can visit Gitti, but you can't pet her. That's not an oversight: it's what hens do.

Still no network traffic #

All of it, 88 people, carts, two conversations at the tavern, seven hens, is computed on every machine from map data, the clock and a seeded hash. A friend joining your game sees Dominik at the same point of his walk home and Gerrit by the same stall, without a packet. The one thing that had to be fixed for that:5 "Multiplayer Bugs Only a Friend Can Find" has the story: WorldClock.server_skew, sent in the server's welcome message. a friend's PC clock that's a few minutes off would put Dominik somewhere else, so clients now take the server's clock when they join.

Takeaways #

  • Life belongs on the roads, not just the square. People coming and going between the gates make a town read as part of a world; a busy centre with empty streets reads as a stage.
  • Check the walks, not just the stops. The stop checker was clean; the walk checker found about 120 people passing through walls. Presentation without collision needs a tool that pretends it has some.
  • Write the limits down. "Can't stand more than 6 m outside the gate" and "can't depend on the hour" are now known, and Dominik's lines make the second one a joke instead of a bug.
  • The cheapest features carry the most personality. A list of seven names and one bark ("I'm honoured. I think.") cost minutes and give a town more character than a new building.

What's next #

The same playtest produced three dozen other notes, from potion numbers to a chat. The playtest post goes through every one of them and what it became.