# Mapmaking Discussion & Philosophy (WIP/Critique) > Software Discussion >  I Found an L-System Generator!

## ravells

... but I don't know how to use it  :Frown: 

You can download the generator here: http://www.generation5.org/content/2002/lse.asp

L-System generators are often used to make procedural city streets. What I don't know is whether this generator (because I don't understand code or programming) can detect collisions, meaning I don't know whether you can tell the program to stop drawing a line if it hits another line or write the rules so it looks that way. If we can crack that, we can get a pretty decent city street generator going. Can anyone with programming skills come up with rules which look city street-ish?

Here is what I've got so far with messing about and having no idea what I'm doing in terms of L-system rules:

1. Make your L system road network using the generator (image1)
2. Import into photoshop and make the lines thicker (image 2)
3. convert to vector and using the big lazy city system, put in your city blocks. (image 3)

And there you have it: Lung City!

This doesn't look bad from a pretty crappy road system to begin with. If some kind programming guy can write a good street file we'll be in business!

Interesting thesis on procedural city generation here (as far as I can understand it) but this guy uses Voronoi rather than L-systems.

----------


## Fransie

The "Roleplaying City Map Generator" can also be used in conjunction with the Big Lazy City System. The website from the guy who created it has been down for some time, but you can still get it from some of the mirrors here.

Just plunk in some numbers, slide some sliders, and let it create a roadplan (preferably without any other crap like houses, trees etc.). Save this and trace it in Xtreme/Drawplus/Inkscape/Illustrator, or print it to PDF and import this into your drawing program. Then apply brush and clean up a bit.

I whipped this city up in under ten minutes. Don't ask me why a big river just springs from the middle of a town please...

----------


## ravells

That looks pretty cool. I'll download that city generator again and give it a try. In the end, I think nothing beats drawing your own roads (doesn't take too long) as you'll get them exactly where you want them, but it would be nice to have varying road patterns you can superimpose on bits as 'filler'.

----------


## Aenigma

Seems interesting.

----------


## Redrobes

Cool and good link - had a very brief scan through it.

I think usually L systems are state free so that they do not have the historical background about other branches in order to do the collision detection. Maybe some are state-ful so that they can.

Although its possible to come up with some cities and towns that have some elements of real towns from the use of L systems and voronoi patterns I strongly believe that aside from a few rare exceptions (and those being more modern anyway) that cities are more complex than can be generated from either of these two mechanisms. Trees are very close to L systems and large scale interstates are close to voronoi patterns but cities, esp old ones, have cul-de-sacs, dead ends, and any number of weird goings on that is not suitable for a one rule model.

If I were financially independent or retired I definitely love to have a go at getting together a model complex enough to build realistic towns and cities. I'm still glad your giving it a go tho just to see how far it can be taken.

----------


## waldronate

L-systems come in many forms including context sensitive (knows about nearby nodes), stochastic (random angles and/or length), and environmentally-aware (know about promoters / inhibiters in the environment). http://algorithmicbotany.org/ has lots of useful information on L-systems, mostly with an eye to generating plants but that are also generally applicable.

----------


## gilgamec

> http://algorithmicbotany.org/ has lots of useful information on L-systems, mostly with an eye to generating plants but that are also generally applicable.


 From that site you can also download a demo version (which expires at, I believe, the end of this year) of L-studio, a (almost exhaustively) fully-featured L-system development environment.  If you're going to experiment with L-systems, that's the software package I'd recommend.

----------


## nour

Hi guys 
I am working on an L-system generator as well, and found some code in TCL that could generate different sorts of trees
I am just wondering if it would be possible to make it build a road map network 

any body knows from where can I get help to this done ?

thank you 
nour

----------


## Redrobes

Not sure but since this thread has come up again, yesterday on the boing someone posted some pics of cracked glass panels that looked (to me) exactly like road systems in a dense city and as I looked at them I thought of this thread. So... if you can replicate this effect then you can get a road map network.

http://www.boingboing.net/2010/08/26...zing.html#more

Also, there was some thread about a free vector map of the world which would have lots of real roads in a network to use unless your specifically looking to generate them.

Oh... and welcome btw !

----------


## nour

thank you so much for quick reply  i will check that link 
Yes I need to generate them and I am interested in using L-system and maya

----------


## nour

I am working on simple city generator where I automatically generate 3D building from 2D floor plan ! but now I need to get a street netwrok done and I don't have much time  :Frown:

----------


## ravells

Maybe you can work on the source code of the L-system generator I posted to?

----------


## nour

Hi 
I have checked your l-system but It does not compile right in visual C++ E E ! I get some the error of missing header file 
fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
I don't have MFC and I think this is what causing me this error

----------


## Redrobes

What you need I believe is a Platform SDK from microsoft which I know (at least some of them) are free downloads.

http://en.wikipedia.org/wiki/Microsoft_Windows_SDK

That should include all the MFC and .NET stuff.

Another option (which I would not myself recommend but I say it anyway...) is that there are some GNU versions of it.

http://sourceforge.net/projects/ofc/

----------


## nour

Thank you I will check it out

----------


## monks

Would someone PLEASE write an L -System generator to generate watershed river/ridge networks..! It's the one tool that's missing that could provide a way of getting predictable flow and sensible flow patterns. There's no way we're EVER gonna get controlled terrain close to r-w terrain if we don't have something like this. The patterns of drainage are what makes a terrain look real. The more I do terrain modelling, the more I want to build via watersheds- at least at the design stage, then let procedural erosion take over. Building terrain with noise functions is pretty poo.

monks

----------


## waldronate

> Would someone PLEASE write an L -System generator to generate watershed river/ridge networks..! It's the one tool that's missing that could provide a way of getting predictable flow and sensible flow patterns. There's no way we're EVER gonna get controlled terrain close to r-w terrain if we don't have something like this. The patterns of drainage are what makes a terrain look real. The more I do terrain modelling, the more I want to build via watersheds- at least at the design stage, then let procedural erosion take over. Building terrain with noise functions is pretty poo.


I think that what you really want is for someone to develop a system that will add details to an existing skeletal river network rather than just generating an environmentally-aware stochastic L-system generator. A big problem with simple generators is that the configuration of river networks varies depending on the underlying geology; the river network for a nearly-flat plain is rather different than that descending from a folded mountain chain, for example. I have a suspicion that what you'd like is to be able to specify terrain domains and a basic drainage skeleton from which system would fill in the details. We all would like that, I suspect.




> Building terrain with noise functions is pretty poo.


Early papers that talk about terrain and noise functions are often titled things like "random fractal forgeries". Isotropic noise functions  (or even basic post-processed ones) are mostly lacking in the basic characteristics of actual terrain, which is the drainage network and its dual, the ridge network. These noise functions tend to have basins at every level, which very quickly get filled in as part of water flowing over the terrain. They're acceptable at first glance, but that's it.

----------


## sarahB

> thank you so much for quick reply  i will check that link 
> Yes I need to generate them and I am interested in using L-system and maya


 :Cool:  :Cool:  :Cool:  :Question: ? :Mad:  :Mad:  :Razz:  :Razz:

----------


## sarahB

Hi, i not speak well english,please i want the logiciel L-studio because i need it very queeqly please(I speak french)

----------


## ravells

Hi SarahB, I only found the link...I'm afraid. I hope that when you make an L-system generator which is really good, you will post your code here for all to use!

Welcome to the guild by the way.

----------


## Redrobes

The link again:  http://www.generation5.org/content/2002/data/lse.zip

----------

