Generating Cities

I’m trying to make a system to generate a city with streets. The issue is, I have no idea how to approach it. I can’t find anything describing my exact issue, so I’d really like if someone could give me an explanation or some sort of idea on how to approach this.

Start small. Don’t try to generate a full city at once. You can begin with a simple grid system.

Make a base module that places roads on a grid using parts or models, then use rules to decide where buildings go (like only next to roads). You can use 2D arrays or even a table of tile types (road, building, empty, etc.).

Once that works, you can expand with randomness, zoning (residential, industrial), or even weighted placement to make it feel more natural.

The grid logic is the core of it and where I think you should start.

Didn’t see this reply, sorry for my own late reply. I already have a grid, and it can be addressed by column, row, or height., and ive managed to make it generate a floor with randomized tiles. Just dont know how to do the logic for streets :person_shrugging:

Off the top of my head, I would probably approach this problem using Wave Function Collapse.

This is designed for a different grid method than columns and rows, it uses neighbour expansion.

Ok so I have tried this before and I did it like this:
You have 3 different tiles:

  • Fourway
  • Street
  • Building

You should start with a fourway so it can generate a road on each side, then on each side of the road a building isplaced and infront of the road another is placed.
Now you can add a chance for a new fourway to generate infront of a road (I recommend using a ser distance so 2 fourways dont generate next to each other and cause streets next to eachother)

Red: Fourway
Black: Street
White: Building
(sorry that i cant draw but this is what i got)

This is the basic and if you want it to actually look good you need a formula that i havent figured out.

And if you like i can even send some parts of the script.