Repository navigation
Eon Commando 2.3.0 — 74% fewer draw calls
74% fewer draw operations per frame — 2,210 down to 573. Same pixels, a quarter of the work.
I measured this by instrumenting the canvas context and counting calls, not with a stopwatch. That matters: my first stopwatch runs said the ground baking was 30% faster, then the same build measured slower on a re-run. Headless frame timing is noisy enough to lie to you, so I switched to counting operations, which is deterministic.
What actually cost the time
Not the ground — the legacy path already culled to the viewport, so baking it saved only 235 ops. The surprise was text: every HUD string was drawn as dozens of fillRect glyphs per frame, and the score alone was ~1,400 of the 2,210 operations. Caching each unique string into a small canvas and blitting it did most of the work.
- Ground baked into 1024 px chunks — floor, strata, rim light, 1,100 speckles and every prop rendered once. The old path stays behind
?legacyground=1so you can compare: they match to within one pixel on 0.24% of pixels (sub-pixel rounding where chunks meet). - HUD text cached by string, scale, colour and shadow.
- Broad-phase bullets skip enemies they can't reach before doing box maths.
New tools you can use
| Flag | What it does |
|---|---|
?fps=1 |
Overlay: fps, frame ms, entity counts |
?bench=600 |
Times 600 update+render pairs, prints the average |
?seed=4242 |
Pins the run seed — reproducible end to end |
?legacyground=1 |
Draws the floor the old way, for comparison |
?seed also makes runs reproducible for replays: cosmetic randomness (rnd, pick, chance) now routes through the seeded fx stream instead of Math.random.
Two bugs found on the way
Props taller than the ground line were clipped out of the baked chunks, and the chunk gradient was mapped across the wrong band, tinting the whole floor. Both only showed up because I diffed the baked render against the live path pixel by pixel — neither would have been obvious to the eye on a dark stage.
Numbers
| Game | index.html — 153 KB, single file |
| Gzipped | 42 KB |
| Draw ops/frame | 573, down from 2,210 |
| Dependencies | 0 |
| Network requests | 0 |
Full notes in CHANGELOG.md.