Your idea just didn't work out as it was and I had to scrap it. It didn't feel "random" enough, it made some holes, you had to check afterwards if there were any useless parallel roads...
So, this morning started from scratch with the generation and I managed to do this:
Completly new approach.
Here's how it's done: You make you city chunk by chunk.
You start by making your first line by simply placing chunks of buildings of random length, and spacing them with a road each time.
3 buildings, then a road, then 2 buildings, then a road, then 1, road, 3, road, 2, road, etc...
After that, you define a set of rules. Here are mine:
- If below me there are two consecutive roads, this chunk will be a building
- If below me there are three consecutive building chunks, start a new road (this prevents making the buildings too large)
- If the chunk below is a road, choose between those two actions:
1) Make a turn (1/3 of the time)
2) Continue the road (2/3 of the time)
- If the chunk below is a building, this chunk will be a building
Then I stopped a little and continued. I added a new step: "make all the intersections and turns look nice"
It was pretty tough. I figured out that not every intersection had to have crosswalks but only those with 3+ openings. The others were technically just "road turns".
So, now that some of my intersections became "turns", some of them have to get little dashes of paint.
Well, that's a problem: how do you know where to start the dashes and where to end them ? You don't want to break the pattern of the road connecting to the turn. It's one dash every 4 blocks and not "one dash every 4 blocks and sometimes when there's a turn it's whatever you want"
I'll spare the explanation because it's not really fun, but it was a challenge to figure that out
Spoiler
Edited by Yarillo, 19 July 2015 - 05:02 PM.