game is lagging and creatures won't survive for longer than 40 seconds. please fix that. the concept is great, i like it but the "game" has problems.
A downloadable prototype for Windows, Mac OS X, and Linux
For the Procedural Generation Jam 2016 I wanted to make something simple with elements of evolution and natural selection. It's not coded as a conventional genetic algorithm, but in a simple and "game-like" fashion that lets you "see" evolution in real time. I will describe what I mean briefly below.Made with Unity using C#.
Each cube acts based on a bunch of parameters. They need to eat randomly spawning plants or they will die, and they eventually die of old age. Once they reach their minReproductionAge, and bump into any other cube they mate and instantly produce three children. Children inherit a 50/50 blend of parents' properties. Each child will mutate some of their properties - this means changing the value slightly at random. This mutation is just as likely to be positive as negative. The only "sense" of the cubes is that they can "see" at a ray cast straight forward to a certain distance. What they do with the input depends on their properties.
Here are the main properties of a cube explained:
- Size - Big cubes it food & others easier, small have higher acceleration
- Move forward - Chance to move forward when nothing is seen
- Change dir - Chance to change direction when nothing is seen
- Keep turning - Chance to turn in previous direction when nothing is seen
- Eat drive - Chance to charge forward if a plant is seen
- Sex drive - Chance to charge forward if another creature is seen (and age > minReproductionAge)
- Jump chance - Chance of jumping
- Jump force - Force of jump
The cool thing is that it does work. Initially a bunch of creatures are spawned and mutated a bit right away. I deliberately made their starting stats sub-optimal. As generations live and die and reproduce, the creatures with less optimal properties will die before they have a chance to reproduce. Cubes with higher sex drive will reproduce more, but if their other stats are bad they will die from starvation in the long run.
After running it for a long time the average properties change like this: Size gets smaller, move forward increases, change dir decreases, keep turning increases to always keep turning, eat drive goes up, sex drive goes up more, jump chance goes up after a really long time when enough random cubes happen to jump into the neighboring "pools". Jump force isn't very important so it's cool to see how it doesn't really change most of the time.
NOTE: THIS IS NOT REALLY A GAME! The interaction is limited to restarting a new population and walking around observing. WASD or arrow keys to move, mouse to look. Backspace to restart.
To start the game on a Mac, right click and choose "open", then "open anyway".
Log in with your itch.io account to leave a comment.
yeah it's just a prototype and requires a quite powerful computer because of zero optimization. I will not likely keep working on this but might use what I learned in other projects in the future. Thanks for trying it out anyway!
Interesting concept. Please take it furhter.
I want to try more stuff like this myself in future. :)