Procedural Cities, Procedural Roads, and L-Systems


here is a well-documented procedurally generated city by shamus young - using no art/model assets and completely built from scratch.

he writes:
"In a section of the Left 4 Dead commentary (near the very end of the initial No Mercy level) one of the developers draws attention to an apartment building in the distance. He explains that it’s a very simple building with little detail, but because it’s mostly a silhouette against a detailed sky, the eye accepts it and your mind fills in details that aren’t really there."

i agree with that - i think my goal in making a procedural river map would also be to determine which are the most easy "visual suggestions" to add to give it the general impression of being a full and detailed map... i'm not a mathematician so i don't quite know either. would a Vonoroi Diagram suffice to give the visual cues of it being a city? what is it that makes certain sketches look instinctively like maps?

lindermayer systems

another brilliant link i found was about generating procedural roads systems with L-systems by lintfordpickle who appears to be building a giant procedural world called Britonia. he makes reference to a siggraph paper which suggests the solution is in L-systems - Procedural Modeling of Cities (by Yoav Parish and Pascal Mueller).

from my sketch blog:
"L-systems or “Lindenmayer systems” are used to model the growth processes of plant development. The recursive nature of the L-system rules leads to self-similarity and so it resembles the growth of plants which grow while becoming more and more complex."

my first introduction to playing with "grammars" was with ContextFree, which is basically a simple program which will generate images from whatever grammar you provide it -- so it could be used to generate L-systems, which are just a specific sort of grammar which looks natural yet complex. so now, how will i do this... in Processing? oh good gods what am i doing let's try not to panic.



like lintfordpickle's procedural road generation, in order to make my procedural river map, i would need to figure out how to use my other "environment" inputs to direct the growth of the L-system patterns...

processing: very simple edge detection


LEFT: original PNG map of Geylang which i drew in illustrator.
RIGHT: the same image with simple edge detection in Processing.


in Processing its possible to examine an image and determine the brightness of a pixel or the pixels around it. above is a slightly modified sketch adapted from an example in Kostas Terzidis' Algorithms for Visual Design.

each pixel has a counter saying how many pixels around it are dark, and another counter inside checking to see how many consecutive pixels around it are dark. (the rule used above is that if a pixel has 2-6 dark pixels around it and more than 2 consecutive dark pixels, then its probably a border!).

i imagine that this means that, theorectically, if i fed in a seperate "topo" image (with topography features marked out in black) or if i had the river on a seperate layer, i could potentially have it detected in advance and then tell the program to avoid those "elevated" or "wet/water" areas?



See Also:
An Introduction to Lindenmayer Systems
Fractal Patterns, L-Systems and Semantics
Procedural City Generation
Procedural Modeling of Urban Environments

No Responses

Leave a Reply

Followers