{"id":28446478,"url":"https://github.com/phmatray/lenia-godot","last_synced_at":"2025-06-30T01:31:56.491Z","repository":{"id":296193847,"uuid":"992570217","full_name":"phmatray/lenia-godot","owner":"phmatray","description":"A beautiful implementation of Lenia, a continuous cellular automaton system, built with Godot 4.","archived":false,"fork":false,"pushed_at":"2025-05-29T16:09:41.000Z","size":3986,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-06T10:46:45.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phmatray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-29T11:18:22.000Z","updated_at":"2025-05-29T16:09:33.000Z","dependencies_parsed_at":"2025-05-29T13:07:11.767Z","dependency_job_id":null,"html_url":"https://github.com/phmatray/lenia-godot","commit_stats":null,"previous_names":["phmatray/lenia-godot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phmatray/lenia-godot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2Flenia-godot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2Flenia-godot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2Flenia-godot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2Flenia-godot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phmatray","download_url":"https://codeload.github.com/phmatray/lenia-godot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phmatray%2Flenia-godot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262693210,"owners_count":23349693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T10:41:39.834Z","updated_at":"2025-06-30T01:31:56.478Z","avatar_url":"https://github.com/phmatray.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lenia - Continuous Cellular Automaton\n\nA 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.\n\n![Lenia Screenshot](docs/main-ui.png)\n\n## Features\n\n### Core Simulation\n- **Real-time Lenia simulation** with optimized parallel processing\n- **Configurable parameters**: Growth function, kernel radius, delta time, and more\n- **Multiple color schemes**: Heat, Grayscale, Rainbow, and Plasma visualizations\n- **Interactive tools**: Paint and erase brushes with adjustable size and intensity\n- **Performance modes**: Different grid sizes for optimal performance\n\n### User Interface\n- **Modern UI design** with consistent styling throughout\n- **Responsive layout** that adapts to different screen sizes\n- **Real-time parameter adjustment** with immediate visual feedback\n- **Pattern presets**: Quick access to interesting starting configurations\n- **Performance monitoring**: Live FPS display and optimization indicators\n\n### Gallery System\n- **Screenshot capture**: Save canvas-only images with detailed metadata\n- **Gallery browser**: Professional grid/list view with search and filtering\n- **Metadata tracking**: Complete simulation state saved with each screenshot\n- **Export functionality**: Batch export screenshots with summary reports\n- **Dynamic thumbnails**: Responsive grid with size adjustment\n\n## Getting Started\n\n### Prerequisites\n- [Godot 4.4+](https://godotengine.org/download) with C# support\n- [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)\n\n### Installation\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/Lenia.git\n   cd Lenia\n   ```\n\n2. Open the project in Godot:\n   - Launch Godot Engine\n   - Click \"Import\" and select the `project.godot` file\n   - Build the C# project when prompted\n\n3. Run the simulation:\n   - Press F5 or click the Play button\n   - Select the main scene (`lenia.tscn`) if prompted\n\n### Building from Command Line\n```bash\n# Build the C# project\ndotnet build\n\n# Run with Godot (if Godot is in PATH)\ngodot --path . res://lenia.tscn\n```\n\n## Usage\n\n### Basic Controls\n- **Play/Pause**: Start or stop the simulation\n- **Step**: Advance one frame when paused\n- **Reset**: Reinitialize with the current pattern\n- **Speed Slider**: Adjust simulation speed (0.1x to 3.0x)\n\n### Painting Tools\n- **Paint Brush**: Add life to the simulation (left-click)\n- **Erase Tool**: Remove life from areas (right-click)\n- **Brush Size**: Adjust tool radius\n- **Intensity**: Control paint/erase strength\n\n### Gallery Features\n- **Screenshot**: Capture current simulation state\n- **Gallery**: Browse saved screenshots with metadata\n- **Search**: Filter screenshots by date/time\n- **Export**: Save collections to external directories\n\n### Parameter Tuning\n- **Growth Mean**: Center of the growth function\n- **Growth Sigma**: Width of the growth function\n- **Kernel Radius**: Neighborhood influence radius\n- **Delta Time**: Simulation step size\n- **Grid Size**: Canvas resolution (64x64 to 512x512)\n\n## Project Structure\n\n```\nLenia/\n├── Scripts/                    # C# source files\n│   ├── LeniaSimulation.cs     # Core simulation engine\n│   ├── LeniaMainUI.cs         # Main UI controller\n│   ├── HeaderBar.cs           # Top toolbar\n│   ├── Gallery.cs             # Screenshot gallery\n│   ├── ColorMapper.cs         # Visualization engine\n│   └── ...\n├── lenia.tscn                 # Main scene\n├── gallery.tscn               # Gallery scene\n├── menu.tscn                  # Menu scene\n├── project.godot              # Godot project file\n└── Lenia.csproj              # C# project file\n```\n\n## Technical Details\n\n### Performance Optimizations\n- **Parallel processing** using `Parallel.For` for grid updates\n- **Kernel caching** with pre-computed offset arrays\n- **Efficient rendering** with direct pixel buffer manipulation\n- **Memory management** with object pooling for UI elements\n\n### Architecture\n- **Modular design** with separated concerns\n- **Signal-based communication** between components\n- **Scene composition** for UI flexibility\n- **Resource management** for optimal memory usage\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Development Setup\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Make your changes and test thoroughly\n4. Commit with descriptive messages\n5. Push to your fork and create a Pull Request\n\n### Code Style\n- Follow C# naming conventions\n- Use meaningful variable and method names\n- Add comments for complex algorithms\n- Keep methods focused and concise\n\n## Algorithm Background\n\nLenia 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.\n\n### Key Concepts\n- **Continuous States**: Cell values range from 0.0 to 1.0\n- **Growth Function**: Gaussian-based function determining cell evolution\n- **Convolution Kernel**: Defines neighborhood influence\n- **Temporal Dynamics**: Continuous time evolution with delta steps\n\n### Mathematical Foundation\nThe core update rule:\n```\nA(t+dt) = A(t) + dt * G(K * A(t))\n```\nWhere:\n- `A(t)` is the current state\n- `K` is the convolution kernel\n- `G` is the growth function\n- `dt` is the time step\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- **Bert Wang-Chak Chan** for discovering Lenia\n- **Godot Engine** for the amazing game engine\n- **The Lenia community** for research and inspiration\n\n## Screenshots\n\n| Main Interface | Gallery View | Pattern Examples |\n|---|---|---|\n| ![Main](docs/main-ui.png) | ![Gallery](docs/gallery.png) | ![Patterns](docs/patterns.png) |\n\n## Links\n\n- [Lenia Research Paper](https://arxiv.org/abs/1812.05433)\n- [Godot Engine](https://godotengine.org/)\n- [Original Lenia Implementation](https://github.com/Chakazul/Lenia)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphmatray%2Flenia-godot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphmatray%2Flenia-godot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphmatray%2Flenia-godot/lists"}