Cellspace: Cellular Automata Sandbox by loveapplegames

[raw]
made by loveapplegames for Ludum Dare 56 (JAM)

Most important things first: Select the level using the <> 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:

cellspace-ruleui2-text.png

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:

cellspace-legend.png

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:

cellspace-rule-moveright.png

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:

cellspace-ruleui-boulder.png

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

Ratings

Overall 876th 3.19⭐ 23🧑‍⚖️
Fun 957th 2.795⭐ 24🧑‍⚖️
Innovation 11th 4.375⭐ 26🧑‍⚖️
Theme 925th 3.024⭐ 23🧑‍⚖️
Graphics 937th 2.587⭐ 25🧑‍⚖️
Humor 886th 2.235⭐ 19🧑‍⚖️
Mood 1038th 2.4⭐ 22🧑‍⚖️
Given 10🗳️ 13🗨️

Feedback

scott.redrup
11. Oct 2024 · 20:20 UTC
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 :(
🎤 loveapplegames
12. Oct 2024 · 07:43 UTC
@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
12. Oct 2024 · 08:12 UTC
A very interesting and unusual game, great idea!
Kuroshima
12. Oct 2024 · 08:29 UTC
Very unusual game, level 6 is my favourite so far, but took me some time to understand the basics
Marco Santos
12. Oct 2024 · 10:43 UTC
5 on innovation. well done
Exa
12. Oct 2024 · 11:21 UTC
Wow it is so beautiful!!!Fantastic job!!
Itskdog
12. Oct 2024 · 14:29 UTC
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
14. Oct 2024 · 09:08 UTC
Not gonna lie, this is challenging, but this what makes it fun! Idea is quite innovative
Game-mon
14. Oct 2024 · 10:23 UTC
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!)
lakdjs
14. Oct 2024 · 10:43 UTC
Fun!
LDJam user 276593
14. Oct 2024 · 12:12 UTC
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
14. Oct 2024 · 19:14 UTC
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.
ratly
14. Oct 2024 · 20:16 UTC
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
18. Oct 2024 · 17:42 UTC
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*.

![Captura de tela 2024-10-18 143901.png](///raw/bdb/1/z/68f41.png)

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
19. Oct 2024 · 08:37 UTC
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.
🎤 loveapplegames
19. Oct 2024 · 09:05 UTC
@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
19. Oct 2024 · 12:08 UTC
@loveapplegames oh, okay then - i thought "follow the trail" meant "change rules so the ~ follows the : towards the o instead of spreading everywhere" 😅
someone
20. Oct 2024 · 16:17 UTC
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 1930
22. Oct 2024 · 17:59 UTC
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 :)
TheLastSlowpoke
23. Oct 2024 · 19:09 UTC
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.
🎤 loveapplegames
24. Oct 2024 · 11:14 UTC
@thelastslowpoke Thanks for your feedback! Check out some games I made with the postcompo IDE:

https://ldjam.com/events/ludum-dare/56/cellspace-cellular-automata-sandbox/cellspace-ide-update-create-and-share-complete-games-using-cellular-automata
mrspeaker
24. Oct 2024 · 21:24 UTC
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!