WARBIRDS.IO Dev Log

← All posts

The elevator that waited five seconds

The report: “inverted mouse control only takes effect after several seconds — the first five seconds it isn’t inverted, then it suddenly activates.” It sounded impossible. A boolean doesn’t warm up. But the reporter was exactly right, and the five seconds had a name: pointer lock.

Two cursors, one flag, half the wiring

The mouse-aim reticle lives two lives. Once the browser grants pointer lock, it’s accumulated from raw mouse deltas, and that branch honors the inverted-elevator flag — the sign flip from pull back to climb. But pointer lock isn’t yours at spawn; the browser only grants it on a click, so for the opening seconds of every sortie (and any time Esc releases it) the reticle tracks the absolute mouse position instead. That branch was written before the invert existed, and nobody ever taught it the flag.

Measured in a headless playtest, the two branches were a clean mirror: an inverted-elevator pilot putting the mouse low on the screen got the reticle at −0.48 (a dive order) before the lock landed, and the same gesture commanded +0.55 (a climb) the instant it did. A full-throw elevator reversal, mid-flight, uncommanded — timed by whenever you happened to click. The fix is the same one sign, applied in the branch that never got it; both paths now read the flag, so the convention you chose is the convention you get from the first frame.

And the default flips back

The stick-style inverted elevator shipped as the default because it’s how a real yoke works. It’s also, we’ve conceded, not how a mouse works — new pilots arrive expecting mouse-up-is-nose-up and spent their first sortie nosing into the dirt. So the normal elevator is the shipped default again: push the mouse (or W) forward to climb. If you chose the yoke, your choice is stored and kept; the I key and the Settings checkbox both still swap it, now honestly, from the very first frame. The e2e pilot re-graded the whole aim chain on the new default: the climb gesture took the reticle from 0.04 to 0.55 and the vertical speed from −0.3 to +49.4 m/s.

Settings gets a key

Until now the Settings screen had one door: a link on the join screen, which meant flipping a toggle mid-sortie required dying first. Press O and it opens over the cockpit — pointer lock steps aside so you can click, O or Esc closes it, and like every other key it’s rebindable from the very screen it opens.

The confession

We had already met this bug and looked straight past it. The automated test pilot’s pull-back-to-climb check kept flapping red in CI: headless Chromium drops the OS pointer lock mid-gesture, the handler fell back to the absolute branch, and the reticle dove when the spec pulled back. We diagnosed the test’s lock as flaky, pinned the handler onto its locked branch, wrote a long comment about it, and shipped. The comment describes this exact bug. The suite wasn’t flaky — it was the first player to file the report, and we closed it as works-on-my-machine.