Evolution Simulation

The Project

The project is a simulation showing Animals (the "A") moving around a procedurally generated world filled with water ("w") and plants ("p") and empty tiles ("0"). We assign a starting genome to the animals that includes the data; sight, size, lifespan, requirements for mitosis, how much food and water they lose per turn, their max food and water, and whether or not they are a predator. The animals need to consume the plants and water, otherwise they will die. Once they reach a certain threshold the animals are able to undergo mitosis and pass on their genome. The child then mutates the genome, increasing or decreasing randomly. Every turn there is a slight chance of getting cancer and the animal dies but if not the animal prioritises a resource they need, then look for it and move towards it and eating it if they reach it. If a big animal steps on to the same tile as a small animal the bigger of the two eats the other gaining some food and increasing their kill count. when an animal gets a kill count of 5 it becomes a predator, a trait that is pass on to its offspring, that gives more food when killing animals. the simulation runs for 1000 turns and every 100 turns it outputs the world. There are also some files that record different data throughout the simulation. Every 100 turns "current.txt" record the alive animals genomes. "previous.txt" records the genome of deceased animals when they die. "Details of Death.txt" records; what turn they died, what generation they were, how they died, age, if they were a predator, and kill count. Every 2 turns "demographicData.txt" records the number of alive animals. Link to project (Click "Fork & Run" in website): https://replit.com/@DanielHiggins5/Evolution-Simulator-Coolest-Project

Advanced
Art
Environment

Team Comments

We chose to make this project because...

We originally started making this programme for The Crest Award. After brainstorming, we thought evolution would link to biology very well as well as being a good way to challenge our skills in programming.

What we found difficult and how we worked it out

We struggled with generating the river for two weeks, and then ended up rebuilding the code of it from scratch after a while. Another struggle was learning how to use classes in python and we had to learn that. Giving each of the animals a turn very hard, however we got some guidance to overcome it.

Next time, we would...

In the future we would like to have this programme as a fun project on the side that we can do little bits at a time. Some the specific things we would like to add would be more advantages for herbivores, for more competition between Predator and Prey. As well as balancing the starting stats.

About the team

  • United Kingdom
  • Code Club

Team members

  • Daniel
  • Anton
  • Finlay
  • Connor