Welcome to our game of life!
Interface:
- Start/Pause: pretty self explanatory, allows to start or pause the game.
- Toggle click: this buttons allows the user to cycle through the differents types of cells and agents. The user can then manually place the different cells or agents on the grid. A simple click on a already placed cell would remove it.
- Load world: allows to load a new world by selecting a file (CSV), for any type of cell.
- Save world: allows to save the current world played with in a CSV file to be able to reuse later.
- Load rule: allows to load the desired rules you want to play with, by selecting a CSV file. The current survival and birth rules are displayed below the buttons like so [2,3]S meaning that if a living cell has 2 or 3 living neighbors, it shall survive. For the [3]B, it means that if a dead cell has 3 living neighbors, it shall come to life. This display can be observed for all rules appliable.
- Load agents: allows to load the predefined agents into the grid by selecting the desired CSV file. The file named sheeps^0wolf.csv contains the wolf and the sheep agents.
- Save agents: allows to save the loaded and manually added agents into a new CSV file, saving their coordinates to reuse when called.
- I have the high ground: allows the player to switch the game play between the classical Conway's game of life and the high grounds variant. The current game mode is displayed below the buttons as 'Conway has the High Grounds' if the rules are Conway's, and as 'I have the High Grounds' if the battle between General Kenobi and Anakin is on.
- Random field: generates a field with a random amount of cells depending on the rules selected. The density of that generation can be adjusted by the slider below.
The differents ways of playing:
- Classic Conway's Game of Life
- Any cell with 2 or 3 neighbors alive survives.
- Any dead cell with exactly 3 alive neighbors rises to life.
- All the others cells shall die in the next generation, and all of the other dead cells shall remain dead.
- General Kenobi VS Anakin: The remake
- General K is represented by blue cells, Anakin, by red ones.
- We start by counting the numbers of enemies above one cell, and the friends next to it (note that the cell in itself is considered as a friend (so number of friends is always at least 1)). If the number of enemies is equal or greater than the number of friends, then the cell shall die.
- When the battle is a bit more calm, one cell can birth an ally by looking around at the difference in numbers in friends or enemy. If there's a numerical difference of 2 or more cells between ennemies and friends, then a cell can be birthed.
Agents:
Agents are operating independantly of the cells' interaction, whatever rules are implemented. They can interact with the other agents and the cell itself. We implemented 2 types of agents, sheeps, and wolves. Both need to eat to survive, and can reproduce.
We defined their behavior as:
- They both move randomly
- Sheep agents eat the cells to reduce their hunger level.
- Wolf agents eat the sheeps to reduce their hunger level.
- They both can reproduce with a chance of 10% when 2 of the same agent meet.