Skip to content

A simulation of an Evolution Strategy (ES) applied to a population of agents that learn to survive in a Flappy Bird-like environment.

License

Notifications You must be signed in to change notification settings

BinAl-Sadiq/Evolution-Strategy-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Evolution-Strategy-Simulation

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!

How It Works?

The simulation models a biologically inspired learning process where no gradient-based training (like backpropagation) is used. Instead, it relies purely on evolutionary principles:

  1. Initialization: Create a population of agents, each with a neural network whose weights are randomly initialized.

  2. 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).

  3. Selection: After all agents die, the top 50% of the population (those with the highest fitness) are selected as parents.

  4. Reproduction and Mutation: The parents are copied and mutated slightly to form a new generation.

  5. Repeat: This process continues for multiple generations until the agents consistently perform well.

Screenshot 2025-11-12 143452

Simulator Features

  • 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.

Screenshot 2025-11-12 132313

About

A simulation of an Evolution Strategy (ES) applied to a population of agents that learn to survive in a Flappy Bird-like environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published