Cellular automata is in reference to a machine that loops through a grid and depending on a set of rules, adds the new grid that becomes the grid in the next generation. The most popular cellular automata is known as "Conway's game of life" made by mathematician John Horton Conway in 1970 made the most famous cellular automata in the world. His findings were published in an issue of a scientific American that was written by Martin Gardner. In the article Gardner states that if a cell is alive and his 2 to 3 neighbors it will stay alive, though if it has more it will become dead as if dying of overpopulation, and vise versa for the other direction as if dying of isolation. If the cell is dead then if it has exactly 3 neighbors it will become alive otherwise it will stay dead.
Now that we have the history out of the way, there are many ways that you can use this from terrain generation all the way to a screen savor.
I'll start with terrain, using the set of rules where n is the number of alive neighbors a cell has:
alive:
n = (4 or > 5)
dead:
n = ( > 4)
You can make a grid that looks smooth to the point it almost mimics perlin noise but, in order to make it sharper you can use the rule set:
n = ( > 3)
Then you will have a smooth, crisp grid of terrain that you can do anything with. (note: this effect works best on a resolution of 240 by 180 with 100 iterations then 5 iterations.)
Another thing that uses a cellular automata to achieve its final effect is a physics simulation. Believe it or not but the really basic 2d sand simulation that you see in some games is a cellular automata. Based on a few rules the sand is able to dynamically flow down a hill, though this does use more checks as the current next generation to make sure that another cell isn't occupying the cell that it wants to get to.
Population simulations are the other way that cellular automatons are great in programming. Using the explanation of overpopulation and isolation mentioned before and the fact the dead cells are basically areas with no population you could make a model that models any type of population with changing the kernel (the size and shape of the area that the cell checks) and the rule set.
Finally for all of my graphics programming friends with this you could make very cool looking moving by changing rules, the kernel, or even the amount of states that are on the screen so that there isn't just dead and alive cells.
And so this concludes my explanation of cellular automata's history and its implications in code. Thanks for reading.
I can't find anything about this stuff on youtube or close to anywhere else so here you go. Sorry that you have to read, maybe one day, It will change.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (1)
I can't find anything about this stuff on youtube or close to anywhere else so here you go. Sorry that you have to read, maybe one day, It will change.