Growth & Natural Forms
L-systems, Phyllotaxis, and procedural plant generation
System Overview
L-systems (Lindenmayer systems) model biological growth through string rewriting. Starting with an axiom, rules recursively replace symbols to generate complex branching structures. Each iteration adds detail, creating fractal-like natural forms.
Phyllotaxis describes the spiral arrangement of leaves, seeds, or petals. The golden angle (137.5°) creates optimal packing, seen in sunflowers, pinecones, and many plants. This pattern emerges from simple mathematical rules.
Why Games Use This
- Procedural Plants: Generate infinite variety of trees, flowers, and vegetation
- Natural Aesthetics: Create organic, believable environments
- Memory Efficiency: Store rules, not full geometry
- Scalable Detail: Generate at different LODs by changing iterations
- Artistic Control: Tweak rules to create specific styles
Key Parameters
- Iterations: More iterations = more detail, but exponential growth
- Branch Angle: Controls spread of branches
- Branch Length: Size of each segment
- Phyllotaxis Angle: Spiral angle (137.5° is golden angle)
- Rules: Define how symbols transform
Failure Modes
- Too many iterations: Exponential string growth causes memory/performance issues
- Poor rule design: Rules that don't terminate create infinite loops
- Extreme angles: Very large angles create chaotic, unrealistic forms
- No termination: Missing base case in recursive rules
- Stack overflow: Deep nesting in bracket notation
Scaling Behavior
L-system string length grows exponentially with iterations. 5 iterations can produce strings with millions of characters. Limit iterations to 3-5 for real-time rendering. Use stochastic rules carefully as they prevent caching.
Phyllotaxis is O(n) for n points, making it very efficient. Can generate thousands of points in real-time.
Related Algorithms
- Stochastic L-systems: Random rule selection for variation
- Context-sensitive L-systems: Rules depend on neighbors
- Parametric L-systems: Rules with parameters for continuous variation
- Space Colonization: Growth based on attraction points
- Reaction-Diffusion: Chemical patterns for leaf venation
Free Tools & Libraries
- L-Py: Python L-system framework
- Structure Synth: 3D L-system generator
- Context Free: Grammar-based art tool
System-Thinking Prompts
- What happens at 10 iterations? How does string length explode?
- Where do L-systems break? Stack overflow, infinite rules?
- How could players exploit deterministic growth? Predictable patterns?
- Which parameter dominates? Iterations, angle, or length?
- What's the optimal phyllotaxis angle? Why 137.5°?
- How do stochastic rules affect determinism? Can we still cache?
- What's the minimum viable L-system? Simplest grammar?