Dungeon Garden runs every D&D group in its own small Cloudflare room, which sleeps between moves and costs close to nothing while nobody is playing (the details are in Cheap enough to give away). The obvious next question is: how many groups can it host before the free plan runs out?
I don't know yet. And I didn't want to guess, so before answering it I built the thing that will.
The meter
Every campaign's room counts its own usage, by UTC day and by month: requests, messages from screens, keep-alive pings, rows read and written, images uploaded. A box in the DM's settings, Hosting costs, shows those counts against Cloudflare's free daily limits, and what they would cost at the paid plan's published prices.
/**
* What running the app costs on Cloudflare, for the DM's Hosting costs box.
*
* Each campaign's room counts its own usage (worker/room.ts) by UTC day and
* month. This file turns those counts into money at Cloudflare's published
* Workers Paid prices. Nothing here bills anyone: it's so the DM can see where
* the cost of hosting would go if the free tier ever ran out.
*/
It bills nobody. It exists so that when I say what a game night costs, the number comes from a game night, not a spreadsheet. It also lists what isn't known: whether Cloudflare bills keep-alive pings isn't documented, so the meter counts them separately instead of pretending either way.
Why first
- A capacity number is a claim. “Hosts 500 groups for free” reads like a fact. If it's a guess, it's a guess dressed as a fact, and it's the kind of thing that gets quoted.
- Real use is weirder than the model. How long a session runs, how many phones stay connected, how often someone uploads a map: those decide the bill, and I can't know them before people play.
- It shows where the money would go. When a cost does turn up, the meter already says which part of the app caused it, which is the part to fix.
What happens without one
madtown.today shows the other side. Its README estimates the cost of each feature by hand, and by that estimate the “who's here” heartbeat was most of the bill. When I finally read the real invoices, most of it was something else: a monitoring add-on and a tab asking the server for news every few seconds. The estimate was careful and still wrong, because it was an estimate. That story is in What madtown.today actually costs.
When Dungeon Garden has enough real games behind it, the capacity number will go there too, with the meter's readings next to it.