Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

WebGL Cellular Automata Simulator! Help Me Find Interesting Rules!

A topic by Benjamin Mastripolito created Jul 30, 2020 Views: 761 Replies: 2
Viewing posts 1 to 2
(1 edit) (+6)

Hi all! I've made a neat little cellular automata simulator that runs in the browser. If you don't know what "cellular automata" means, you might still recognize this:

Conway's Game of Life

Conway's Game of Life


That's a cellular automaton! Simply put, it's a space filled with cells, which have states, that are all governed by the same rule. In my simulator, you can explore these rules by creating random ones, mutating preset rules, or even making up your own from scratch! I've already found about a dozen interesting rules, but I would love some help finding more! There are exactly 262,144 possible rules, so there's quite a lot to investigate. Make sure to copy the rule number in the bottom-left corner of the screen if you find something interesting!

One of many "generator"-type rules


You can play with it here.  It runs nice and fast, as the entire simulation code is contained within a WebGL fragment shader. The rules (of which Game of Life is a member) are specified by a string of bits that is passed to the shader as a texture. A double framebuffer is also used to allow the simulation to advance in time. This allows arbitrary rules to be specified at runtime.

A more random-looking generator


If you want a more in-depth explanation of the rule format and how it all works, I've written a blog post about it here.

(+1)

Your program seems to support only GoL-like rules?

Yes, it currently only supports a restricted ruleset that includes GoL. This ruleset being, specifically, 2-state totalistic automata using the Moore neighborhood. I am planning on adding the capability for multi-state totalistic, and eventually, non-totalistic rules. The rule representation does get complicated, though, so it'll take some time (keep in mind I have to represent the rule in a way that can be passed as a texture to a GLSL frag shader).

You can read more about the ruleset in my blog post. You can also follow this project to get a notification when it is updated, if you like. :)