LifeSim

2019

LifeSim

Source Code

This is a fun little visualization tool for setting up a population of simulated lifeforms, controlling their environment and behaviour, then seeing how they evolve over time to survive!

The life-forms walk around the screen, eat, reproduce and mutate. Built just for fun and as an exercise to learn Lua.

Every dot represents one life. Lifeforms consume energy with every step. Dark horizontal lines represent food. Lifeforms walking over the lines will gain energy. Every Lifeform has a "walk sequence," set at its birth, that controls its movement . It will follow this sequence on repeat. E.g. (left, up, up). Mutations occur occasionally; a mutation can affect either a step along the sequence, or the length of it. A mutant Lifeform will take on a new colour. Reproduction happens when two Lifeforms run into eachother, are old enough, and have enough energy. Each time they produce two offspring that have one parent's walk sequence and a different direction.

© 2023 Yury Zhuk