Skip to content

Road Generators

adhocmaster edited this page May 12, 2021 · 26 revisions

WFC-based generators

Steps

  1. Create some intersections
  2. Convert intersection to Direction Intersections by identifying incident roads in direction quadrants (top is North, left is West, bot is South, right is East)
  3. Create a grid and cells of it.
  4. Apply WFC to fill cells with Direction Intersections
  5. Get Direction Intersection positions based on the cell placement.
  6. Adjust the original intersections' positions based on their direction counterparts' positions.
  7. Connect incident roads based on their placement on the direction quadrant

Direction Intersection:

A direction intersection is defined by four direction quadrants (top is North, left is West, bot is South, right is East). An incident road is placed in a direction quadrant based on the outgoing heading at the incident point. Headings are calculated counter-clockwise from East.

The conversion tool is based one invariant in the intersections: no two incident roads ever overlap.

The process is shown here:

Clone this wiki locally