Skip to content

The destination was underground

Topicspursuit, measurement, oldest bug, hot reload

The getaway car turning in place, scraping a wall and never leaving the block is the oldest complaint in this project. It has outlived four explanations. Every one of them was about driving — the wrong strategy, the wrong speed cap, the game’s own AI reaching in — and every one was wrong, because the problem was never the driving. It was the address.

The destination is worked out by taking the direction away from the player and going three hundred metres along it. That direction was being normalised in three dimensions, which means height counted as part of it, not just the flat map. That sounds harmless and is not. If the player is standing above or below the car, the height difference goes into the direction, gets multiplied by three hundred, and comes out the other side as a destination under the road. Measured across one session: 218 metres down, then 41 up, 35 up, 34 down, 42 down, 19 down.

The engine has no route to a point buried in the world’s geometry. So it does the only thing it can with an order it cannot carry out: it turns the car toward the point, drives into whatever is in the way, backs off and tries again. Everything that looked like bad driving was a car obediently trying to reach the centre of the earth.

Flatten the direction before scaling it and the error goes to nothing. Three samples, all exactly zero: car at height 50, destination at 50; 45 and 45; 23 and 23. Then the case that used to break it every time, with the player below and the call above: the car went from twenty metres away to four hundred and thirteen, touching a hundred kilometres an hour.

The same night turned up a smaller discovery that changes every night after it. For a month this project had been restarting the game after every code change, because its own written rules said redscript has no hot reload, no way to swap in new code while the game is running. It does, through RedHotTools, and the live state survives it. Two reloads in one session, the second pressed in the middle of a pursuit, and the call stayed alive for another two minutes, car and all. A month of restarts on a premise nobody had checked.