Skip to content
Devlog

Pilots that fly into walls and sit in alleys

A ship flying close between buildings in a narrow city street

What we found in play

The scripted pilot is the hand-written enemy behavior in the dogfight. It steers by measuring the distance to the nearest wall with rays cast ahead and to the sides, which the code calls whiskers.

On October 4 the scripted pilots made poor decisions, such as flying straight into buildings, and that evening, on an M1 Mac, they often got stuck in alleys. In a run on October 9, a pilot sat in one place for 7 seconds over a low roof while its health was shot from 46% down to 25%.

Walls

In 16 scripted duels of 150 seconds each, ships hit walls 5.6 times per ship-minute, nearly all at 10 to 20 m/s. There were two causes. When the way ahead was closed, the whiskers turned the ship but its thrust kept it creeping forward. More often, a wall beside the ship scraped it while it turned or strafed, because the whiskers pointed along the nose and did not look sideways.

The pilot now looks along the direction it is moving as well as the direction it points, backs off a wall that is close ahead, and strafes away from a wall beside it. In the same 16 duels, the rate fell to 0.54 hits per ship-minute. Duels still ended with a winner in 12 of 16 cases, against 14 of 16 before.

A review found the measurement was partly blind

The same night, a review of that night’s code found eight problems, and all were fixed. The largest was in the senses. The pilots cast their rays from where the ship had been one physics step earlier (a physics step is the smallest slice of time the game simulates). At cruise speed that position is inside the ship’s own hull. Each ray hit the ship it came from and reported a wall at zero distance, so the Ravens braked at cruise and never boosted.

The 0.54 figure had been measured with those senses. After the fix the rays start from the ship’s current position and skip its own body. Remeasured in the same 16 duels with the fixed senses, ships hit walls 3.8 times per ship-minute without the new clearance behavior and 1.0 with it.

Alleys

The flight logs from October 9 put a number on the stalls. The nearest pilot stayed within 6 m of one spot for 3 seconds or more 12% of the time in the tight cities, against 2 to 4% in the other cities, mostly while repositioning.

Six duels of 90 seconds in each of two tight cities reproduced the stall in the same kind of spot as the October 9 run, with walls 2 to 4 m from each side and 7 to 13 m ahead. At each decision the whiskers sent the pilot the other way, and it dithered at about 1 m/s for up to 55 seconds. The pilot’s existing stuck check missed this. It required a speed under 3 m/s and thrust effort above half, and braking for the wall held the thrust near half.

The pilot now keeps a trail of where it has been, one point every 0.5 seconds. When its last 2 seconds lie within 6 m of where that stretch began, it goes back along the trail to the newest point at least 12 m away, for up to 3 seconds. A first version that waited 1.5 seconds within 4 m of the last position missed a pilot swinging back and forth over 4 to 8 m.

Duels in Held time, before Held time, after Longest hold, before Longest hold, after Wall hits, before Wall hits, after
Our tight city 23% 4.4% 55 s 3.6 s 132 106
A second tight city 4.1% 3.4% 6.5 s 3.6 s 126 114

A test pilot chasing a target into a dead end 10 m wide held in place for 28 seconds before the change and 4.3 seconds after.

Standing still

On October 10 we decided that hovering motionless should be a trait, so harder enemies are more mobile. In the tight city’s duels, pilots spent 7 to 25 seconds of 15 to 17 ship-minutes held still while firing. Each enemy profile now has a mobility value from 0 to 1 that sets how long it holds still before it shifts position: 8 seconds at 0, down to 1.5 seconds at 1. Easy enemies are set at 0.2, medium at 0.5 and hard at 0.8.

What is still open

A reading of the avoidance code on October 10 found one more possible cause. The pilot’s whiskers all start on the center line of the nose, and the hull is a box 5 m wide and 7.6 m long. A one-story roof sits above the bottom of the hull and below every level whisker, so only the downward whisker sees it, 0.06 to 0.22 seconds before contact. That fits the pilot that sat over a low roof on October 9, but it has not been confirmed against a recorded contact.

The next steps are to sort each wall hit by the direction of the contact, then to test the hull’s real shape against walls instead of single rays, then to choose among open headings. The target is 1.5 wall hits per ship-minute, half of the 3.2 measured in the tight city, against about 1 in the block arena.

Provenance

How this post was made

Drafted by
A Claude Code session in the trilithon.games repository, October 10, 2026, working from the game's changelog, docs and tracker.
What it did
Drafted this post from the game's changelog, roadmap and the pilot-avoidance research notes, and checked each number against them.
Reviewed by
Alex van Rossum,

On the roadmap: The run: a ladder of cities

Linear MIP2-458, MIP2-490commits 01fda3f, 6306418