A beautiful implementation of Lenia, a continuous cellular automaton system, built with Godot 4.4 and C#. Experience the mesmerizing patterns of artificial life evolving in real-time.
- Real-time Lenia simulation with optimized parallel processing
- Configurable parameters: Growth function, kernel radius, delta time, and more
- Multiple color schemes: Heat, Grayscale, Rainbow, and Plasma visualizations
- Interactive tools: Paint and erase brushes with adjustable size and intensity
- Performance modes: Different grid sizes for optimal performance
- Modern UI design with consistent styling throughout
- Responsive layout that adapts to different screen sizes
- Real-time parameter adjustment with immediate visual feedback
- Pattern presets: Quick access to interesting starting configurations
- Performance monitoring: Live FPS display and optimization indicators
- Screenshot capture: Save canvas-only images with detailed metadata
- Gallery browser: Professional grid/list view with search and filtering
- Metadata tracking: Complete simulation state saved with each screenshot
- Export functionality: Batch export screenshots with summary reports
- Dynamic thumbnails: Responsive grid with size adjustment
- Godot 4.4+ with C# support
- .NET 8.0 SDK
-
Clone the repository:
git clone https://github.com/yourusername/Lenia.git cd Lenia -
Open the project in Godot:
- Launch Godot Engine
- Click "Import" and select the
project.godotfile - Build the C# project when prompted
-
Run the simulation:
- Press F5 or click the Play button
- Select the main scene (
lenia.tscn) if prompted
# Build the C# project
dotnet build
# Run with Godot (if Godot is in PATH)
godot --path . res://lenia.tscn- Play/Pause: Start or stop the simulation
- Step: Advance one frame when paused
- Reset: Reinitialize with the current pattern
- Speed Slider: Adjust simulation speed (0.1x to 3.0x)
- Paint Brush: Add life to the simulation (left-click)
- Erase Tool: Remove life from areas (right-click)
- Brush Size: Adjust tool radius
- Intensity: Control paint/erase strength
- Screenshot: Capture current simulation state
- Gallery: Browse saved screenshots with metadata
- Search: Filter screenshots by date/time
- Export: Save collections to external directories
- Growth Mean: Center of the growth function
- Growth Sigma: Width of the growth function
- Kernel Radius: Neighborhood influence radius
- Delta Time: Simulation step size
- Grid Size: Canvas resolution (64x64 to 512x512)
Lenia/
├── Scripts/ # C# source files
│ ├── LeniaSimulation.cs # Core simulation engine
│ ├── LeniaMainUI.cs # Main UI controller
│ ├── HeaderBar.cs # Top toolbar
│ ├── Gallery.cs # Screenshot gallery
│ ├── ColorMapper.cs # Visualization engine
│ └── ...
├── lenia.tscn # Main scene
├── gallery.tscn # Gallery scene
├── menu.tscn # Menu scene
├── project.godot # Godot project file
└── Lenia.csproj # C# project file
- Parallel processing using
Parallel.Forfor grid updates - Kernel caching with pre-computed offset arrays
- Efficient rendering with direct pixel buffer manipulation
- Memory management with object pooling for UI elements
- Modular design with separated concerns
- Signal-based communication between components
- Scene composition for UI flexibility
- Resource management for optimal memory usage
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit with descriptive messages
- Push to your fork and create a Pull Request
- Follow C# naming conventions
- Use meaningful variable and method names
- Add comments for complex algorithms
- Keep methods focused and concise
Lenia is a continuous cellular automaton discovered by Bert Wang-Chak Chan. Unlike Conway's Game of Life with discrete states, Lenia uses continuous values and smooth growth functions, creating organic, lifelike patterns.
- Continuous States: Cell values range from 0.0 to 1.0
- Growth Function: Gaussian-based function determining cell evolution
- Convolution Kernel: Defines neighborhood influence
- Temporal Dynamics: Continuous time evolution with delta steps
The core update rule:
A(t+dt) = A(t) + dt * G(K * A(t))
Where:
A(t)is the current stateKis the convolution kernelGis the growth functiondtis the time step
This project is licensed under the MIT License - see the LICENSE file for details.
- Bert Wang-Chak Chan for discovering Lenia
- Godot Engine for the amazing game engine
- The Lenia community for research and inspiration
| Main Interface | Gallery View | Pattern Examples |
|---|---|---|
![]() |
![]() |
![]() |


