Blob
C++ Genetic learning toy made in highschool
C++SFMLAI

Blob is my first attempt at machine learning. After graduating high school, I had an extra-long holiday during which I became interested in neural networks. I decided to try to make a genetic learning program in C++ as genetic learning seemed to be the only learning algorithm that didn't require a lot of math. The rendering is done with SFML 2.0. The neural network and genetic learning code are made from scratch.

The goal of Blob is to find and consume green circles which represent food and avoid red circles. The inputs it receives are the color sensors around its body. Each sensor is connected to 3 nodes for an accurate representation of the RGB values. Learning occurs through testing different individuals and choosing the best ones and mutating them. There is no crossover between different individuals.

Here is a result of learning for a short while. The agent can move towards the food with its sensors. Sometimes it still has issues with certain angles.

Given more time, the blob learns to move towards the food very accurately.