Journal · Games and machine learning

Machine learning game: teach a laser kite to fly

Lazer Kites is a free machine learning game that runs in your browser. Fly the twelve-level campaign yourself, or open Kite School and watch a neural network learn to fly the kite from rewards you choose. Every figure below states its date and the number of runs behind it.

Lazer Kites. Click the game first so it hears the keyboard. Steer with A and D or the arrow keys and fire with Space. On a phone, use the buttons on screen and turn the phone sideways. Full screen is on the title menu where your browser supports it.

What is Lazer Kites?

Lazer Kites is a free browser game about a kite with a laser in its nose. It needs no install and no account, and it runs on a phone or a computer. There are three ways in:

  • Campaign. Twelve levels across four skies, with stars, coins and a hangar of upgrades.
  • Kite School. A machine learning lab. A small neural network, trained in your browser with TensorFlow.js, learns to fly the same kite from rewards you set with sliders.
  • Free Flight. The original 2025 version: sixty seconds, no ground, the old scoring.

How to play

The kite never stops. It flies forward at a constant speed and you only steer, so every shot is a question of where the nose will be pointing next. It also sinks a little all the time. Touching the grass costs a heart, and the top of the sky tips the kite back down, so you cannot park up there.

The laser goes straight through everything it touches. That is the whole game:

  • Line them up. Two balloons in one beam score half as much again, and three score double. Small balloons are worth more than large ones.
  • Keep the streak. Every hit in a row adds 5% to what the next shot scores, up to half as much again from the eleventh hit on. A miss, a lost heart or a bomb resets it.
  • Hold fire to aim. While Space is held the kite turns more slowly, which steadies the nose for a long shot.
  • Mind the bombs. From the thunderstorm onward, spiked bombs float among the balloons. Any beam that touches one costs 25 points, and flying into one, or too close to one going off, costs a heart.

Each sky adds something. The meadow brings drifting balloons that escape upward and armored ones that take two hits. The seaside brings gold balloons worth 30 that vanish after seven seconds, gulls that cost a heart, and bunches that burst into three. The thunderstorm brings bombs, gusts and lightning, which flickers for about a second before it strikes. The aurora night mixes them, and its last level, the Grand Festival, has everything at once.

Coins buy upgrades in the hangar: a faster recharge, a longer beam (it starts at 560 pixels, under half the width of the sky, and grows to 1,500), a fan of two or three beams, tighter turns, more hearts, longer power-ups and more coins per pop. Stars unlock four more kite designs.

How a kite learns to fly

Kite School uses deep Q-learning, the method a DeepMind team used in 2015 to learn Atari games from the screen (Mnih and others, Nature 518). Here is the whole idea, told through the kite.

What it senses. Fifteen times a second the kite reads 19 numbers about the moment: which way its nose points, how fast it is turning and sinking, its height, the wind, where the two nearest balloons are, what its beam would hit if it fired now, and how close the nearest danger is. It never sees the picture you see.

What it can do. Six moves: left, straight or right, each with or without firing.

What it wants. After every move it receives a reward, a single number set by the sliders: so much for a balloon, a small charge for each shot, a penalty for crashing. The reward is all it ever learns from. It never sees the score.

What it learns. A neural network guesses how much reward each of the six moves will lead to from now on, with rewards further ahead counting for a little less. That guess is called Q. The kite takes the move with the biggest Q. Training improves the guesses with one rule, the Bellman equation: a move is worth the reward it earns now, plus 0.98 times the best guess for the moment after. The 0.98, called gamma, makes the kite care about roughly the next 50 decisions, a little over three seconds of flying.

Explore, then exploit. A new brain knows nothing, so at first every move is chosen at random. For a new brain, the share of random moves, epsilon, falls from 100% to 2% over its first 40,000 decisions. A brain that moves on to a new lesson starts again at 50%. This is called epsilon-greedy exploration. Tick Test flight in the lab to switch it off and see what the brain alone would do.

Memory. Every decision is stored: what the kite sensed, what it did, what happened and what it sensed next. Training draws random batches of 64 from the last 60,000, a trick called experience replay, so the brain is not only learning from the last few seconds. Kite School stores what happened rather than the reward itself, so each memory is scored with the sliders as they are whenever training draws it. Move a slider and the brain starts learning the new deal straight away.

