Devlog – Cellular Automata

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Simulating the Universe

Cellular Automata could provide interesting results for the simulation of video game worlds.

Systems using this model are described by a regular grid of cells with a numerical state. During the simulation each cell decides its next state by applying a rule function to the cells next to it.

An example of such a system is Conway’s Game of Life. This famous Cellular Automaton shows how incredible complexity can arise from a system with simple rules.

All of the cells change their state at the same time using the data from the last state. This is interesting because it means Cellular Automata could benefit from parallel processing from multi-core CPUs, GPUs and perhaps even Quantum Computing.

Besides simulating the universe Cellular Automata can be used to make psychedelic ‘living paintings’:

Creating my own CA with Python

I have made some progress in creating my own Cellular Automata using Python:

Game Of Life - Python

Conway’s game of life running in Python. Rendered using Pygame.

The first iteration can run a 100×100 simulation at around 13 frames per second. Python’s lists were used for the data structure so the performance is not great.

Now that I have the basic structure of the program and benchmarking system I am working on making a faster version using the NumPy library. It provides access to fast arrays implemented in C so it should be possible to make the simulation much faster.

Unfortunately the process of speeding up the program is more involved than putting ‘import numpy’ at the top of the file. This is my first time trying to use NumPy Arrays and it is an interesting learning process!