How Regatta works
A fleet of 4.2 m dinghies races a short windward-leeward course. Every boat is steered by a rule-based skipper that sees the same snapshot of the world every few seconds and replies with helm and sail settings. No language model or machine learning runs in the browser.
The decision contract
Every decision tick (5 s by default, 1 to 10 s in the race settings) each skipper receives a
WorldState: its own position, heading, speeds and wind angles, the local wind and its last minute of
history, the course and the next mark, every other boat, distances to hazards, and the start countdown. It returns a
Command with a rudder setting from -1 to 1, main and jib sheet settings from 0 to 1, and an optional
note. That command then holds unchanged until the next tick. A skipper that turns hard has to know
how far the boat will turn in five seconds, because nobody straightens the helm for it.
The telemetry panel shows the exact WorldState delivered at the last tick and the Command that came back, so you can
watch the contract work. The same interface accepts an external skipper (for example a model behind an HTTP
endpoint); the engine waits up to one tick for its answer. The full shape is documented in
docs/SKIPPER_API.md in the source repository.
Boat physics
- Polar. Target speed comes from a table of boat speed by true wind angle and true wind speed. Inside about 40 degrees of the wind the boat barely moves; best upwind progress is near 45 degrees, the fastest point of sail is a reach near 100 degrees, and a dead run is slower than sailing at 150 degrees.
- Speed. The boat accelerates toward the target with a 3 s time constant and slows with 2.5 s, so a tack costs speed naturally as the bow passes through the wind.
- Sails. Each sail has an ideal sheet setting for the apparent wind angle. Efficiency falls with the error, faster when oversheeted than when eased. Ease both sails far enough upwind and the boat luffs to a stop.
- Helm. Turn rate is rudder times 25 degrees per second, scaled by speed: at rest the rudder has 15 percent of its authority. Head to wind below 0.5 kn the boat is in irons: it drifts backwards and the rudder works in reverse until the bow falls off past 45 degrees.
- Leeway of 3 to 6 degrees upwind, none downwind.
- Contact. Overlapping boats are pushed apart and lose half their speed. The give-way boat (port gives way to starboard; clear astern and windward boats keep clear) owes a 360 degree penalty turn. There are no mark-room rules.
Wind
The wind oscillates around its base direction (plus or minus 12 degrees over about four minutes by default) with smoothed noise on top, and can drift persistently. Gusts and lulls are patches of 15 to 40 percent more or less wind that drift downwind at the wind speed; they show as darker or lighter water. Each boat also casts a wind shadow: a cone five boat lengths long downwind of it where the wind is down to 70 percent.
Course and hazards
The start line runs 60 m between the committee boat and a pin. The windward mark is 500 m upwind and is left to port; the leeward mark sits 50 m below the line. Two laps, finishing upwind through the start line. Rounding is detected by crossing a sequence of invisible gates around the mark in the right direction, so cutting the corner does not count. Leaving the dashed boundary for more than 10 s is a DNF, and touching the sand (a bar off the windward mark and a rocky shore to the east) runs the boat aground for good.
The three skippers
All three run the same code with different features switched on and different noise.
| Behaviour | Novice | Club racer | Pro |
|---|---|---|---|
| Upwind | Straight at the mark, else a fixed 50 degrees; tacks 25 degrees past the layline | Best upwind angle from the polar; tacks on the layline plus 5 degrees | Best VMG to the mark in the local wind; tacks on headers over 6 degrees and toward more pressure |
| Downwind | Straight at the mark | Best downwind angle, gybes on the layline | Best VMG, gybes on the layline or toward pressure |
| Steering | Rudder proportional to heading error, no allowance for the tick, plus random noise | Plans a constant rudder that lands on the intended heading at the end of the tick | Same planner, no noise |
| Sail trim | Three settings: upwind, reaching, running | Ideal table plus or minus 0.05 | Ideal, eased slightly for two ticks after each tack |
| Hazards | Hard turn only within two boat lengths | Looks 20 s ahead and tacks or bears away early | Looks 30 s ahead |
| Other boats | Ignores them | Ducks or tacks when it must give way | Same, cuts crossings finer, avoids dirty air and covers the nearest rival on the last beat |
| Start | Heads for the line 20 s before the gun from wherever it is | Timed run-in on starboard to the middle of the line | Timed run-in to the favoured end, aiming to cross under a second after the gun |
The tiers were tuned with a headless batch of 200 seeded races, two boats per tier, on the default course. In that batch the Pro finished ahead of the Club racer in 87.8 percent of head-to-head pairings and the Club racer ahead of the Novice in 99.1 percent. A Novice ran aground in 28 percent of races, and no Novice finished within the time limit of five minutes after the winner. The Pro averaged 1492 s round the course and the Club racer 1585 s.
Controls
Tick I will sail a boat in the race settings to take the helm. Your inputs apply 20 times a second, not on the decision tick, which is a real advantage over the computer skippers: they commit to a setting for a whole tick.
| Key | Action |
|---|---|
| A / D or arrow keys | Rudder to port / starboard while held; it self-centres on release |
| Shift | Hold the helm where it is |
| Space | Centre the helm |
| W / S | Trim the main in / ease it |
| Q / E | Trim the jib in / ease it |
| X | Ease both sheets while held |
| T | Auto-trim on or off (sheets follow the ideal table) |
| Tab | Camera: own boat or whole course |
| 1 2 3 | Playback speed 1x, 4x, 16x |
| P / R | Pause / restart the race |
On a phone, turn it sideways: buttons appear for the helm and the sheets. Drag to pan, pinch or scroll to zoom, and tap a boat or a leaderboard row to inspect its telemetry.
Replays
Every race records all boat states once a second and every decision with a hash of the WorldState it was based on. At the finish you can watch and scrub the replay, download it as JSON, and load it again later. A race with the same seed and settings replays identically.
How this was made
Regatta was written with an AI coding assistant (Claude Code) from a written specification, then tested with an automated test suite and tuned with the batch script described above. All figures on this page come from that batch run. The site uses no cookies, analytics or third-party scripts, and nothing you do here leaves your browser.