← All devlog posts

Earfh

A shift, a shop, and Stock

In two days Earfh went from separate endless modes to a full run with a shop between stages, and then to Stock, a currency that survives death. One partial play-test banked 209 Stock, and that was too fast.

Written up later from the repo's history and dated to the days it describes.

Until September 22, every mode in Earfh was its own scene behind its own button, and the standard and arena modes never ended. Their wave quota grew forever. A roguelite needs levels that finish, so the run loop was the next job.

The shift

A run is now a chain. The first stage ends after three waves. The second is a 90 second clock, and surviving to zero is the whole requirement. The third opens four rooms one at a time, clockwise, each sealed by a door built at runtime until the room before it is clear. A shop follows each stage, and the boss level comes last.

Most of the plumbing already existed. GameManager is an autoload, so health, score, stat multipliers and the chosen weapon already carried from one scene to the next. The two older level scripts are a known duplicate fork, so rather than rework them, each end condition went into a small objective node added to its level.

The money is a wallet kept separate from score. At the start it paid 10 per kill during a run, plus a clear bonus of 100, 150 and 200 for the three stages. The spec expected a normal first stage to yield 250 to 300, enough for one or two items, and called every one of those numbers a first guess. The same evening added loot. About 35% of kills drop extra cash, and crates block shots and break into cash or health, or nothing. Explosive barrels hurt everything nearby and chain into each other.

The shop draws four offers per visit. One is always a health restore, and the other three come without repeats from a list of stat upgrades. The next morning it was restyled as the Supply Depot, with kiosk art behind the panel, the wallet in large green digits, and a BUY button that greys out when the wallet cannot cover the price.

Stock

The wallet had one problem left. It reset when a run ended, so money had no meaning past the run it was earned in. The prep screen spec on September 23 fixed that with Stock. When a run ends by death, victory or quitting from the pause menu, a share of the unspent wallet is banked as Stock, plus a bonus for each stage cleared and 200 for killing the boss. Stock is saved, and a new prep screen spends it on weapon unlocks and upgrade tracks with office names such as Health Plan, Paid Time Off and 401(k). The spec's line is that saving money in the Supply Depot pays off long term.

Stock replaced the weapon gates too. The shotgun and the ricochet had unlocked by reaching milestones, a wave count and a kill count. Now they cost 300 and 600 Stock.

The Earfh game over screen over a rainy neon street. It reads GAME OVER, Final Score 3800, Total Kills 33, and BANKED +209 STOCK, above RESTART, MAIN MENU and EXIT buttons.

The first bank rate was half the unspent wallet. The 401(k) track could raise that to all of it, plus 25 per cleared stage. A partial run of mine on September 23 banked 209 Stock at those numbers. The commit that answered it calls that too fast. The same evening the base rate fell to 0.25, the cap to 0.5 and the stage bonus to 10, with each level of the 401(k) track now adding 0.05 and still reaching the cap at level 5. The boss bonus and every price stayed where they were.

A second fix that day closed a hole in the other direction. The Signing Bonus track seeds the wallet at the start of a run, and the whole wallet was banked at the end. Starting a run and quitting at once banked half the seed for free, and repeating it minted Stock without limit. The run now records its seed and banks only what was earned on top of it.

Still guesses

The banking numbers are the only economy numbers a play-test has moved. Every price and track value besides them is still a first guess, and the roadmap asks for them to be tuned by more runs. One question is still open. Closing the window mid-run banks nothing, and whether it should is undecided.

← All devlog posts