Cellular Automata Rule Editor
A downloadable game for Windows
This project is an implementation for my diploma thesis about using cellular automata to simulate game worlds. It is inspired by games such as Noita, Terraria and Minecraft. The goal is to create a visual editor to simplify the creation of rules that govern the interactions of materials in the world.
I would appreciate it if you could take a few minutes of your time to play with the editors and try to create some rules. Mechanics in the games mentioned earlier include fluids, gases, spreading fire, electric circuits, etc. If you don't mind being quoted in my thesis, please leave a short comment - for example what you think about the practicality of the approaches. You can state your name, company, or remain anonymous, whatever you are comfortable with.
-------
The first implementation comes from an attempt to make a dynamic top-down game world. It has two layers that act similarly to a heightmap. The rules are hardcoded and only the world is editable. The complexity of making the rules work led me to the later implementations. I'm only including it as a curiosity as it is clear it isn't suitable for general use.
The first editor is for Block Cellular Automata. They use blocks of 2x2 cells (pixels) that shift by one cell diagonally each step. We define rules that match a specific 2x2 pattern of materials and change it into a new pattern.
The second editor uses Lattice Gas Cellular Automata. Here each cell has particles moving in from four directions and one stationary particle in the middle. In each step collisions between the particles are resolved and then the particles are moved between neighboring cells in their new direction.
You can define materials and groups in the first tab. Materials are the basic values in the world. Groups are sets of materials. Both materials and groups can be used to define rules. The rules are then compiled into rules that only use materials. Each group has four variants - in one compiled rule, each variant compiles into one material (different variants can end up as different materials in their group).
The second tab is the rule editor. The bottom half contains user-defined rules, rules compiled from the currently edited rule, and all compiled rules. The list on the left side is used to filter the rules (use SHIFT and CTRL to multiselect). The list on the right side is used for selecting materials/groups to paint (use LMB and RMB). In the middle there is the currently edited rule - the state before and after the rules is applied. Modify the rule by left/right-clicking the cells. By clicking cells with a group set, you can cycle through the variants. To the right, there are options to also compile symmetrical versions of the rule. While this tab is open, the bottom-right of the screen displays a rule that will be applied in the world where the mouse is pointing.
The third tab has a world generator and editor. The generator is there for testing the rules. The material list on the bottom filters the generated materials and also supports multiselect (selection order matters here). Colliders for rigid-body physics can be generated in Block CA, solid materials should be ticked in the material editor. You can use the world editor to paint materials and drop rigid-body objects in the world.
In the bottom-screen panel, you can control the simulation and save/load your rules. The world can be navigated with WASD, zoomed by mouse scroll, and the simulation can be stepped by pressing SPACE.
------
Here are videos of some random rules made in the editors (no sound):
Leave a comment
Log in with itch.io to leave a comment.