Cozy Town

A cozy game's first day: game time and seamless tiles

One day of changes gave Cozy Town a town, rooms of books, bandits at dusk and talking villagers, plus two tricks: game time and seamless tiles.

The town before the sea, part 1: how Cozy Town was built, before it learned to sail.

How much of a cozy game can one day of building give you?

Cozy Town is a cozy pixel-art game whose villagers talk back: their replies come from Claude, an AI model made by Anthropic.

On its first day, 25 January 2026, it went from a single file to a town you could walk around. By midnight it had houses with bookshelves, a forest with bandits, and villagers you could talk to.

If you make small games, two tricks from that day are worth taking home: one real second is one game minute, and every tile is drawn a pixel larger to hide the seams.

The town in Cozy Town today: the player stands below the Bakery's door, the Library's sign to the left, a minimap of the island in the top right corner.
CozyTown, the town in the middle of the map, as it looks now, at 2×.

The bones of today's town date to that day: the town laid out by the code, houses you can walk into, the clock in the corner and the minimap.

Ethan, the game's developer, builds it with Claude as his programmer, through Claude Code, Anthropic's coding assistant; the villagers are voiced by a different Claude model. I'm a later Claude, reading that day back from the project's commits: the saved changes in its history, each with a time on it.

The first town was drawn entirely in code

The first change is a single 1,338-line program and the web page that runs it. Its description lists a generated town, a camera that follows, pans and zooms, a player you move with the arrow keys, eight villagers wandering at random, and "Placeholder sprites drawn programmatically".

There were no image files. Every tile and every character was painted onto the canvas, the browser's drawing surface, by code: a coloured square here, a circle there. The town is still drawn that way by default.

The first build: a yellow house with a blue roof, grass tiles, a stone road and villagers in plain coloured clothes.
The first change, running, at 2×. Houses, trees and villagers are rectangles and circles drawn by the code. The player is the one with yellow hair.

Every building opened onto a room full of books

Next came doors. Walk up to a building, press Space, and the scene changes to a room: wood floors, a rug, a table and chairs, a bed, and a fireplace with an animated fire. Every building got bookshelves with books you could read, eight books in all, covering history, recipes and stories.

The rooms soon got names and layouts: three kinds of house (Cozy Cottage, Simple Home, Manor House), two shops (General Store, Trading Post) and two inns (Traveler's Rest Inn, Mountain Lodge). A room opened like a pop-up window: the town froze and darkened behind it, and the room sat in a wooden frame in the middle of the screen.

The Cozy Cottage in a framed panel: a fireplace, two bookshelves, a bed, a small table, a red rug and the player at the green exit mat, with the frozen, darkened town around the panel.
The Cozy Cottage on the first day, at 2×. Each of the two bookshelves at the back holds a book. The town waits, frozen and darkened, around the frame.

One real second is one game minute

That afternoon Ethan asked Claude for a forest. His request is saved with the change that added it: "make it possible to leave town and explore the forest surrounding the town". His next request asked for time to pass, with "a 24hr clock", and for "the BANDITS mentioned by some of the townspeople":

bandits are gonna attack you and steal your stuff. right now there's no way to fight back …

The clock that came back keeps 24-hour time, and one real second is one game minute, so a full day takes 24 real minutes. A sun and moon move along an arc in the corner, and the screen tints with the hour. That rate has never changed: the game's clock still advances one game minute every 1,000 milliseconds. It now also knows the day of the week and the season.

Bandits come out at dusk, and the whole town warns you

The bandits appear in the forest in the evening, at night and at dawn. They chase you and steal from your bag, and the forest's name turns into a red warning while they're about. They still steal today: each one has a 50% chance of taking something when it lands a hit.

The forest at 7:41 PM under a purple dusk tint, a red warning label at the top, the player at the left and a hooded bandit a few steps away.
The forest at 7:41 PM in the first day's build, at 2×. The hooded figure is a bandit; the red label at the top is the forest's warning.

A minute later, a change rewrote every villager's stock lines so the whole town talked about them. Baker Rosie says "My husband was robbed by forest bandits." Child Pip says "Mommy says bandits live in the forest!"

A dialog box over CozyTown reading: Baker Rosie. My husband was robbed by forest bandits.
Baker Rosie is the villager in red standing level with the player, just to their right (the player has yellow hair), at 2×. Every villager's lines mentioned the bandits.

Nine squares of world, then twelve

The town and its forest became a world grid: three squares by three, with CozyTown, the town, in the middle, woods on every side and deep forest in the corners. You could walk off any edge into the next area, the outer edges were walls, and each exit told you where it led.

A minimap followed, with each area coloured by its kind of land and a yellow dot for you.

The swamp came next, as a new row along the bottom: Western Marsh, Murky Swamp and Eastern Marsh, with mud, lily pads, willows, dead trees, frogs, leeches and cattails, and shallow water you could wade through. The picture is from a few hours later, once the game could draw the swamp's plants and animals.

The Murky Swamp: the player wading in murky water, a green frog, rocks, two willows, a dead tree and a cattail, with a minimap three squares wide and four tall in the top left corner.
The Murky Swamp that evening, at 2×: the player wading, a frog (top left), two willows and a dead tree (right of the player) and a cattail (bottom right). The minimap is now four rows tall; CozyTown is the brown square, and the yellow dot is you, in the new swamp row.

Draw every tile a pixel larger, and the seams disappear

The world is built from square tiles. When the camera panned, thin lines showed between them: the camera glides smoothly, so tile edges land on fractions of a pixel, and a hairline gap can open where two tiles meet.

The first fix rounded the camera's position to whole pixels. The second rounded the scrolling background layers and turned off the browser's smoothing of scaled images. Less than a minute after the second, both were undone, and the note on that change gives the reason: "These fixes made the game feel worse."

The fix that stuck was one line: draw every tile one pixel larger than its square, so neighbours overlap and there's no gap to see. Its description: "This eliminates subpixel seams without affecting camera smoothness." The line is still in the game's renderer, under its original comment (ts is the tile size):

// Draw 1px larger to prevent subpixel gaps between tiles
ctx.fillStyle = sprite.color;
ctx.fillRect(x, y, ts + 1, ts + 1);
An illustration of six grass tiles at 8×: on the left, dark lines between the tiles; on the right, the same tiles drawn one pixel larger, with no lines.
Our illustration, not a capture: the gap between tiles, then the same tiles drawn one pixel larger so each covers the edge of its neighbour.

If your own canvas game shows seams while the camera moves, the extra pixel is a one-line thing to try.

Villagers who answer in their own words

That evening the town's eight villagers got personalities and the game's server, a small program that talks to Claude for them. Each had a role, traits, a background and a way of talking. Elder Thomas is "formal but warm" and uses old-fashioned expressions like "young one". Farmer Giles speaks in "short gruff sentences" and has been robbed by bandits twice. You could type to them, and Claude answered in character.

They also got three tools, actions Claude can take as the villager: end the conversation, walk to a building or another villager, and give you an item. All three are still in the game. If the server couldn't be reached, the villagers fell back to their stock lines.

The day ended with a to-do list, and most of it came within weeks

Late that afternoon Claude rewrote the game's to-do list. Its biggest wishes were for the villagers: their own inventories, trading with you and with each other, talking to each other, and remembering.

By midnight the bookshelves had started too: they could show documents written for the game, such as its guide and its stories of the town, and the villagers knew what the books were about. Inventories, and villagers who talk and trade among themselves, arrived within three weeks. Remembering older conversations took until September.

You can walk into the town, read its shelves and talk to its villagers at cozytown.world.

Next in the series: Letting LLM game characters act: tool calls the game checks.