Skip to content
URIAH CLEMMER
$ cat blog/a-war-game-for-people-with-jobs.md

A war game for people with jobs

SOFTWARE GAMES 9 min read

Embergrad is a war strategy game played in a browser, in text, on a clock. You run a province: a stretch of scorched ground with a generator, a few buildings and an ambition. A turn arrives every twenty minutes whether you are there or not, money lands every hour, and around you sit several hundred other provinces run by people who would like your land. It is live at embergrad.com, and this is the post about what it is and why it is shaped the way it is.

It belongs to a genre that had its moment around 2005 — the tick-based browser wargame, all tables and forms, playable from any computer lab — and that genre's defining flaw was that it rewarded whoever could log in at four in the morning. Embergrad is my attempt at the same game for people who cannot. The pitch in one line:

The world ends every winter. Build anyway.

Three clocks

Everything in the game runs off three timers, and understanding them is understanding the game. Turns are the action currency — building, training, exploring, attacking, researching all spend them — and you get one every twenty minutes. Money arrives on the hour, $15,000 a time before research improves it. Morale is what stops you spending a week of turns on attacks in one sitting: each attack costs 20–35 points of it, and it regenerates five points every ten minutes into a pool of a hundred.

THREE CLOCKS RUN A PROVINCE one row = 24 hours 00:00 06:00 12:00 18:00 24:00 TURNS 1 every 20 min 72 a day · banks to 600 ≈ 8 days away MONEY $15,000 every hour $360,000 a day before research · the vault is loot-proof MORALE +5 every 10 min pool of 100 100 a morning: three attacks an evening: two more each attack spends 20–35

The three interlock. Turns are what you can do, money is what you can afford, and morale is how much of it can be violence. A player with a full turn bank and no morale can build all day and hurt nobody. That is the design working, not a limitation.

Eight days, not four

The genre's usual turn cap is three hundred — about four days of accrual — and its morale pool is fifty. Together those two numbers are what made the old games demand presence: the bank filled in four days, so anyone who did not log in every few days threw turns away, and the small morale pool meant an attack window lasted minutes and you had to be there for it.

Embergrad's cap is six hundred — eight days and change — and the morale pool is a hundred, regenerating every ten minutes rather than fifteen. A full bar comes back in about three and a half hours. The effect is that fifteen minutes in the morning and fifteen in the evening is a complete way to play: spend the night's turns, run three attacks, come back after work with the pool refilled and run two more. A player who can be at a keyboard around the clock still has an edge — they always will — but the edge is now timing rather than attendance, and that is the version of the edge worth keeping.

ClockGenre conventionEmbergradWhy
Turn cap300 (~4 days)600 (~8 days)A week away costs nothing
Morale regen+5 / 15 min+5 / 10 minA full bar by the next session
Morale pool50100Two sessions a day, not six
Solo attack rangeundocumented×/÷ 2 networthNobody farms newcomers

The tick itself is worth a paragraph for anyone building one of these. Nothing runs on a timer in the naive sense. Each resource stores a last_tick_at, and accrual is computed on read from how many intervals have elapsed since; the scheduler's job is to persist that, not to be it. A missed cron therefore delays nothing and corrupts nothing — the next request does the arithmetic. It is the cheapest piece of resilience in the whole codebase and the one I would tell anybody to write first.

The world burns down every Winter

A round is about two months long, and it is called a Winter. When it ends, every province, every army and every fortune resets to zero. The only thing that carries across is the Memorial Wall: the Orders — the Forge for the highest networth, the Banner for the most war points, the Long Night for the most kills, the Quiet Hand for the most money stolen — and the clan Banners beside them. You are not building something permanent. You are building something worth remembering.

ONE WINTER · ABOUT TWO MONTHS 1 Found 48 h ceasefire 2 Build grid · army · research 3 Fight raids · clan wars 4 The fires return every province resets THE MEMORIAL WALL Orders and Banners, kept for good. Nothing else. next Winter: same map, new weather (the rules change) Die mid-Winter and you refound from the ashes with a bonus sized to what you had — a setback, not an exit.

The reset is the genre's best idea and I did not touch it. Losers get a fresh start, winners get a line on a wall, and nobody's lead compounds for years. What I added is weather: each Winter can carry its own rule modifiers — a speed Winter, a Winter without satellites, doubled missile accuracy — so the meta has to be relearned each time rather than solved once. The older games did this by accident, rebalancing between every round; here it is a feature with a name.

There is also, for the first time in this genre as far as I know, a map. Provinces have coordinates. The city of Embergrad sits at the centre — neutral ground, the place the market and the banks run through, the one thing nobody can own — and distance from a target prices an attack. Your neighbours are a real thing. So is being surrounded.

