Cellspace: Cellular Automata Sandbox

Overall★★★★★★★★★★3.19
Fun★★★★★★★★★★2.79
Innovation★★★★★★★★★★4.38
Theme★★★★★★★★★★3.02
Graphics★★★★★★★★★★2.59
Humor★★★★★★★★★★2.23
Mood★★★★★★★★★★2.40
Most important things first: Select the level using the <<level and level>> buttons at the bottom. Press restart to start the level after you modify any rules. Some levels already have some rules predefined.

There is now a postcompo with a level editor in which you can create and share full games! Instructions below.

A cellular automata game where you can create your own rules. There are no win or lose conditions (yet) so it can be considered a toy rather than a game. The screen consists of a grid of tiles. The game scans the grid for any 3x3 tile patterns that you define, and wherever a pattern is found, it replaces the 3x3 tiles with a new 3x3 tile pattern.

At the right you find the rule definitions. For each rule, the two leftmost 3x3 grids are the patterns to scan for and the patterns to replace them with:

The rule above indicates that when an o is found with an empty space next to it, it places another o over the empty space. This will cause o cell to propagate to the right. So:

An empty cell means "Don't care", this tile is skipped.

The dash "-" means "empty space". In the scan pattern, this means the tile must be empty. In the replace pattern, it means the tile is cleared.

The other characters are defined according to this legend:

The first five are supposed to indicate different types of cells, # represents a wall, and : represents food.

In each rule, you can define a number of options:

- playerdir: indicates that the rule should trigger only when a direction key is pressed (W=up, S=down, A=left, D=right)

- priority: higher means the rule has higher priority

- probability: probability that the rule is triggered if applicable

- transform: indicates how the rule should be rotated or mirrored (rot4=rotate 90,180,270 degees, mirx,miry = mirror)

- conddir and outdir: this enables you to indicate a direction for each cell in the grid (L,R,U,D). Conddir indicates which direction the center cell should point in. Outdir indicates which directions should be assigned to each cell in the 3x3 grid. Cells that have a direction will also rotate their sprites to indicate the direction.

With some simple rules, you can define game-like behaviour. For example with a single rule you can move a cell around with the W,S,A,D keys:

Like the previous rule, we indicate than an "o" cell should propagate to the right. However, it also clears the cell in the previous position, indicate the cell should move rather than propagate. "playerdir" indicates this rule is triggered when the "D" key is pressed. Outdir indicates that the new "o" cell should be facing right. Finally there is a transform "rot4" defined, that rotates the rule in all directions, and automatically converts all directional conditions appropriately.

This rule engine is very suitable for Boulderdash style games. For example, a Boulderdash-style rolling boulder (featured in level 4) is defined by just 2 rules:

Postcompo: CellSpace IDE instructions

Press "Edit" to edit the level, "Run" to run the game if you changed the level or the rules. Games are saved in Cellspace format (a human readable text format). "Open Game URL" opens the game in a new tab, with the source embedded in the URL.

At the top you can select the sprite. Once you've selected a sprite, you can edit rules and win/lose conditions, as well as the level. The plain green square at the very left indicates "ignore", which can be used to ignore cell positions in a rule.

Limitations: Currently you can only edit only one level and you cannot yet change the tile set.

Postcompo: CellSpace IDE instructions

Press "Edit" to edit the level, "Run" to run the game if you changed the level or the rules. Games are saved in Cellspace format (a human readable text format). "Open Game URL" opens the game in a new tab, with the source embedded in the URL.

At the top you can select the sprite. Once you've selected a sprite, you can edit rules and win/lose conditions, as well as the level. The plain green square at the very left indicates "ignore", which can be used to ignore cell positions in a rule.

Limitations: Currently you can only edit only one level and you cannot yet change the tile set.

Example games

Platform game - you cannot jump, fall onto the monsters to kill them

Douse the Fires - click to remove walls

Boulderdash - get all the diamonds

Escape Room - push the keys to unlock the locks

Tanks - destroy the tanks with fire

Harvey Wallbangers - draw walls to make the wallbangers get the potions

Cell Pacman

Shooter - space to shoot

Comments22

