asteroids-ml nodejavascript.com

Nobody taught it to run. Nobody taught it to shoot.

This is the arcade game, with one change: the pilot is not you. It is a network of 411 weights that starts out connected to nothing — so the ship sits still and the first rock that drifts into it ends the episode. Everything it can do after that, it worked out from a number that goes up when it stays alive.

And the number is where the page gets interesting. Paid only to survive, the pilot becomes a runner: it turns away from everything, never fires, and eventually the rock field it never thinned out corners it. The way to survive longer is to shoot. Not as a slogan — as a measurement, on this page, with the switch that proves it.

3D by three.js · one 411-weight network trained in the tab · no library for the learning · no server, no account, no keys.

Watch it learn to fly

It starts by doing nothing at all. The network's output is wired to zero, so the ship does not turn, does not thrust and does not fire — and the first rock to reach it ends the run. The ship on this court is not a demonstration player standing in for the real one: it is the one being trained, and every number around the court is what it can manage at this moment. Reload, or press Start again, and it goes back to knowing nothing.

Generation0
Episodes flown0
Survived, best0s
Rocks destroyed0
Shots fired0
Best score0
Step size0
Danger now—
The pilot's own record, on the fields it is trained on. It sees nothing else.
Best run so far Value
Seconds survived 0
Rocks destroyed 0
Waves cleared 0
Bullets fired 0

What it is learning, as it learns it

Five charts, one question each, and every point on them is a number this tab produced — the search is running while you read them. A dashed rule marks each generation at which the examination was held. Where a line is drawn in blue it was measured on fields the pilot has never been paid against, which is the only line that cannot be earned by memorising anything.

Learning progress 0% The share of a field's worth of rocks the pilot clears, capped at one. 100% is the examination bar: a field's worth removed on every field it has never been paid against, so the line is progress rather than a score in the search's own units.
The thing it is paid Best score the search has found, against generation.
Seconds survived The two lines are the same pilot: the fields it trains on, and fields it has never seen.
The hunt Rocks destroyed per episode. If this line stays at nothing, the pilot is a runner.
Does it shoot? Shots fired per episode — the mechanical question the whole page rests on.

The hunt and Does it shoot? are the page's argument, and they are the reason the panel exists at all. A runner's shot count is a flat line at zero and its rocks-destroyed line never lifts — and the blue line, the one measured on fields it was never paid against, is how you tell a pilot that has learned something from one that has memorised the fields it is judged on.

The examination

The examination has not been held yet

What the pilot is paid for

A network that has never survived a second has to be told something, or there is nothing to search along. Every term is printed here, because a reward you cannot read is a claim you cannot check — and the first version of this table paid one a tick, which made hiding worth three times the entire opening field and is why the ship used to drift instead of hunt.

Term Pays
A rock destroyed — small, medium, large (smaller pays more) 60 / 40 / 20
…multiplied by how fast the ship was travelling and how close it was when the rock broke ×1 to ×6
A rock destroyed while it was within 1.5 seconds of hitting the ship +400
A bullet that hits nothing −5
Accuracy, paid at the end of the episode — hits × hits ÷ shots ×400
Every rock in the field destroyed — the field emptied +1500
Being hit — which also ends the episode −15000
The 60-second clock — a cap on the episode, not the goal nothing

The rock and field terms are on. Turning them off leaves a pilot paid for one thing only — staying alive, at 0.05 a tick.

How it learns

By hill climbing, which is the least clever method that works and the easiest one to check.

What the pilot is shown is not the arena's coordinates. It is handed what it can see from where it is looking — the four nearest rocks, each as distance, bearing and closing speed in the ship's own frame — so a habit it learns about "a rock closing on my nose" is true at every heading. That is the difference between a search this small finding something and a search this small learning trigonometry from scratch.

The ring you cannot argue with

A word on the arithmetic, because it is the one number on this page that is derived rather than measured. The ship's nose swings at a fixed rate and its engine pushes only along the nose, so a pilot that is facing the wrong way spends time turning before it can move at all. Give the rock a closing speed, add the turn and the escape, and you get a distance: inside it, a head-on rock cannot be avoided by any sequence of inputs. The court draws that ring around the rock that is coming, and the same number is the last input of the pilot's observation — so the machine is handed the yardstick rather than asked to guess it, and the drawing and the decision are one quantity.

Questions this page gets asked

What is the pilot actually paid for?

Every term is printed here, because a reward you cannot read is a claim you cannot check. The objective is to hunt: go fast, get close, hit what you fired at. So a smaller rock pays more than a larger one, which is the opposite of the arcade's own scoring and the right way round for aiming; a hit is multiplied by up to six for the speed the ship carried into it and the distance it was fired from; and shooting a rock that was about to hit you pays 400, the one action in the game that is offence and defence at once. Wasting bullets is dealt with twice, and the second way is the one that works: a bullet that hits nothing costs 5, and accuracy itself pays — hits squared over shots, 400 times. Raised the fine alone and the pilot simply went quiet, which is why the ratio is paid instead: it cannot be collected by not shooting, only by shooting straight. Being hit costs 15,000 and ends the episode — huge on purpose, because with nothing paid for lasting it is the only thing standing between hunting and charging in to die. Nothing is paid for lasting: the clock is a cap, and a pilot that circles and fires at thin air scores nothing at all. The arcade's real score is still counted and printed beside the game; it is simply not what the pilot is paid.

Why does shooting help it survive, when running away is safer?

Because running is not actually safer here. The arena has no walls — it wraps — so a ship that only runs stays in a field that is getting no emptier, and density eventually corners it. Every rock destroyed is one fewer thing that can kill it, and the pilot has to be good enough to survive what it creates: a large rock becomes two faster mediums, and those become two faster smalls. The reward pays for that; the switch at the top of this page is how you check that the reward is doing the work.

Is the ship on screen the one being trained?

Yes. The weights the search is working on are sent to the court as they change, and the court flies them. The generation-zero pilot is built by the page from the same seed the worker would use, so there is never a moment where the ship on screen knows something it has not learned — which is why the first seconds of a fresh start are a ship that sits perfectly still.

Does anything I do here leave my browser?

No. The game, the training and the network all run in the page, and they are gone when the tab is closed. The site sets no cookie of its own. Google Analytics loads only after you agree to it, and refusing makes no request to Google at all.

Privacy

This policy covers asteroids-ml.nodejavascript.com and nothing else. It was last changed on 6 October 2026.