HoverCraftsman

It is 1998, and your startup's office is a large orange hovercraft on San Francisco Bay. The investors at Sand Hill Capital want a live demo at their pier by five o'clock. Write the demo at the 17 inch CRT in your cubicle, upload it over the satellite link, then take the helm and stop the office in the berth beside their pier. A rival startup is pitching to the same investors, and races you there in a speedboat: if it reaches their pier first, you lose. The faster you finish, and the less you dent the hull, the higher your score.

Controls:

Driving a hovercraft #

A hovercraft has no tyres. A car's tyres push sideways hard, so it goes roughly where it points. A hovercraft's skirt barely grips, so the craft keeps going where its momentum takes it:

The dial on the dashboard shows the craft from above, nose up, with its velocity as a blue arrow. When the arrow and the nose disagree, the craft is sliding, and the number below it is the angle between them. The chase camera (C) swings round after the heading, so you can see the slide from outside too.

Wind #

The summer sea breeze comes in through the Golden Gate from the west-north-west. It is light in the morning, fills in from eleven o'clock, and blows a steady 20 knots from three, gusting a fifth either way and swinging a few degrees. The sea follows it: calm at nine, with whitecaps over the open bay by the afternoon.

The skirt barely grips the water, so most of what slows a hovercraft is the air. The game works out the air's drag from the craft's speed through the air, not over the water, and the hull's side shows the wind more than twice the area its bow does:

The speedboat planes on the water and shows the air far less of itself for its weight. In still air the air is about a seventh of the drag its engine works against at 17 m/s. Into 20 knots of wind it makes about 15 m/s, and with it behind it makes about 18. It also slides a little sideways, about a twenty-fifth of the crosswind, which it steers out as it makes for each buoy. Its channel runs both with and against the wind, so the wind costs it little, and the office's shortcut costs the office some time. Leave early, before the breeze fills in.

At speed the skirt throws spray off its sides and bow, and the wake spreads behind in two arms. The wake stays where it was laid: the game keeps the stern's last 128 positions, one every 4 metres, and draws foam splats on the water along that track, so it curves through your turns and fades over 20 seconds. The bay is choppiest out over deep water, where whitecaps break, and calmer over the shallows off the beaches, sandbanks and mud flats, where the bottom shows through. Over a reef the water darkens to weedy rock, and surf breaks along its edges. The speedboat leaves a wake of its own. Ashore, sheds and warehouses with roller doors face the water, and oaks, cypresses and scrub grow on the dry grass behind the seawall.

The autopilot flies the route on the chart, south of the rocks and the first reef, over the Middle Ground, through the bridge's navigation span, across the flats and through the gap between the reefs, and along a straight final approach to the berth. It works out the acceleration it needs and points the thrust that way, slows early for corners and for the berth, and keeps some throttle on while it turns so the rudders have air. It leaves you free to write code, but it is too careful to win the race on its own. Touching the throttle or rudder at the helm takes the controls back.

The satellite dish on the roof cannot track the satellite while the craft yaws quickly, or under the bridge, and takes a few seconds to lock on again. The upload only runs while the link is locked, so a twisting course holds it up.

The race #

The rival's speedboat waits beside your pier until you leave it, or until ten o'clock if you haven't. It has to keep to deep water, so it follows the buoyed channel: north of the rocks, through the bridge's navigation span, and up the east side of the bay, the long way round the shallows. It cruises at 17 m/s, a little under your top speed, but it turns and stops far more sharply, so following it down the channel loses.

Your way is across the shallows. The Middle Ground, between the rocks and the freighter, cuts the corner before the bridge. North of the bridge, broad flats lie across the direct line to the berth, with more sandbanks and reefs the nearer you get, and two reefs leave a gap about 60 metres wide to steer through. The chart (M) shows the flats, the sandbanks in sand colour, the reefs in red, and the speedboat as a red mark. The status line shows how far it still has to go.

The bridge electronics #

The office has the best navigation kit money could buy in 1998, and some of it was only just reaching yachts and small craft that year:

The same radar picture and amber readouts also show on the helm console's screens in the cabin.

How it renders #

Rotunda uses a 2D BSP, as Doom does, and Colosseum uses Build-style sectors alongside a polygon BSP. HoverCraftsman uses only true 3D BSPs of convex polygons, like the structure BSP in Halo. It needs two of them, because the office moves.

The craft is 999 polygons, built in its own frame: hull, skirt, cabin walls with window openings, a windscreen that leans back like the Mercedes C111's, cubicles, CRTs, and the propeller ducts. The four rudders swing with the helm, so they stay out of the tree and are drawn just after it, depth tested. The rival's speedboat moves too, so it is drawn the same way, after the bay. The bay is 10,292 polygons: water, mud flats, sandbanks, reefs, hills, rocky islands with beaches, a freighter, the bridge, piers and buoys, and shores lined with sheds, trees and scrub along a quayside road. Each set gets its own tree when the game starts. Picking each split from the polygons' own planes alone would cut hundreds of trees along the shores, so for long lists the builder also tries upright planes across the bay, which can pass between them. Each frame draws the craft's tree front to back from the eye moved into the craft's frame. It then draws the bay's tree front to back into whatever pixels are still empty. From inside the cabin those are the windows, so the bay never draws over the office. From outside, the bay's pixels are depth tested against the craft's instead. Both walks skip subtrees whose screen bounds fall only on pixels already drawn.

Your monitor's picture is drawn into a 192 by 144 buffer each frame and mapped onto the screen polygon, with curved glass, darker corners and scan lines. Everyone else's monitor runs a starfield screen saver.

A test draws fixed views both ways, through the trees and by putting every polygon through a plain depth buffer, and checks that at least 99.5% of pixels match. On an Apple M5 in Node.js, five fixed views take 6 to 13 ms a frame through the trees and 12 to 16 ms through the depth buffer.

The craft's motion is simulated in fixed 16 ms steps, per unit mass. Thrust and drag act along and across the craft separately, and full throttle tops out at 20 m/s (39 knots). Steering grows with the air across the rudders, the stern's fins swing the bow toward the direction of travel, and the hull bounces off obstacles and spins about its centre when hit off-centre. Walking happens in the craft's frame, so you move with the office, and its accelerations throw you about. The title, pause and end screens request no wakes, and only render writes the 640 by 480 KTX2 frame.