Skip to content

i-vs/GardenTrials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Garden Trials

An interactive visualization of John Conway’s cellular automaton Game of Life

Undecidable Problems, Patterns, and Life

Most computer science problems are like logical puzzles: they can be solved with practice and pattern recognition. Data structures and algorithms are patterns that can help us find different solutions for things that normally have predictable behavior. However, some problems are simply undecidable.

A great example of (generally) unpredictable patterns can be experimented in John Conway’s cellular automaton "Game of Life"; a “no-player, never-ending game.”, in the author's words.

The Game of Life was only one of Conway’s innumerable contributions to game theory and mathematics. This popular cellular automata simulation takes place on a 2-dimensional grid. Cells can either survive for generations or die, given the following rules:

  • If a live cell has less than two live neighbors, it dies of underpopulation.
  • If a live cell has more than three live neighbors, it dies of overpopulation.
  • If a live cell has exactly two or three live neighbors, it survives.
  • If a dead cell has three live neighbors, it will come to life.

For this project I implemented a "garden" of Life, as simple as it should be: a garden where the user can plant seeds (or cells) and bring plants and flowers to life. The plants can either survive through generations or die, according to the game's rules.

As a tribute to the author, every lone glider in the garden is considered an ant.

Features

  • Two-dimensional cellular automata viewer.

  • Interactive gameplay:

    • Possible to insert yellow yellow Cell seeds and create patterns while the game is paused, and red Cell seeds while the game is running to modify the garden state.

    • Pause, Play, and Exit options (buttons and shortcuts).

    • A Rules button with a brief explanation of the game's rules.

    • Save and Load options for user-created patterns.

    • Some common patterns to load from the gardenpatterns file (names are used within the game context).

  • Color-changing seeds according to the population growth:

    • red Cell for 2 neighbors and green Cell for 3 neighbors.

Technology Choices

  • Written and developed in C#, using Unity 2D (Engine and Script API)
  • UI Canvas system
  • Executable (.exe only)

Future improvements

  1. Population counter.
  2. Expand/unbound the grid area.
  3. Sliders to control the seeds' growth speed.
  4. Add information about the project and the game.

To install:

  • Download the files tagged #gardentrials on Releases (Windows 7 SP1+, 8, 10, 64-bit versions only; Full screen and Window versions included).
  • Or clone this repo and run with Unity's editor (created with Unity 2D Version 2020.3.15f2).

*Please note that this is a work in progress. My goal with this project was to learn and understand new concepts for study purposes and personal interest. Some of the features and algorithms I would like to implement (such as allowing patterns with quadractic growth to expand the grid dynamically) may require more than just a few weeks of study; I plan to use different platforms and technologies in the future.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages