Tracks from real streets
For creatorsAdd-on 2.2.2+
In this tutorial you put the hover race on real streets. First you meet the segment wall, a barrier along any line at any angle, and its sibling the trigger line. Then you see how a loop of real streets becomes a circuit, and race the same rules on it. This builds on tutorial 12, Hover racer.
▶ Race the Capital Loop: three laps of about a kilometre on Brittany Street, Dulsey Road, Dupont Road, Orleans Road and Sam Rittenberg Boulevard, past the real buildings beside them. ▶ The authored circuit runs on the same walls. The controls are the same as in tutorial 12.
1. Why boxes are not enough
Section titled “1. Why boxes are not enough”Arcade solids collide as boxes lined up with the axes, taken from the mesh. That suits a brick or a paddle, but a road at 37° is not a box. A curved street built from boxes needs thousands of them.
2. The segment wall
Section titled “2. The segment wall”A segment wall is a barrier along a line of points: no box and no mesh, any angle, any length. In the add-on, its component is Arcade Line Wall.
-
Add an Empty (or any object) and choose Add Component ▸ Arcade ▸ Arcade Line Wall.
-
Set
arcade.wallto the line’s points asx,zpairs separated by spaces, relative to the object: for example0,-7 0,7for a line 14 m long. -
For a barrier round a whole circuit, set
arcade.wallClosed = 1to join the last point to the first, and give it a layer such asarcade.layer = wall. -
Model a low strip along the same line so players can see the barrier.
| Tag | Value | What it does |
|---|---|---|
arcade.body |
wall |
Makes the object a segment wall |
arcade.wall |
x,z x,z … |
The line’s points in the play plane, relative to the object |
arcade.wallClosed |
1 |
Joins the last point to the first: a loop round a track |
arcade.wallSensor |
1 |
A trigger line: it never blocks, and every mover crossing it reports |
arcade.layer |
wall, check, … |
What it is, for On Contact’s with |
A mover meets a segment wall as a circle of arcade.radius (half its smaller side if you leave it out; the hover craft uses 0.9 m). It is pushed out, loses the speed it had into the wall and slides along it; a bouncing body reflects instead. A push against gravity counts as a floor, which gives a platformer slopes. Each touch fires On Contact once. Thousands of segments stay cheap, because a body only tests the few near it.
Trigger lines. A checkpoint or a finish line is a segment wall with arcade.wallSensor = 1. It sits exactly across the road at any angle, where a box across a diagonal road would be a big square.
-
Open your hover racer file and replace the barrier boxes with two segment walls, one per edge, each closed round the loop.
-
Replace each checkpoint with a trigger line across the road, keeping its name (
Check0toCheck7) and its layercheck. -
Press Build Cartridge and race: the craft slides along the barrier on every bend, and every checkpoint counts at whatever angle you cross it.
3. How a loop of real streets becomes a circuit
Section titled “3. How a loop of real streets becomes a circuit”A street in OpenStreetMap is a line of points, which is exactly what a track’s centreline is. Rounding every corner into an arc is how a line of points is raced like a curve. The Capital Loop was found this way:
- Take a box of the map and keep the streets you can drive: primary roads down to residential and unclassified ones, with no service lanes or slip roads. Prune dead ends until only loops remain.
- Walk every ring of streets round one block, turning at each junction onto the next street clockwise.
- Choose the ring nearest the lap length you want that is round enough to race. The thin slivers between two halves of a dual carriageway drop out.
- Measure it in metres round its own centre, smooth away points that add nothing, and merge corners so close together that a rounded corner has no room.
- Keep the buildings within 150 m that do not stand on the track, each raised to its height from the map, or from its number of levels × 3.2 m, or else 7 m.
The result is one set of corner points, from which the road, both barriers, the racing line, the eight trigger-line checkpoints, the start grid and the boost pads are all placed. The authored circuit and the Capital Loop are the same game with the same rules on two different lists of corners.
OpenStreetMap data is © OpenStreetMap contributors, under the Open Database License. Keep that credit with any game you build from it.
Limits
Section titled “Limits”The add-on cannot yet fetch streets from OpenStreetMap, find a loop, or turn a curve into arcade.wall or path.points. To race your own streets, trace the loop in Blender and type its points (x is Blender’s X, z is minus Blender’s Y).
What you learned
Section titled “What you learned”- Segment walls are barriers along any line, and trigger lines are checkpoints at any angle.
- A loop of real streets is a list of corner points; one race runs on any such list.
Next: The arena moves to a first-person view with a weapon, bots and pickups.