Critters

The Critters are my own original take on a genetic algorithm, albeit without any use of machine learning. They were programmed using p5.js. The idea for them came about some time in 2018. I had just finished a prototype for “flowers” that could breed new flowers using the genetic make up of themself and nearby flowers. I immediately wanted to do more, and make more “alive” creatures that had to work for survival.

What you see below, the colorful squares, are the Critters. Each Critter’s size and color are a part of their “genome”, and their speed is directly related to their size. In order to “breed”, they must have so much “energy” in store. To get more energy, they must eat the circles, the Morsels. The Morsels contain an amount of energy related to their size. Likewise, their color is tied to the amount of energy they contain. Movement for the Critters requires an energy expenditure, so they must be able to get more Morsels in a short amount of time if they want to be able to procreate.

A year or so into the project, I learned that machine learning was a thing, and that there were already loads of projects attempting to accomplish the same task as me. Nonetheless, I kept on working on the project for some time. I call it complete now, as I’ve lost any tangible motivation to continue with it, and it technically does what I set out to accomplish. But, I am still proud of it. All of the algorithms for it are handwritten, unless stated otherwise in the comments. As primitive as they are, it was still many late nights of work to get them working.

Though I have no current motivations to work on machine learning or genetic algorithms, I do still keep up with some projects. Most notable amongst them being the Bibites.