You are browsing as a guest. Sign up (or log in) to start making projects!

Cellular Automa in Pygame

  • 13 Devlogs
  • 19 Total hours

A life like cellular automa simulator made using pygame.

Ship #1 Pending review

Life Like Cellular Automata

This project is a cellular automata simulator where you can simulate cellular automata with different rulesets and draw your own creations.

What is Life-Like Cellular Automata

Life-Like Cellular Automata is a discrete grid based system which consists of cells that can either be dead or alive and change state depending on the amount of live neighbours they have. Conway’s game of life is the most famous one of these, but is only 1 subset of a larger set of life-like cellular automata.

In Conways game of life, each cell can either be one of 2 states, dead or alive. Its’s updating ruleset is:

A node is ‘born’ if it has 3 neighbours, changing state from dead to alive
A node survives if it is alive and has either 2 or 3 neighbours, else it reverts back to a dead state
This ruleset can be written in the form of B3/S23 and is just one of many other rules that can exist in life-like Cellular Automata.

Features

In this simulator you can play around with any ruleset you please, with 3 presets included to help you navigate the endless possibilities.

Rules

  • Press the stop button to be able to edit the rules or draw
  • Draw by clicking the draw button and using LMB to make a cell alive and RMB to remove a cell.
  • Tap restart to fill the grid with random noise
  • Click the checkboxes to control how many neighbours a cell needs to survive or revive.

My journey

I am proud of making this simulation and learning about cellular automata. While it lacks practical applications, it is fascinating to learn about the emergent complexity arising from these simple rules, and I hope my learning with CA is not over. I hope this will inspire you to learn more about CA too!

Enjoy!

  • 13 devlogs
  • 19h
Try project → See source code →
Open comments for this post

1h 29m 49s logged

Life Like Cellular Automata

Cellular Automata is a discrete grid based system which consists of cells that update themselves following a certain ruleset over discrete time chunks called generations. Conway’s game of life is the most famous one of these, but is only 1 subset of a larger set of life-like cellular automata.

In Conways game of life, each cell can either be one of 2 states, dead or alive. Its’s updating ruleset is:

  • A node is ‘born’ if it has 3 neighbours, changing state from dead to alive
  • A node survives if it is alive and has either 2 or 3 neighbours, else it reverts back to a dead state

This ruleset can be written in the form of B3/S23 and is just one of many other rules that can exist in life-like Cellular Automata.

In this update, I have added boxes that you can turn on or off to customise the cellular automa to any rule you want.
My next goals are to:

  • Make the grid editable so you can create your own systems
  • Make a rewind button so you can see how different structures are formed
  • Create a slider to control simulation speed
0
0
2
Open comments for this post

31m 7s logged

Added a Mouse scroll to make the zoom mechanic more intuitave - and its much less laggy than a slider. Programming a scroll wheel was both easier and harder than I expected, but I have now added a new tool to my pygame toolkit.

0
0
3

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…