scott.redrup11 Oct 2024, 20:20
This is such a cool idea, I loved learning about cellular automata! Unfortunately I just couldn't get anything to happen even after making a few rules :(
loveapplegamesauthor12 Oct 2024, 07:43
@scott-redrup it should be very easy to get something to move using the rules. Maybe you did not press the Restart button after your changes?
Nikolas van Rus
Nikolas van Rus12 Oct 2024, 08:12
A very interesting and unusual game, great idea!
Kuroshima
Kuroshima12 Oct 2024, 08:29
Very unusual game, level 6 is my favourite so far, but took me some time to understand the basics
Exa12 Oct 2024, 11:21
Wow it is so beautiful!!!Fantastic job!!
Itskdog
Itskdog12 Oct 2024, 14:29
Very challenging. I like all the combinations and the setting of rules. Took awhile to know what to do and there is probably a lot you can do with this.
Patomkin
Patomkin14 Oct 2024, 09:08
Not gonna lie, this is challenging, but this what makes it fun! Idea is quite innovative
Game-mon14 Oct 2024, 10:23
Nice, very nerdy, but very cool. Was looking through cellular automata recently when studying level generation techniques. More an interesting tool to simulate stuff than a game (not a bad thing!)
LDJam user 276593
LDJam user 27659314 Oct 2024, 12:12
This is awesome, easy 5 stars in innovation.

I've said last week in a blog comment here that I've been trying to gamify cellular automata for ages but can never come up with something that non-programmers would enjoy. I think this possibly falls into that criteria as well, but this is a good basis on which to build something fun.

A "simple" change that would make it more accessible could be rule definition templates you can apply that make various things happen without the player having to truly understand the ruleset.
ellaris
ellaris14 Oct 2024, 19:14
Interesting concept, but it seemed to behaved weirdly, like I set a rule, pres restart several times, and get different results. It would also be nice to have a more friendly user interface.
ratly14 Oct 2024, 20:16
Hi fellow cellular automata maker! This was pretty fun and difficult, and I can see how this could turn into a game with objectives. It's cool to see how many different types of games and behaviors can be simplified to cellular automata, and it would be a nice tool to teach programming in a fun way.
Wendel Scardua
Wendel Scardua18 Oct 2024, 17:42
Hi, I got curious when I saw a post on the feed and started playing this, but I think I found 2 bugs.

First: on Level 2 I'm not able to pick the "~" for the rules, which seems to be required for a "solution". Unless the idea is to do some workaround solution with the other characters, but then it's too tricky for a Level *2*.

Second: I tried playing Level 4, and apparently one of my rules moved X to the left, outside the grid, then the game stopped responding. I couldn't even press restart.
LDJam user 11093
LDJam user 1109319 Oct 2024, 08:37
Very difficult, took me a while to understand how the rules work.
It could have been much more appealing if the rules were more "graphical". I mean, if the menu on the right directly used images instead of o @ X ~ ...etc.
I think this could lead to a very interesting game with objectives.
loveapplegamesauthor19 Oct 2024, 09:05
@wendel-scardua thanks for your response! About your bug reports: the first is not a bug, "follow the trail" just means following the ":". As regards the second, this is a bounds checking bug, causing the engine to crash, which I fixed now.
Wendel Scardua
Wendel Scardua19 Oct 2024, 12:08
@loveapplegames oh, okay then - i thought "follow the trail" meant "change rules so the ~ follows the : towards the o instead of spreading everywhere" 😅
someone
someone20 Oct 2024, 16:17
Not quite sure what this is trying to be. Is it a game or not? There are levels that hint at objectives but nothing structured. It feels like you intended to make a game but made an editor instead.
It could have been a cool game of figuring out some rules within a limited set to solve a specific objective. The follow the trail one came the closest to this.

The post jam IDE is a really cool toy. Still quite rough but good fun to mess around in.
LDJam user 193022 Oct 2024, 17:59
Very cool entry! Setting up the rules took me some time to get used to, but then I had fun playing around in the different levels you included :)
TheLastSlowpoke23 Oct 2024, 19:09
Wow, such a cool engine. It would be amazing if there were some puzzle levels with clear win conditions that are detected by the game, and some constraints of what you could do. I'd love to melt my brain over that.
mrspeaker
mrspeaker24 Oct 2024, 21:24
I kicked myself for not thinking of doing something making this before! So simple, but really genius. I've played with cellular automata lots before, but never thought about expressing the rules as part of the UI. So cool! So much potential in your IDE: damn great idea!

Other games by @loveapplegames

Found a bug?
Tell us on Discord