dogfight: a 3d remake of a game from childhood
A friend of mine built a little Haxball style game. You open a link and a few seconds later you're playing with your friends. No install, no account. I couldn't stop thinking about that.
When I was a kid we played a 2D dogfight game. Little biplanes, red against green, two players on one keyboard. Turn, shoot, crash, again. I wanted that back, in 3D, behind a link.
So I made it. Well, I directed it. I didn't write a single line. Claude Code did, running Opus, with the superpowers plugin. Every feature started as a conversation, then a design doc and a plan that I read and argued with. After that, separate agents built each task and other agents reviewed it before anything got merged. My part was deciding what the game should be, catching what was wrong, and saying no until it was right. I'll write about how that works in another post.
Go on the server, Three.js in the browser. It's at dogfight.ahmetbirinci.dev.
A few moments from building it stuck with me.
The first time I played on bad Wi-Fi, my plane went crazy. It would jump a hundred meters, then jump back. We first blamed the smoothing for correcting too fast. It wasn't that. During a freeze, the server kept flying my last input while my screen kept flying what I was pressing, and when the connection came back all the old updates landed at once. Now the client only looks at the newest update, predicts with the input the server is repeating during a freeze, and slides the plane over instead of teleporting it. The same freeze ends with a small nudge, and there are signal bars under the score so you know when it's your Wi-Fi.
The planes are made by a script that drives Blender, so every plane is just a file of numbers. The first F-16 had an intake that looked like a J-10's, a box instead of that wide flat smile under the nose. I sent one photo of each and said "this, not that". Next render was right. Now there are 17 planes, at their real sizes, and bots fought each other a few thousand times to balance them. The funniest finding was that 150 meters of extra lock range turned the F-16 from a loser into the best plane in the game.
There are two missiles, and you escape each one differently. Heat seekers are short range and fire and forget. Every flare fools one with a 65% chance, so three in a row leave it about a 4% chance of getting through. Radar missiles reach further and ignore flares. To shake one you put it at your three or nine o'clock and hold it there for a full second while the HUD yells "BEAM IT!". Every hit rolls dice too. 15% of the time you just go down, otherwise the engine, controls or electronics take the damage.
The bots decide ten times a second. Difficulty is really reaction time, aim error and how often they drop flares. When a missile comes, an easy bot notices it after 0.6 seconds, a hard one after 0.12. Bots drop flares slower than a human can, on purpose. That gap is the human's edge. They take off from the runway, land, rearm, and fill any empty seat in a room.
The thing I wanted most works now. Two friends make a room, pick the same side, press start, and the bots fill the sky. That's the game we played as kids, more or less.
The code is open: ahmetbir/dogfight. The multiplayer plumbing ended up in its own library, ahmetbir/roomkit.