https://news.ycombinator.com/item?id=27476768
---
When I was learning to program, I tried to make a toy artificial life evolution simulation. Particle organisms on a 2D plane had 'dna' which was a list of heritable traits, like size, speed, number of offspring. Bigger organisms could eat smaller organisms, but they burn energy faster. 0 energy = death. When two organisms of opposite gender collided and had sufficient energy, they'd give some of their energy split among the offspring, with each offspring's 'dna' values set to one of the parent's +/- 5%. As I was developing this, I hadn't figured out how I wanted to do food yet, so as an easy first step, I just had a constant amount of energy that was split amongst all organisms on the screen. Lots of little dots buzzing around, was kind of neat but nothing too special. I left it to run overnight.
When I came back I was very surprised: previously i was running at about 30FPS - now it was running at about 4 seconds per frame. The screen was filled with dense expanding circles of tiny slow organisms emanating from where organisms had mated and nothing else.
My simulation evolved to outsmart my simple food algorithm: when food is divided equally among all organisms, the best strategy is to use minimal energy and maximize offspring count. I had populated the world with a default offspring count of ~5 and they had evolved to the tens of thousands. The more offspring an organism had, the greater the amount of the energy pool would go to their offspring.
It was a very cool "Life, uh, finds a way" moment - that such a simple toy simulation of evolution was able to find an unanticipated optimal solution to the environment I created overnight was very humbling and gave me a lot of respect for the power of evolution.
I'm hoping that some day the source code is released, i've talked to the critterding person, but they don't seem amenable to it. Critterdrug is probably my favorite evolutionary algorithm example.
I'll never be able to do the game(s) justice, even if i link a video of the shared screen.
You can use a functional language to program them, or any other kind of language of your own choosing.
You could write your own from scratch or using any one of many libraries to do some of the heavy lifting for you and concentrate on higher level problems.
There's a lot of literature and research on all this, so it's not at all hard to get started if you're in to programming already.
That's probably too much to ask. :-)