Procedural City Street Generation Using L-Systems

After a long hiatus from game programming I’ve returned with some decent ideas (in my mind).

First of all, I’m trying to procedurally generate a city for my game. It will be a game feature, so the player can play in different worlds.
I think that the best approach would be to generate a 2D texture of the road map, and then populate it with buildings in the 3D game world (also procedurally generated), so I did some research and decided that L-Systems would be the way to go simply because that’s really the only thing I saw people using. After a few more days of research, I still don’t fully understand how I would put it into code.

From what I understand, you have a predefined string which is basically the generation rule for the system. You can go forward and draw a line, rotate, switch draw states, and use the | symbol to do something else I don’t really understand either. If anyone has any simple/beginner friendly street generation articles they know of, I’d appreciate it if they could share it as well as any advice!

Also, some time ago I saw a post from Riven (I believe?) of a city street generation exactly like what I’m going for. So if you’re reading this Riven, mind popping in and either sharing some code or advice?

Thanks!

L systems are a way to recursively turn a sequence of instructions, into another sequence of instructions.

This is a totally different thing than how to interprete these instructions.

Say you get these instructions: “FFLFRFLFRFF”, where F is: go forward, L is: turn left, R is: turn right.

Exercise 1: follow the instructions in the sequence - draw the path
Exercise 2: turn every “FL” sequence into “FFRLFRL”
Exercise 3: goto #1

Repeat this, and you’ll see the sequence (and therefore the drawing) getting more and more complex.

Having said that, my city generator did not use L systems.

Ah, so I just customize the instructions to my needs. Those two sentences made it click for me! Thanks.
Now that you say your generator did not use L systems, I’m curious what you did use? I’d like to look into many options.

More stuff here, even making the houses;

http://pcg.wikidot.com/pcg-algorithm:city-generation

Thanks for the links! However, I’ve looked at those already.
I’ve already started working on the L-system thing. It’s going okay I suppose.

Okay, after a bit of work I have a base for L-systems down. Just doing the Hello World kind of thing for L systems in this example:

Now on to the more advanced stuff.
Thanks Riven!