This Unity project is a simulation of an Evolution Strategy (ES) applied to a population of agents that learn to survive in a Flappy Bird-like environment.
Each agent is represented by a simple neural network that decides whether to move up or down to avoid obstacles. Over generations, the population evolves and the most successful agents reproduce and pass on their weights with slight mutations, leading to improved performance over time.
Simulation.Clip.mp4
For the simulator’s design, I mimicked Dani’s Fa**y Rocket game since it can be recreated in Unity with Post Processing Effects in just a few minutes and looks cool too!
The simulation models a biologically inspired learning process where no gradient-based training (like backpropagation) is used. Instead, it relies purely on evolutionary principles:
-
Initialization: Create a population of agents, each with a neural network whose weights are randomly initialized.
-
Evaluation: Each agent interacts with the environment. Its fitness score is determined by how long it survives (i.e., how far it progresses before hitting an obstacle).
-
Selection: After all agents die, the top 50% of the population (those with the highest fitness) are selected as parents.
-
Reproduction and Mutation: The parents are copied and mutated slightly to form a new generation.
-
Repeat: This process continues for multiple generations until the agents consistently perform well.
-
Adjustable Population Size: set the total number of agents per simulation.
-
Save & Load: store and reload simulations to continue or analyze previous runs.
-
Network Visualization: right-click an agent to view its neural network structure in real time.

