Pico-8 Cellular Automata

Map generator

This is my pico-8 cellular automata demo for the Pico 1K Jam. It comes in at a whopping 811 bytes. You can change the noise density and number of iterations with the gamepad.

The real fun starts when you jump into the code. I have left a init page on tab 1 with the variables that drive it. But you can get some awesome results from changing the variables in the algorithm itself. There is also a sprite mode but it must be activated from the code editor.  In the default mode (PSET) you can change the colors using TV1 and TV2 the tile value variables.

Activating sprite mode

1. On the Init tab(1) change MAPH and MAPW to 16 or 32 depending on your preference. While here change the TV1 to 1 and the TV2 to 2 if your map size is 16 or 3 if your map size is 32.

2. Now head to the draw functions on tab 4 comment out the PSET line: pset(j,i,tid_g[j][i]) and un-comment the SPR line spr(tid_g[j][i],j*4,i*4)

3. Enjoy sprite mode!

some of my favorite algorithm changes

1. In the CELLAUTO function on tab 2 near the bottom of the function at the two lines tid_g[j][k]=tv2 swap TV1 and TV2 it will make maze like structures in PSET mode.


2. In the CELLAUTO function at the line if tid_git[y][x] == tv1 then swap the X and the Y change TV1 to TV2 you will get a diagonal mirroring and inversion effect. It works best with pset mode.

Download

Download NowName your own price

Click download now to get access to the following files:

cellularautomata2.p8.png 6.4 kB
Cellular_Automata.zip 493 kB

Leave a comment

Log in with itch.io to leave a comment.