Floralin
About

About the project

Hello! When I was early in my career I dreamt of being a game developer. It was not my thing. I'm much better at developing useful software and, for example, the tooling around video games. So here we are.

I've always admired procedural generation in games. I find it beautiful. And I've had many ideas for different tools that utilize procedural generation (terrain generation, level generation, music, etc.). But one thing that I found especially interesting was plant generation.

Back in university I did my Bachelor's thesis on procedural generation in games (including plants) and later I did a deeper dive into plant generation on a university course. I studied Lindenmayer systems and found them fascinating.

A Lindenmayer system, or L-system, is a type of formal grammar that consists of some axiom string, like F, and some rewrite rules for different characters like F -> F[+F]F[-F]F. The string is then iterated such that with each iteration a character is replaced with a new string, based on the rewrite rules. The end result is a string that grows in size and usually has repeating structures, like branches on a tree.

If we take a string and assign drawing rules for it, we can use L-systems to draw images, like below:

axiom   F
rule    F -> F[+F]F[-F]F
angle   25°

n = 0   F
n = 1   F[+F]F[-F]F
n = 2   F[+F]F[-F]F[+F[+F]F[-F]F]F[+F]F[-F]F[-F[+F]F[-F]F]F[+F]F[-F]F

drawing rules
F   draw a line forward
+   turn clockwise by the angle
-   turn counter-clockwise by the angle
[   remember the position and heading
]   return to them
The same system after four steps (n = 4), drawn with the rules above. This is the weed from The Algorithmic Beauty of Plants.

We can then go on and extend this system to three dimensions and add randomness to it to generate countless different variants of the same "species" using seeds. And voilà, we have a procedural plant generator.

axiom   F
rules   p = 0.02   F -> F[+F]F[-F]F
        p = 0.03   F -> F[+F]F
        p = 0.08   F -> FF[-F]F
        p = 0.31   F -> F[-F]F[+F]F
        p = 0.25   F -> F[+F]F[+F]F
        p = 0.31   F -> F[-F]F[-F]F
Three plants drawn from the same stochastic L-system, each branching differently
The same system with six rules for F, each picked by its probability: three plants at n = 4, from my course paper.

I thought it was incredible how such a simple concept can be used to generate shapes that actually resemble plants. They can be used to create photorealistic ones as well, but for now I'll stick with the low-poly style that I think looks very pretty.

My university project turned out fine. It was what you'd expect from a young coder with a limited amount of time. But I knew I could do better.

Five low-poly trees with dark trunks and flat green canopies, generated in Unity
Trees from the university project's generator in Unity: a recursive L-system, about 25 minutes of design, and a bug that put the green on the trunks now and then.
Four low-poly palm trees with segmented trunks and spiky green crowns, generated in Unity
Palm trees from the same generator: a trunk of parts that differ in thickness, and leaves drawn in random directions.

Then, a lot of time went on. I kept thinking about it but I had work and other projects. And I knew that if I ever wanted to polish it or even publish something, it would require a lot of work.

Fast forward to today: I had free time and energy. And I thought maybe it's time to give this a new shot. Floralin expands on what I experimented with earlier in my thesis and course project, but it's polished and much more versatile. Shapes are drawn more reliably, colours can be utilized better and the end results are professional-looking. It's a fast and versatile system that can create good enough assets for real games. They're low-poly, truly low-poly, with very few vertices per model and extremely simple looks, but I think the end results are very nice.

A low-poly riverside meadow with sunflowers, daisies, bluebells and cabbages by a blue river, with tall trees on a green hill behind
Floralin today: the riverside scene from Floralin Meadow in Unity, with its wildflowers and bonus trees.
A close view across the same meadow: orange seed spikes, white flower clusters and grass tufts casting soft shadows, with the river behind
The same scene from down among the plants.

A small surprise

If you've read this far, then I have a small surprise for you. Here are some freebies for you: free to use, however you like, yours forever. They don't have the live generation runtime but they should give you an idea what these packs can do.