PAL-System

Lindenmayer Systems allow one to specify a series of replacement rules for transforming strings.

If the text is used as a series of drawing commands, including saving and restoring the cursor’s position, the technique can generate fairly interesting foliage.

A scene graph offers the ability to save/restore by chaining segments together. I used Unity3D’s ScriptableObject to create “Languages” with replacement rules. I also created “Dictionaries” mapping symbols to segments made from GameObject prefabs. Finally, I explicitly marked a node in the segment as being the Leaf to which any successive stuff should be attached.

By allowing multiple overlapping rules, I let the system show a lot of variances. I added “Soar” mutilators to tweak the spawned things and show some more variance. By tweaking the “seed” value with the world position, I ended up with something that could use the same prefab to produce a whole forest of trees.

Overall I’m happy to move forward with this as a tool for filling in my own virtual forests. I think that it needs some work on the “usability” and could stand to take some lessons from Unity3D’s built-in tree system. Seems pretty good for a Saturday afternoon bit of messing about

comments powered by Disqus
Peter LaValle avatar
Peter LaValle
Any links probably include affiliate ids for that sweet sweet kickback - and some programs require that I tell you. The contents of this blog are likely unrelated - as they include games, paints, and build tools.