Tracks
Blocks in Blender.
A track is a Blender file, and building one is picking blocks from a panel and pressing Add. No SDK, no separate editor, and one command to export.
A grid, a level, a quarter turn.
Every road piece fills one or more 32 meter cells and sits on an 8 meter level, turned only by quarter turns. Block ends meet exactly or not at all, and the exporter rebuilds every block from its description and places it with exact arithmetic, so the seams share bit-identical vertices. A wheel can never fall through a seam because there is no seam to fall through.
A block is a shape, a road type, a surface and a special, picked separately, so one shape gives hundreds of blocks. The few combinations that cannot work are refused with the reason: a loop has no room for a pad, and a pool holds water, so it is only ever a level straight.
- Shapes
- Straights, dead ends and transitions. Quarter turns of one, two and three cells each way, banked turns, wallrides and S-bends. Slopes of one level and of two, kickers of two sizes with the landings for them, a hill and a pair of bumps. Tilts that lean the road over, hold it there and bring it back level. Loops of two sizes, each leaving the road one lane to the side.
- Road types
- Tech: flat road between red curbs. Dirt: one deep bowl from edge to edge, so the car settles toward the middle and can ride up the sides. Sausage: a rounded hump to stay on top of. Pipe: the top of a round pipe whose sides fall away to vertical. Bobsleigh: an ice channel whose walls curve up to vertical, whole or with only one wall and the other side open floor. Platform: the full width of the cell, flat. Pool: a basin the width of the cell holding 80 cm of water. Most come with and without a knee-high barrier along each edge, and a transition block turns one road type into the next over a single cell.
- Surfaces
- Twelve to build a road from: asphalt, concrete, dirt, gravel, grass (long and slow, like the ground off the track), turf (mown, for grass roads), sand, ice, snow, metal, wood and plastic. Curbs and barriers bring their own two. Each surface has its own grip along and across the road, its own rolling drag and its own roughness, and the contrast between them is exaggerated on purpose.
- Specials
- The start, which a track has exactly one of, the numbered checkpoints, the finish, and six pads. Turbo and super turbo kick the car forward. Overdrive gives it 60 percent more engine power for four seconds. The rocket booster makes it fall slowly and steer in the air. The spring launches it off its wheels, and reset ends every effect on it. The pad's color says which it is from a distance and the marks on it say so up close.
Pick a block. Press Add.
The NetRacer add-on puts a tab in the sidebar of Blender's 3D viewport, with a panel for the blocks, one for placing them, one for the map, one for the sky and one for the scenery. Blocks can also be dragged in from the Asset Browser, where the whole library has pictures.
Blocks
Choose a shape from a wall of pictures, then its road type, surface and special. Add puts the next block on the open end of the last one. Replace swaps the selected blocks for the chosen one, Paint changes only their road type, surface and special and leaves the shape alone, and Pick copies a block's choices back into the panel.
Place
Connect moves the block you dropped in onto the nearest open road end. Flip turns it round so its other end joins. Turn left and Turn right spin the selection a quarter turn, and Snap to grid puts it back on whole cells and levels. Fill to floor grows a support under a raised block, and Clear supports takes it away again so you can drive underneath.
Check track
Lists every block that does not fit and says whether the road runs from the start to the finish. With strict layout off, the default, those are warnings and the map exports with the blocks exactly where you put them, so you can tilt a platform by hand or pile blocks up. Strict layout on, the export refuses until they line up.
Test drive
Saves, exports and starts a test drive on the map, so you can feel it straight away. A test drive is for building and never reaches the ladder, so drive it as many times as it takes.
The rest of the Map panel is the housekeeping: New map starts a fresh one, Set up snapping puts the viewport on whole cells and levels with a far enough clip to see the stadium, Fix selecting undoes everything that stops a click from picking a block, and Rebuild old blocks brings a map made by an older version of the block code up to what the exporter will ship.
Setting up, from a checkout of the game:
cargo install_blender_addon # once: the add-on and the block library
cargo new_map my_track # data/maps/my_track/map.blend: stadium, start, finish
blender data/maps/my_track/map.blendA place for it to be.
The road is the track, but the rest of the panel is what makes a map somewhere. Everything here is one button and nothing here is a setting the player can change: what you build is what every driver sees.
- Arenas
- A stadium in six themes (stadium, snow, mud, desert, toy and works), or one of six giant household rooms: a kitchen, a bedroom, a bathroom, a living room, a garage and a back garden, all at 44 times real size, so the car is a toy on the floor. A room brings its own light, a lamp overhead and a faint haze, and a table top stands exactly four block levels up, so a road can run across it.
- Sky
- Sixteen skies to pick from a wall of pictures: Morning, Noon, Afternoon, Dawn, Golden hour, Sunset, Dusk, Night, Overcast, Storm, Desert haze, Snow day, Smog, Alien world, Neon night and Space. Applying one can set the sun and the fog to suit it too, and every part of it stays adjustable after: the zenith and horizon colors, the haze, the sun disc and its glow, the cloud cover, color, shade and speed, the stars and the sky light.
- Fog
- Distance fog by color, start, end and strength, set on the scene and carried into the game. The sky is never fogged, so a pale fog washes the scenery out and keeps the road sharp. One button colors the fog like the sky's horizon so the two blend into one.
- Scenery
- Thirty-one outdoor pieces in the six stadium themes: a blimp, a hot air balloon, lattice and water towers, light masts, billboards, a wind turbine, trees, rocks, tire stacks, tower blocks, a hangar, a factory, a tower crane, containers, silos, pylons, a ferris wheel, an inflatable arch, grandstands, a big screen, a radio dish, flags, bales, and seven kinds of lit LED sign. Fifty-four household pieces fill the rooms: tables, beds, a sofa, a fridge, a bath, books to jump from, toys and a parked car to drive under. Everything collides as the surface its material is named after, so a car can land on a rock or glance off a tower to cut a corner.
- Giant scenery
- A campaign map stands a few giant pieces on its floor, each where a rule measured from its road puts it: beside the middle of its longest jump, on the outside of its sharpest bends, and in the biggest empty part of the floor. They keep well clear of the road, of every jump's flight and of every shortcut, so a driver meets one only by leaving the road. Nothing is random: the same map always gets the same giants.
- Water
- A body of water is a box, never a surface and never a material. Add water drops a level box whose top is the water's surface: everything inside it is under water, the car drives on whatever real ground lies under it, the water drags it hard and its tires grip less. Let the box reach down into the ground and keep its sides inside banks or walls. The Pool road type is the same thing built into a block.
- Moving parts
- A mesh can be made a mover from a build script: it spins, shuttles (slides and back) or swings (rocks and back) about its own origin, carrying everything parented under it. Its pose is a pure function of the run's tick and is never integrated, so every run and every replay meets it in exactly the same place and a restart puts it back. A contact against a mover carries the speed of the surface there, which is what carries a car along on a moving deck.
Or write the track down.
A build.py beside the map can lay the blocks instead of a hand in Blender. Each call adds a block on the open end of the last, gap leaves cells empty for a jump, and save puts the sun, the sky, the fog, the arena and the scenery round it, checks the layout and writes the Blender file. A road type never runs straight into another, so a transition goes between them, and save refuses to write the file until every block fits and the road runs from the start to the finish.
t = K.Track('my_track', cell=(0, 0), heading='N', level=1)
t.add('straight', special='start')
t.add('transition', road='tech', road_to='sausage')
t.add('turn2_right', road='sausage', surface='ice')
t.add('transition', road='sausage', road_to='tech')
t.add('loop_big_right')
t.add('kicker', special='turbo')
t.gap(tiles=2)
t.add('landing')
t.add('straight', special='finish')
t.save(arena='Stadium', sky='sunset')Exporting, either way:
cargo build_map my_track # quick unlit export
cargo build_map my_track --bake # Cycles lightmap bakeThe client's --host-map path/to/map.blend runs the same export and starts a test drive on it. The block library itself is rebuilt from its code whenever that code has changed, so a block only ever has one definition. For a block track the exporter also writes the racing line from the start to the finish, which the game's scripted test drivers follow: drive_map drives the map with one of them and reports whether it finished, where it left the road and what it took at each checkpoint.
What the game insists on.
- One start
- Exactly one start marker. A run begins there after the countdown.
- Checkpoints in any order
- Numbered checkpoints can be taken in any order, and the finish counts once all of them are collected. A gate counts for anything that passes through it, however high.
- No reset zones
- Nothing but the driver respawns the car. Leave the map and it stays where it landed with the clock running.
- Surfaces are material names
- A drivable material must be named after one of the surfaces. Anything else fails the load with the material named, so a track can never ship with a surface the physics does not know.
- Water is a volume
- Water is never a surface and never a material. It is a box over a real bed, so the car keeps driving on the ground it would have driven on dry.
- A mover runs on the clock
- A moving part's period must be a whole number of ticks, and its pose comes from the tick alone. It is no part of the static collision world and no part of the render batch.
- Nothing hidden behind a face
- No surface may lie on or just behind another facing the same way. Far off, the depth buffer cannot separate them and they flicker.
- Author time
- A medals file beside the map carries the author's time in milliseconds. Unless the file names them itself, gold is a tenth slower than that time, silver a quarter and bronze half.
Built something? Post the Blender file or the exported map in the NetRacer Discord, which is also where to ask when a block will not connect or an export refuses. Tracks people share there are how the official set will grow.