World and levels › Water and roads
Roads and trails
Know first: Landscape: terrain from a heightmap, A world you believe in: where people live and where the roads go
A real road is a tug-of-war between two wishes: where we need to go and what the land allows. This lesson starts with what grade in percent means and how much of it a car, a cart and a walker can take. It shows why a road follows the contour lines and the valleys, why switchbacks exist, how a road is cut into a hillside and where it crosses a river. Then it turns to what roads are made of in a game: a spline that presses the ground down, a mesh along the spline, decals and ground paint. Last, it shows how all of this works in Unreal.
Why this matters
A typical first road in a game is drawn with a ruler: one point at the village, a second at the pass, a strip of dirt between them. From far away it looks like a road. Up close you see three problems.
- It lies like a taut rope. Over a hollow it hangs like a bridge with nothing under it, and a bump pokes straight through it.
- You cannot drive it. The straight line runs up a 30% hillside, and a car on it spins its wheels or rolls backward.
- It does not look like a road. An even strip of one color, edges as sharp as if cut with a knife, untouched grass all around.
The problem is not the tool. Nobody lays a real road with a ruler, because the land allows a road only so much steepness. So a road winds across a slope, dips into valleys, follows rivers and crosses a mountain range at its lowest point. Your eye has seen such roads all its life and spots the fake in a straight line at once.
One image runs through this lesson: the ramp at a building entrance. Suppose you know the height of the step. A wheelchair can get up only if the ramp is no steeper than a set slope, so the ramp has to be long enough. If it does not fit along the wall, it is folded into a zigzag with level landings at the turns. Across its width, a ramp is always level. A mountain road works the same way: length traded for steepness, a zigzag, level landings at the turns, a level roadway across. There is one difference to keep in mind. A ramp is built on flat ground, but a road is laid on ground that already exists, and that ground decides where the road can go.