
This is probably not the fastest rust implementation of a cellular automaton in rust.įor example, using Gosper's HashLife a classic game of life could be much faster.
All CellState components with materials will be colored according to their type. The CellState type now requires to build a CellStateMaterials. Enables CellStateMaterials resource to contain material handles. auto-coloring (Example or debug purpose):. plugin presets: GameOfLife3dPlugin, ImmigrationGame3dPlugin, RainbowGame3dPlugin, WireWorld3dPlugin, CyclicAutomaton3dPlugin. NeumannCell3d (cube cell with 6 neighbors). MooreCell3d (cube cell with 26 neighbors). plugin presets: GameOfLife2dPlugin, ImmigrationGame2dPlugin, RainbowGame2dPlugin, WireWorld2dPlugin, CyclicAutomaton2dPlugin. HexagonCell2d (hexagon cell with 6 neighbors). NeumannCell2d (square cell with 4 neighbors). MooreCell2d (square cell with 8 neighbors). 2D (enabled by default): Enables 2D types like:. No feature is required for the plugin to work and the main traits Cell and CellState are always available.īut you may enable the following features Inserting a SimulationBatch resource will allow parallel computation of cells with custom batch sizes. Inserting a SimulationPause resource will pause the simulation, removing it wil resume the it. the Rock Paper Scissor defines custom rules. The Classic examples showcase the provided implementations. You may implement your own cells (coordinate system) and states (rules) as you want, the cellular automaton system is completely dynamic and generic.įor more information you may look at some examples: The lib provides some implementations like MooreCell2d or MooreCell3d for cells and Conwa圜ellState, WireWorldCellState, etc for states. Then you may use bevy as usual and add impl Cell and impl CellState components to the entities.
You may add as many generic CellularAutomatonPlugin as wished, the lib provides some implementations like:
S -> Any type implementing CellState, defining the simulation rules.C -> Any type implementing Cell, defining the coordinate system.To follow the main branch of bevy bevy_lifeĪdd a CellularAutomatonPlugin to your bevy app:Ī CellularAutomatonPlugin has two generic types: The main branch follows the released version of bevy but I provide the bevy-main branch Wireworld implementation (see this lib's implementation).Bevy_life is a generic plugin for cellular automaton.įrom the classic 2D Conway's game of life to WireWorld and 3D rules, the plugin is completely generic and dynamic.