https://github.com/yuzhoumo/simulake
A cellular automata physics sandbox
https://github.com/yuzhoumo/simulake
cellular-automata cpp opengl sandbox
Last synced: 2 months ago
JSON representation
A cellular automata physics sandbox
- Host: GitHub
- URL: https://github.com/yuzhoumo/simulake
- Owner: yuzhoumo
- License: gpl-3.0
- Created: 2023-05-08T08:43:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-12T23:07:35.000Z (over 2 years ago)
- Last Synced: 2025-08-21T21:18:17.396Z (11 months ago)
- Topics: cellular-automata, cpp, opengl, sandbox
- Language: C
- Homepage: http://simulake.joemo.dev/
- Size: 99 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simulake
A cellular automata physics simulator.

## Cloning
External dependencies are included as git submodules in `lib`. Clone source
files and dependencies using:
```
git clone git@github.com:patilatharva/simulake.git --recursive
```
## Building with CMake
```
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
For debug build, use the `-DCMAKE_BUILD_TYPE=Debug` flag.
## Usage
```
./simulake [OPTION...]
-x, --width arg grid width in cells (default: 400)
-y, --height arg grid height in cells (default: 200)
-c, --cellsize arg cell size in pixels (default: 4)
-g, --gpu enable GPU acceleration
-l, --load arg load scene from disk
-h, --help print help
```
| Command | Key |
| -------------------------- | -------------- |
| Exit the program | `ESC` |
| Select AIR cell type | `0` |
| Select SMOKE cell type | `1` |
| Select FIRE cell type | `2` |
| Select WATER cell type | `3` |
| Select OIL cell type | `4` |
| Select SAND cell type | `5` |
| Select JET_FUEL cell type | `6` |
| Select STONE cell type | `7` |
| Print app state to console | `P` |
| Save grid to disk | `S` |
| Enter edit mode (pause) | `SPACEBAR` |
| Change "brush" size | (Scroll wheel) |
## Dependencies
- [glfw](https://github.com/glfw/glfw)
- [glad](https://github.com/Dav1dde/glad)
- [glm](https://github.com/g-truc/glm)
- [cxxopts](https://github.com/jarro2783/cxxopts)
- [threadpool](https://github.com/bshoshany/thread-pool)
- [cmake](http://www.cmake.org/)
## Resources
- [Noita: a Game Based on Falling Sand Simulation](https://80.lv/articles/noita-a-game-based-on-falling-sand-simulation/)
- [Simple Fluid Simulation With Cellular Automata](https://w-shadow.com/blog/2009/09/01/simple-fluid-simulation/)
- [Cellular Automata for Physical Modelling](https://tomforsyth1000.github.io/papers/cellular_automata_for_physical_modelling.html)