// work/emberbound
Emberbound
An idle game for Android about a pixel phoenix and a pile of gold that eventually needs its own notation. It's out on Android, and hopefully the App Store is next.
What you actually do
You tap a button and get one gold. Twenty gold buys a delver, who mines for you while you do something else. At 200 gold you can unlock a phoenix, which makes flame, and flame makes your delvers faster. Then you buy flame upgrades. That's the first few minutes, and honestly it's the least interesting part.
After that the game keeps adding things, 38 unlocks in total. Brightsteel opens at 20 million gold and is the first reset: you give up all your gold for something that makes the next run faster. Arcana opens at a quadrillion. Then come trials, runes, lore, grimoires and a lot more, until the prices stop fitting in normal numbers. The button below goes through all of it in about fifteen seconds.
Gold
0.00
no phoenix
Phoenix
Not unlocked
Unlock 0 / 37: Start. You have a Mine button and nothing else.
One bird, eleven forms
The phoenix is one of the pieces of art I drew for the game. It evolves through eleven forms. Each form costs gold, and each one makes something else a lot bigger.
Hatchling isn't a phoenix,
so there's no bird to draw.
Form 2 / 11
Flamewing phoenix
- Costs
- 2,500,000 gold
- Gives
- flame ×100
The text under each one is what the game says about it. If you clicked through all of them, you probably noticed it's the same drawing every time. About half of the sprite's 195 rectangles are marked as "tint", and each form only swaps that one colour. The first form, Hatchling, isn't a phoenix, so the spot stays empty until it evolves into Flamewing.
The bird is animated with nine separate loops that snap between poses instead of sliding. I wrote a whole devlog post about it: Nine clocks and a bird.
Numbers that need a letter
Normal JavaScript numbers stop at about 1.8 × 10308. Emberbound goes past that well before the middle of the game, so it uses a big-number library that keeps stacking exponents on top of each other. This is the game's own number formatter. Drag the slider to make the number bigger.
10.0
Written out in full, that's 2 digits.
Enough for: nothing.
Loading the big-number library…
Up to a billion, the game writes the number out with commas. After that it switches to the usual 1.00e12 style, and when the exponent gets too big it drops the front part and stacks another e, like ee35,000. Once there would be four e's in a row, it gives up on e's completely and uses F notation, which counts how tall the tower of exponents is. 1.0000F5 is a tower of five tens. None of the phoenix forms costs that much, but the formatter is ready in case you get there.
While you were away
Idle games are supposed to keep going while they're closed. When you open Emberbound again, it takes the time you were gone and runs the real game through it, five seconds at a time, for up to two hours. Everything that would have changed along the way changes in the replay too. Your flame keeps growing, so your delvers keep getting faster.
The easy way would be to multiply your income by the time you were away. This demo does both, so you can see how far apart they end up.
Your save
25 delvers, a Flamewing phoenix, 0 flame. Gold per second uses the real formula.
Pick how long you were gone, then come back.
Two small rules came from actually using it. If you were gone for less than three minutes, the game still gives you the time but skips the pop-up. Most of those are app switches or closing a full-screen ad, and a pop-up saying "50 seconds offline" right after an ad looks like a bug. And when an ad doubles your time, the game replays the same stretch again and then winds its own clock back, so it doesn't think you were gone for four hours.
By the numbers
- 11phoenix forms
- 38things to unlock
- 202upgrades
- 300achievements, and 54 of them actually give you something
- 195rectangles in the phoenix sprite
- 9animation loops in the phoenix
- 1,440five-second steps to replay up to 2 hours away when you come back
- 3,800automated tests that check the game still adds up
Two bugs worth telling
The timer that skipped zero
Late in the game there's the Turning, which switches phase every 30 seconds, but only when its timer hits exactly zero. The offline replay moved time five seconds at a time, stepped right over zero, and the timer counted down into the negatives forever. I wrote it up as its own devlog post, with a demo where you can watch it break.
The logarithm of nothing
The big-number library the game uses says the logarithm of zero is NaN, "not a number", which is fair, because there isn't one. Some of the game's formulas expect it to be 0. One of them, the one that gives you lore automatically, runs right after a reset that sets its input to zero.
So lore became NaN. Anything you add NaN to also becomes NaN, so it spread. The save system refuses to write a broken number, which is the right call, but it meant the game stopped saving.
The fix was to teach the library that the logarithm of zero is zero. That's wrong in a maths class and right in this game. There's a test now that makes sure it stays wrong.
How it got made
Version 1.0.4 is on Google Play now. Most of the work went into making a game about enormous numbers feel good on a phone: a screen you can read with one thumb, a pixel style that stays sharp at any size, and saves that don't lose your run. Roughly in the order it got built:
- NumbersFirst the game had to count past the point where normal numbers give up. Everything else sits on top of that.
- ScreensThen a layout that works with one thumb. The background became #111012 early on and never changed.
- FontI started with Pixelify Sans and switched to Tiny5, the font on this page.
- PhoenixI drew the bird and the logo, then taught the bird to flap.
- Away timeThe two-hour replay, and the timer bug that came with it.
- ReleaseThen it went out, followed by a few quick fixes and a Discord server.
Three days after release, 140 people had played it and 7 of them had joined the Discord. Hi, all 140 of you.
There are dozens of formulas under the hood, some of them a bit strange. If you're a maths nerd who liked the game, or just curious how something in it works, ping me on the Discord. I'm always happy to talk about them.