About the Project

The idea for this game came from my curiosity about how simple forms of artificial intelligence can evolve and learn without direct human control. I was inspired by the concept of natural selection: only the fittest strategies survive and get passed on to the next generation.

In this game, the AI controls agents that must overcome obstacles. At first, their behavior is random, but through evolutionary algorithms and neural networks, they gradually improve. The process works like this:

  1. Agents play the game and try to survive.
  2. The best performers are selected.
  3. Their "genes" (neural network weights) are combined and mutated.
  4. A new generation is created, often stronger than the last.

The learning process can be expressed with a simple formula of fitness selection:

[ P(i) = \frac{f(i)}{\sum_j f(j)} ]

where ( f(i) ) is the fitness score of agent ( i ), and ( P(i) ) is the probability of it being chosen for reproduction.

How we built it

We built the project in Python using Pygame for visualization, NumPy for neural network calculations, and custom evolutionary logic. The neural networks determine the agents’ decisions, and the evolutionary algorithm selects the best-performing ones for reproduction and mutation.

Challenges

  • At first, most agents failed immediately, and it was hard to balance the mutation rate so that learning was possible but not chaotic.
  • Debugging the neural network connections and making sure weights were updated correctly was also a challenge.

Accomplishments that we're proud of

  • Built a working demo of neuroevolution from scratch.
  • Created a game where agents actually learn to survive and improve over generations.
  • Visualized AI learning in a fun and interactive way.

What we learned

  • How evolutionary algorithms simulate natural selection.
  • How neural networks can adapt even when they start with random behavior.
  • The importance of fine-tuning parameters for meaningful results.

Why it matters

This project shows in a very visual way how intelligence can emerge from simple rules. Just like in biology, small improvements accumulate over generations, leading to complex and adaptive behavior. It’s not only fun to watch, but also a powerful learning tool for anyone curious about AI and evolution.

What's next for Rivo?

We want to improve the visualization to make the learning process clearer, experiment with different neural network architectures, and possibly add user interaction so players can “guide evolution” by adjusting parameters or setting new challenges. Another exciting direction is to use Rivo as a sandbox for testing different AI learning strategies - from reinforcement learning to hybrid approaches that could even complement neuron-controlled environments like CL1 Cloud.

Built With

  • custom-neural-network
  • genetic-algorithm
  • local-environment-(windows/linux/mac)
  • numpy
  • pygame
  • python
Share this project:

Updates