A slower copy. The "best guess for the moment after" comes from a second copy of the network, the target network, which is only refreshed every 250 training steps. Without it the guess chases its own tail. The lab also uses Double DQN (van Hasselt, Guez and Silver, 2016): the main brain picks the next move and the slower copy values it, which curbs the guesses' habit of drifting upward.

Where TensorFlow.js comes in. TensorFlow.js computes each training step: the loss between guess and target, its gradients and the update. The kites act from a plain JavaScript copy of the network's weights, refreshed every ten training steps, which is what lets sixteen kites fly at once on an ordinary laptop. TensorFlow.js is about 360 KB to download (one measurement, 4 November 2026), so it only loads when you open Kite School.

SettingValueWhat it does
Network19, 64, 64, 6senses in, two layers of 64 neurons, one Q value per move out
Learning rate0.001 (Adam)how big each nudge is
Discount, gamma0.98how far ahead the kite cares, about 50 decisions
Replay memory60,000 decisionswhat training samples from, 64 at a time
Training1 step per 4 new memoriesstarts once 1,500 memories exist
Target networkcopied every 250 stepsthe slower copy that supplies "the moment after"
Exploration100% to 2% over 40,000 decisionsepsilon-greedy, for a new brain
LossHuberlike squared error, but calmer about large mistakes

The four lessons

Kite School teaches in four steps, and each lesson keeps the brain the last one left. A lesson is passed when the last 30 flights, of up to 20 seconds each (a crash ends one early), meet its goal. "Time on target" means the nose is within about 16 degrees of the nearest balloon in reach.

These are our own runs, chained, in headless Chromium on one laptop on 3 and 4 November 2026: one training run each for Fly, Aim and Pop, and two seven-minute runs for Storm. The results were read from the training logs as they ran; those logs were not kept, and the game's README is their written record. The scripted pilot is a hand-written set of rules. Its column and the random column are the median of 300 repeats of 60 flights each, measured on 4 November.

LessonGoalTrained kiteScripted pilotRandom
1. Flysurvive 90% of flights100% after about 75 seconds100%5%
2. Aimnose on a balloon 30% of the time33% after about 2 minutes34%8%
3. Pop15 balloons per flightabout 25 after about 1 minute26.72.8
4. Storm10 balloons per flight, under one bomb11.6 balloons, 0.6 bombs, after two 7-minute runs13.7 balloons, 0.37 bombs2.0 balloons

The pilot built into the page is the end of that chain, 132,134 training steps across the five runs, and it is a Storm specialist. Replayed for 400 flights per lesson with exploration off on 4 November, it survives 87% of Fly flights and keeps its nose on target 25% of the time in Aim, both just under those lessons' goals, and pops 25.0 balloons a flight in Pop. In the campaign, flown 40 times per level with the upgrades a player would plausibly own by each sky (by the last sky, a 1,120-pixel beam, two beams and four hearts), its score passed the one-star mark on levels 1 to 4 every time and on 68% to 93% of runs on levels 5 to 11. The last level grounded it in 72% of runs. The game itself gives the AI no stars or coins.

Training ran at 87 to 133 steps a second across twelve runs on 3 and 4 November, on one laptop that was sometimes running other jobs at the same time.

Reward hacking you can watch

Reward hacking is what happens when a learner finds a way to collect its reward that is not the thing you wanted. Amodei and others (2016) list it among the concrete problems in AI safety. Kite School has four reward presets built to provoke it.

We tested all four on 4 November 2026. Each started from the trained pilot and had three more minutes of training in the Pop lesson under its preset. Then each brain flew the same 100 test flights with exploration off. A control had the same three minutes with the lesson's normal rewards. Each row is one training run, so the differences are measured across 100 test flights but not across repeated training, which we have not done. Practice alone moved things a little: the control fired 2.4 fewer shots per flight than the pilot it started from.

RewardsWhat changedBalloonsShotsSurvivedNose on target
Lesson rewards (control)nothing25.232.088%20%
Staring contestaiming pays 20 times more, a balloon a tenth as much17.519.195%41%
Trigger happyshots are free27.227.699%18%
Daredevilcrashing costs nothing, staying up earns nothing24.735.094%19%
Couch potatoonly staying up pays0.10.285%8%

