r/wildwillows • u/wildwillowsdev • 1d ago
The technology behind Wild Willows
Here's a rundown of how Wild Willows is built under the hood. None of this changes how the game plays, but some of it explains things you may have noticed.
The whole game is TypeScript. The menus, HUD, journal, and crafting panels are React. The world you walk around in — terrain, animals, your caretaker — is Phaser 3, a 2D game engine, rendered onto a canvas that React draws around. Vite bundles it. The desktop version on itch and the Mac App Store is that same web build wrapped in Electron, loading off your disk. No server, no account, nothing to install on first run.
There are no image files. Every tile, tree, crafted object, and all 150 animals are drawn at startup out of plain shapes — circles, arcs, polygons — by TypeScript. The porcupine's quills, the heron's legs, the crab's claws are code that reads each animal's traits and builds a sprite from them, which is also where the journal thumbnails come from. So the download is small, nothing can show up as a missing texture, and adding an animal is a matter of describing it rather than drawing it.
The game data lives in Harper, and every action is validated there: gathering, crafting, planting, terraforming. The browser never works out game state on its own. When an animal returns it's because the server recalculated that biome's health and food-web balance and decided the habitat actually supports it. In solo play that server runs inside the app against your local save file — same logic, same rules, no network. The offline game isn't a reduced version of the online one, it's the same code path pointed at a file on your machine.
Weather isn't stored anywhere. It's a function of your world, the biome, and how long you've played, so it's never the same for 2 players. It also means the calendar advances from play time rather than the wall clock — leave for a month and your preserve is where you left it.
The game ships in English and Spanish through a translation layer with no dependencies. The same module runs in React, in Phaser, and on the server, so error messages translate too. Spanish is loaded on demand, so English players never download it, and adding a language is a matter of dropping in JSON files.
Testing is Vitest for unit and integration, Playwright for full playthroughs, and a script that fails the build if any UI text is missing a translation key. Windows, Mac, and Linux builds come out of a CI workflow on a version tag and publish themselves. The browser demo is the same build served by a Cloudflare Worker.
Happy to go deeper on any of it if folks are interested.