Race a friend a few times and you start to know the course: the kicker on the left after the first roller, the trees that close in before the finish. That was because there was only one. Every 1v1 race started at the top of the mountain and ran the same 1500 metres down it. This week every race got a course of its own. This post is about how two browsers agree on a course without sending it, why a course drawn 20 km down does not ride like 20 km down, and how the finish gate was made to stand on its snow. The short version is in the changelog.
One number is enough
Powderline's mountain is not stored anywhere. It is worked out from arithmetic as you ride: ask for any point on it and the same maths gives the same slope, the same ice patch, the same tree and kicker, on any machine. That is what makes a race possible without a server. Both browsers build the mountain themselves, and only the two riders' positions travel between them.
It also means a course needs no description. The mountain never ends, so a race does not have to start at the top. When the host presses start, their game picks where on the mountain the course begins, anywhere in the first 30 km, and sends that one number with the countdown. Both games then build that stretch, and the course is identical for both riders down to the last tree. A rematch picks again, and never the same course twice in a row.
The starts are always a whole multiple of 400 metres down. That is the step the game uses when it quietly re-centres the world around you to keep its coordinates small, so a course always begins on the same grid of terrain chunks as a run that rode down to it. If one of the two riders has an older version of the game still open, it cannot read the number, so that pair gets the classic course from the top rather than two different ones.
Deep, but not harder
The mountain gets harder as you go down it. The snow runs faster, ice spreads, the ground gets rougher and the woods close in, easing in between 300 metres and 4 km of descent. A course drawn 25 km down would be all of that from the first metre, and whoever drew it would be racing a much harder hill than the last pair did.
So on a race course the difficulty counts from the course's own start line instead of from the top. Every course starts on easy snow and gets harder over its 1.5 km exactly as a run from the top does. Only the shape of the slope, its regions, its trees, kickers and lifts, belong to wherever it was drawn.
That had to change in two places that must always agree. The physics samples the mountain on the main processor every step, while the snow you see is built by the graphics card, from a copy of the same maths. If they drifted apart you would float above the snow or sink into it. The check that compares them now also runs on courses 17.6 and 30 km down. The two still agree to within 0.56 millimetres there. Another check scans the slope for flat spots, because a rider must never come to rest. It used to cover the first 8 km, and courses now reach past 31, so it was run over 32 km. The flattest point on the fall line still drops 5.9 centimetres a metre, above the 5 the game promises.
A clear start and a gate on the snow
At the top of the mountain the start line happens to be open snow. Anywhere else it could just as well be in deep woods. So a race course keeps its start line clear: no trees, rocks, kickers or standing riders for 60 metres down from the line, 12 metres either side of it. The finish gets the same treatment, a wider box round the gate, so nothing grows through its towers or stands in the line.
The gate itself is a real structure: two truss towers 29.6 metres apart with a beam and a banner between them. Each tower stands on its own foot, so on a slope that falls away across the course one tower is simply taller than the other. Its beam used to be set 7 metres above the higher foot. That is not enough if a swell rises between the towers, so it now also has to clear the snow anywhere under it by the banner's height and a rider's. And the gate is only drawn once the snow under it has streamed in, so it never hangs out in the fog over a slope that is not there yet.
The race was then tested end to end, two real browsers racing over a real peer-to-peer connection. Both landed on the same course, 12 km down, with the same 892 trees, rocks and standing riders on the stretch of mountain loaded round the start. Both had the gate on the snow, off by nothing at all. The rematch moved both to a new course, 22 km down, and again the same one.
Something we found on the way
Checking the courses turned up an older bug. Every 400 metres the game re-centres the world around you, and everything in it moves back at once. Your track's copy on the graphics card was supposed to move with it in one go. But the slice of track laid in that same frame told the card to update only itself, and the big move was lost. So after every re-centre, the track behind you was still being drawn 400 metres further down the mountain. That is often right over a dip, so it hung in the air ahead of you, with a long sliver joining it to the new one.
That is fixed, and a test now catches it. Separately, anything that rests on the snow, such as your track, the thrown snow, stop piles, lift lines and the finish gate, now ends exactly where the snow does. The mountain behind you is only kept for a chunk or two, and some of those things outlived it. Look back up the hill after a stop and they used to stand on a slope that was no longer there.