Staring contest moved toward what it was paid for. Rewarded twenty times more for pointing at a balloon and a tenth as much for popping one, the kite doubled its time on target and fired 12.9 fewer shots per flight than the control. It still popped 17.5 balloons a flight, enough to pass the Pop lesson, so this is a shift, not a collapse. One run cannot tell two readings apart: popping a balloon ends the thing it is paid to look at, or, more simply, a pop now pays about what a shot costs, so a shot that misses loses.

Couch potato stopped playing. Paid only to stay up, it popped 0.1 balloons per flight against the control's 25.2 and almost never fired, because a shot still costs a little and now buys nothing.

Two of the lab's predictions did not happen. The original hints said Trigger happy would fire constantly and Daredevil would stop caring about the grass. With free shots, the kite fired 4.4 fewer shots per flight than the control, not more. Daredevil crashed no more often than the control. We think the reason is in the Bellman equation: a crash ends the flight, and with it every balloon the kite would have popped afterwards, so removing the crash penalty does not remove the cost of crashing. The other explanation is habit, since three minutes may be too short to unlearn what the pilot already did. A Daredevil run from a brand-new brain would tell them apart. After these runs we rewrote both hints to say what happened. Survival moved between 85% and 99% across the five runs, the control included, so we read nothing into those differences.

The general point holds for anyone writing rewards, in a game or a business. A learner optimizes what you pay for, including the parts you did not mean, and a penalty may matter less than you expect when the situation already punishes the same mistake. Test the reward before you trust the behavior.

Where we moved the goal

The storm lesson first asked for under half a bomb per flight, with lightning in the sky. The brain never met it. We took lightning out of the lesson, leaving gulls and bombs, and trained for two more seven-minute runs, the second with random moves falling to 2% instead of 5%. It passed only after we also raised the bomb limit to one. That is moving the goal to fit the learner, and it is better said plainly.

We also blamed the wrong thing at first. Our draft said the random moves made for exploration were inflating the bomb count. Measured since, they barely do: over 400 storm flights on 4 November, the shipped brain set off 0.70 bombs per flight with no random moves and 0.82 with 5%. The hand-written pilot meets the old goal, at a median of 0.37 bombs across 300 repeats of 60 flights. So the brain is worse at bombs than a few lines of rules, and why is still open. Our guess, untested, is its senses: it can see only the single nearest danger, whether that is a bomb or a gull. An independent review of a draft of this post caught the first version of this story.

Storm is still the brain's weakest lesson: with exploration off it survives 30% of storm flights. When a learner misses a goal, measure how much of the miss is noise before you change the goal. We changed it first and measured second.

Why it is on a consultancy's site

Lazer Kites started in 2025 as a one-round portfolio game. This version, with the campaign and Kite School, was built in November 2026, and it runs on the same habits as Highland Willow's paid work. We are a small consultancy in Boone, North Carolina. Most of our work is ERPNext systems and operations for owner-run companies, and some of it is scientific and research computing: making simulation code run, measuring what it costs, and checking that its numbers hold up. The lesson results above are set against a baseline, a hand-written pilot and random play, so "it learned" means something, and the runs that went wrong are reported here too.

It sits beside other games on this site. Bottleneck Burger teaches takt time by playing it, and Back It In shows why drivers get out and look. For the design side of interactive pages, our sheepdog game walks through what made one work. For the measuring side at a larger scale, see 500 protein folding simulations, what they cost and where our own numbers were wrong. If you have a simulation, a pipeline or an analysis you want measured, reproduced or checked, the services page says how an engagement runs.

Questions

Is it free? Yes. There is no account and nothing to install. Progress and any brain you save stay in your own browser.

Does Kite School need a graphics card? No. It trains on the CPU by default, and every figure on this page was measured that way. A WebGL option that uses the graphics card is in the lab's training settings; we have not measured it against the CPU on real graphics hardware.

Does the kite keep learning after I leave? No. Training stops when the page closes. Save keeps the brain in this browser, and "Fly it in the campaign" lets your brain play the levels.

Highland Willow LLC · Boone, North Carolina · Measurements on this site state their date and the number of runs behind them.