Death, and the proving grounds

You can die. Lose every building and the province is gone, and you found a new one from the ashes with a bonus sized to what you had. It is a setback rather than an exit, but it is a real setback, and it is what makes an attack mean something. A game where nothing can be lost is a spreadsheet with a story.

Newcomers get a 48-hour ceasefire during which nobody can hit them — and, because the old games left you with nothing to do during yours except read the manual, a set of PvE proving grounds: rogue provinces to practise attacks on, with real battle reports, so the first fight against a person is not also the first fight.

What money buys, and what it never will

The game is free. There is one thing to pay for, the Ember Pass — $4.99 a month, $39.99 a year, or $7.99 once for the current Winter — and the rule about it is written on the pass page in the same words it is written in the code:

The Ember Pass never sells turns, money, land, units, morale, missile or satellite power, accuracy, protection, or any number in the balance config.

Nothing a paying commander owns changes a single combat, economy or espionage calculation. If a proposed perk touches a formula it is rejected, and the list of rejected ideas — turn boosters, faster ticks, extra protection, clan-level war-room tools that would read as "rich clans win" — is longer than the list of perks. What the pass buys is identity and convenience: a sigil beside your name, a province motto, a battle-report archive of 250 instead of 25, and SMS alerts, which are gated honestly because every text costs me actual money.

This is not virtue; it is survival. A tick-based war game dies the day money buys power, because the people who make the game worth playing are the ones who will not pay for an unfair fight. Every one of these games that ever lasted had the same rule.

Six accounts, one laptop

The problem every PvP game with a free signup has: one person running several provinces and feeding the real one. The classic answer is to compare IP addresses and ban whoever matches, which is wrong in both directions — a household is one IP and two honest players, and a carrier NAT is one IP and four hundred strangers.

Embergrad records signals rather than verdicts. Each signed-in request writes one row per account, device, network and browser family. The IP is stored as a keyed hash rather than in the clear — a bare hash of a 32-bit space is reversible in minutes, which would make the table a list of players' home addresses — and the browser is reduced to a coarse family. Rows older than ninety days are deleted nightly.

Then, every night, a pass groups accounts that share a device or a network and measures the value that moved between them. That last part is the whole idea. Sharing a network proves nothing and scores zero on its own; an IP shared by more than eight accounts is ignored outright, because that is a carrier, not a person. What convicts a multi is money flowing one way: a main looting its own alt, aid flowing to one account from several. The scores are small, explainable integers — a household on one laptop lands around 15, two friends trading blows evenly around 39, a main farming its alt around 69 — and the page that shows them opens with the warning rather than the queue, because a reviewer who arrives thinking the number is an accusation will confirm it.

And there is no ban button on that page. A test asserts the method does not exist. Enforcement lives in a separate account-state machine — suspend, ban, their inverses, every action reason-required and audited — and wiring an irreversible action to a suspicion score is the wrong order in which to build those two things. When a suspension turns out to have been wrong, there is an apology package, and it is restitution rather than a gift: it returns the turns and income the seal cost, computed from how long the seal lasted, so it scales with the mistake and nobody has to decide what a wrongful ban is worth.

Under the hood

PieceChoiceNote
FrameworkLaravel 13 · PHP 8.4MySQL in production
ScreensLivewire 4The genre's page-per-screen UI fits it exactly
StylingTailwind 4, hand-rolledAn amber-phosphor terminal — the ember is the palette
CombatPure domain servicesSeedable RNG, so battles are unit-testable and simulable
ConcurrencyRow locks on both provincesTwo attacks landing at once is the classic race
PaymentsCashier · Stripe CheckoutCard data never touches the app
Support & mailuclemmer/laravel-tickets · postmasterThe same packages this site runs on

Every attack runs inside a transaction holding row locks on both provinces, because two attacks landing on the same target in the same second is the one race this genre is famous for. Combat is a pure function of two provinces, an attack type and a seeded random source, which is what lets the balance be simulated: the formulas the genre never published — combat resolution, networth, loot — are my own reconstructions, and they were tuned in a simulator before a human ever felt them. That is also the honest caveat. The first real Winter is the one that will tell me what the simulator could not.

At the time of writing there are 393 tests, and the ones I am fondest of are the negative ones: that the pass cannot touch a formula, that the integrity page cannot ban, that a deleted account's battles still exist for the people who fought them.

See you in Embergrad

It is a slow game. Fifteen minutes, twice a day, is enough to matter, and a week away costs you nothing but position. If you played anything like this twenty years ago, you will know exactly what to do; if you did not, there is a ceasefire and a proving ground waiting. The Winter is at embergrad.com.

#laravel #livewire #game-design #fair-play
CONTINUE? Questions about this one? Say hello →