Virtual Creatures / Evolving Creatures / Genetic Algorithm / Evolutionary Algorithm / Artificial Life
An example of an evolutionary algorithm. It consists of a population of segmented creatures that evolve to navigate around a bed of lava to reach their precious yellow blinking dot.
- The population consists of 200 segmented creatures.
- In this example, each creature has six segments.
- Each segment is separated by a joint.
- The endpoints consist of the following:
--- A creature base joint (the bigger blue circle).
--- A suction cup (the green circle that periodically illuminates).
The behavior of the creatures is as such:
- When the suction cup is inactive (dim green) each segment rotates clockwise around it's base joint (blue dot)
- When the suction cup is active (bright green) each segment is rotated in reverse order (still clockwise). This allows the creature to move a bit like an inchworm.
- Each segments have a variable length.
(in this example it's 15-25 pixels)
- Each segment has a starting position (0-359 degrees).
- Each segment has a variable rate of rotation.
- The end segment of each creature has a specific range in which the suction cup is active.
- Breeding occurs every 20,000 updates.
- The fittest creature gets to breed with the entire population.
- There's a 0.5% chance for each type of "genetics" will mutat during breeding.
- After breeding, all the creatures are reborn in the center of the screen.
- There's a yellow blinking dot on the screen. Whichever creature is the closest at breeding time is the fittest.
- There's a red box on the screen between the spawn area and the yellow dot. This red box is deadly lava. If the creature base joint touches it, they're out until the next generation.
- SDL Graphics Library
[ I was listening to the immortal Lorne Greene in the background ]