DEV Community

Cover image for How to use Timberborn 🦫 (yes, the beaver city-building game) as a database 💾

How to use Timberborn 🦫 (yes, the beaver city-building game) as a database 💾

Pascal Thormeier on March 28, 2026

So, one of my favourite games lately, Timberborn, has released its 1.0 version and finally left early access. For those who don't know it, Timberb...
Collapse
 
grahamthedev profile image
GrahamTheDev

I finally understand what data lakes are!

Can I branch this DB?

How good is the logging? I assume I can just run a command line tail?

How many bytes does it take?

You knaw what, I will see my self out.

Collapse
 
thormeier profile image
Pascal Thormeier

I was on the bus when I read this, people tend to look puzzled when you burst out laughing on public transport :D If you have any more of these, go ahead, comment sections under my posts are usually pun-friendly ;)

Collapse
 
grahamthedev profile image
GrahamTheDev

Haha, good to know bud! (Also loved it, haven't played Timberborn in over a year so a nice reminder to pick it up again!)

The rest I cam up with were weaker to be fair.

Can I deploy this with terraform etc.

I think I did dam well the first time to be fair :-P

Thread Thread
 
thormeier profile image
Pascal Thormeier

Aah, I love the terraform one, though! :D

Collapse
 
moopet profile image
Ben Sinclair

I'm too long in the tooth to understand any of it.

Collapse
 
itskondrat profile image
Mykola Kondratiuk

Using a game state as a queryable data store is a legitimately clever angle - game saves are already structured state that changes over time, which is basically what a database is. The beaver colony resource model probably has cleaner relational semantics than some production databases I have worked with.

Collapse
 
thormeier profile image
Pascal Thormeier

It's a lot of overhead, though, and as mentioned, I ran into two bluescreens before I got it working. I'm pretty sure one could use the water physics of the game to store more data and make this halfway usable, but the engineering involved would be way over the top.

Collapse
 
itskondrat profile image
Mykola Kondratiuk

two BSODs is the real commit cost. that water physics angle sounds like a great post even if it never ships - the gap between feasible and sensible is where the best dev stories live.

Thread Thread
 
thormeier profile image
Pascal Thormeier

I have the suspicion that the BSODs were actually caused by the amount of end points the game had to create once I clicked on the "Turn on API" button. The game does offer memory units that store single bits and can operate in various modes, so theoretically one could use a single HTTP lever as the input bit, a counter made up of a handful of those memory units and a few logic gates (I implemented a binary counter as a starting exercise, which was surprisingly easy) and a few hundred more memory units as the actual memory to have it act like a bit stack that could be addressed. It's a bit over-simplified, but RAM doesn't work all that differently, actually. It would complicate both reading and writing a lot, but I'm pretty sure it would be less memory intensive and scale a lot better. Downside is that the writing requests from the browser then need to be well-ordered, whereas now they can all be fired simultaneously and the addressing is done via the HTTP lever's names. Alternatively, one could use something like 21 input bits plus a few more for the address, allowing to store individual characters in memory "cells", so the HTTP requests can be fired in packets, improving performance.

Just thinking aloud here, but in theory, once that's implemented, we're not far off to just building a CPU. Add a ROM storage plus a rudimentary 2-colour-display and you've got a full-blown programmable computer. All the parts are there, it's only if the game crashes before the first frame renders or not lol

Thread Thread
 
itskondrat profile image
Mykola Kondratiuk

that tracks - spinning up hundreds of endpoints at once is the kind of burst the kernel isn't designed for

Collapse
 
andrewrozumny profile image
Andrew Rozumny

This is one of those ideas that sounds completely wrong but somehow makes perfect sense

Turning HTTP levers into bits is actually kind of elegant in a chaotic way

Also 1000 requests just to store a string is peak “it works, don’t touch it” engineering

Collapse
 
thormeier profile image
Pascal Thormeier

The 1000 HTTP levers were, to me, actually the path of least resistance. I could imagine a setup where only a handful of input bits are necessary to have a fully operational multi-kilobit memory, but the downside would be that the sent packets would need to be well-ordered (i.e. one byte or whatever after the other, depending on packet size), because otherwise data gets mangled. That would, in turn, have a performance impact and one would need to implement addressing with in-game logic, which is a whole different can of worms. The HTTP lever's names took away the need for addressing, since the bits are always sortable, no matter the order in which they're written or read.

I love the chaotic "mad scientist" part of engineering, where creativity and sheer stubbornness are the key to innovation, even if the innovation only makes people laugh!

Collapse
 
thisisryanswift profile image
Ryan Swift

This is so sick. I love Timberborn, but haven't gotten to play around with 1.0 yet. This post single handedly is gonna move it up my to play list.

Collapse
 
thormeier profile image
Pascal Thormeier

Thank you so much! Can only recommend it, I sunk dozens of hours into this gem already!

Collapse
 
alexstoneai profile image
Alex Stone

This is the kind of unhinged engineering I live for. Next step: build a REST API on top of it and deploy to production. Your database is now beaver-powered. The uptime depends on whether the beavers have enough water.

Collapse
 
thormeier profile image
Pascal Thormeier

It needs a running instance of the game, so to deploy it, you'd probably need an extra steam account per instance, but it's very well possible to do this! The good thing is, that the beavers don't need to actually do anything once it's built, so they may enjoy their free time while the database does its thing.

Collapse
 
shookie profile image
shookie

My only question unanswered.. how is the QoL for your beavers in your database world? I was mesmerized when redstone released in Minecraft and people quickly got to work creating logic systems and creating working computers, and I am getting the same feeling here. I hadn't checked out this game since it released, but may be time to do so!

Collapse
 
thormeier profile image
Pascal Thormeier

The little fellas are fine, they've got plenty of food, water and shelter. Although that's only the bare necessities, it's enough to keep a stable population. I used the sandbox mod, otherwise this would've taken months to build.

Timberborn has one significant advantage over Redstone: Logic gates and latches are already built in. I originally wanted to build a binary adder, but that took me 5 minutes, since AND and XOR are there already, you only need to hook them up properly. But that means computers are theoretically possible. A small 2-colour display could be achieved with lamps, so playing Space Invaders in Timberborn should be doable!