Roads that know what they are
The first system worth showing off is how roads are put together. In Regions, a road is not a single object — it is a bundle of parallel zones, and every zone has a type that tells the simulation what it is for.
The current type list: drive lanes, bus lanes, tram tracks, bike lanes, parking strips, sidewalks, shoulders, medians, and a shared type for streets where everyone mixes. Each type carries a few properties:
- Drivability — whether traffic agents may enter it at all. A median is part of the road, but nothing should ever path across it.
- Lane tags — a bitmask that filters which agents may use a drivable lane. A bus lane is drivable, but only for agents carrying the bus tag. Same trick for trams and bikes.
- A default width — so drawing a road gives you sensible proportions out of the box.
The defaults we have landed on so far, for the types that have one:
| Zone type | Drivable | Default width |
|---|---|---|
| Bus lane | ✓ (bus tag) | 3.3 m |
| Bike lane | ✓ (bike tag) | 1.5 m |
| Parking | — | 2.4 m |
| Sidewalk | — | 2.0 m |
| Shoulder | — | 1.2 m |
| Median | — | 0.8 m |
Drive lanes, tram tracks, and shared streets take their width from the road that contains them.
Every type also gets its own debug color, so a road viewed in the editor reads like a transit map: blue for traffic, red for tram, green for bikes and sidewalks, grey for parking. It sounds like a small thing, but being able to see the lane structure at a glance has already caught more authoring mistakes than any validation code we have written.
Next up on the list: how the terrain material figures out what to paint under all of this without anyone hand-texturing a thing.