Pixi - Evolution Simulator [WIP]
Posted: Sat Mar 06, 2021 5:00 am
Hello everyone! First time posting here!
For the last few weeks I've been working on this project. It is a "petri dish" style evolution simulator. I call the lifeforms "pixies" (singular: pixi) since their bodies are composed of pixels. The pixies start out with completely random brains and bodies - the vast majority don't make the cut. But the lucky few who are able to achieve replication rapidly begin adapting to the environment. They can reproduce sexually or asexually, with small random mutations occurring in their spawn.
A pixi's genome defines everything about it - it's size, shape, color, how its brain functions, and how it communicates with its fellow pixies. A pixi's body is generated using extremely complex mathematical functions that can produce practically infinite variety in structure. Its behavior is produced by a relatively simple matrix / network of sensory inputs which connect to each of its potential actions with varying weight, dependent on its genetic makeup. Though simple, their brains are refined through the pressures of natural selection to produced fairly sophisticated and highly efficient survival strategies.
Let it run for long enough, and you'll observe the pixies' bodies become streamlined in alignment with their behavior. I find it fascinating when predator-prey relationships develop between species, or when a single species branches into subspecies with different tasks. I am continuing to look for ways to enrich the sandbox with a wider range of senses/actions to allow for more specialized pixi species to develop.
Pixies' bodies interact on a per-pixel basis. When pixies collide their overlapping pixels are destroyed; the pixi with the larger mass gains energy from the interaction. If a pixi contacts the 'heart' (lighter colored portion) of another pixi, it effectively eats it, absorbing its energy. Pixies may also choose to be peaceful - two peaceful pixies will not harm each other, but an aggressive pixi will destroy a peaceful pixi without taking damage.
You can save pixi genomes that you find interesting for whatever reason, and load them into the instance in real time. Feel free to share them here, I'd love to see what you uncover - I'm interested in accumulating a "library" of specialized pixies that can be thrown into the ring against each other. You can also play god by cross-breeding pixies to select for whatever traits you desire.
You can peak into their brains by selecting a pixi and scrolling over its "senses". Each sense is paired with a gene, and each 'nucleotide' on the gene determines how strongly that sense affects each action. Values less than 5.5 affect the action impulse negatively, while values greater than 5.5 affect it positively. If the action impulse (shown for each action) crosses a certain threshold, the pixi performs the action.
I am planning a larger write-up about how this all works, along with some screenshots and maybe videos. Eventually I'll get around to posting the source code. I am an amateur/hobbyist coder with no formal education, so I'm trying to learn how clean up my code for public consumption. I'm frankly embarrassed to post it, since I'm certain it's of such low quality. This is the biggest thing I've ever made, and my god it's 1400 lines in a single file >_<
In the meantime, please let me know what you think so far! I'd love to get some feedback on what direction I should take this project. Perhaps there are ways to "gamify" this project to make it more interesting for people to interact with. If you don't find evolution simulators inherently interesting, then... this is little more than an odd screen-saver haha.
Next steps:
--Give users ability to adjust settings such as food density, movement cost, breeding cost, mutation rates, max size, resolution, etc.
--Implement an actual GUI (ughh.....)
--Save/Load whole instances, not just individual pixis
EDIT: love file has been updated to latest version.
For the last few weeks I've been working on this project. It is a "petri dish" style evolution simulator. I call the lifeforms "pixies" (singular: pixi) since their bodies are composed of pixels. The pixies start out with completely random brains and bodies - the vast majority don't make the cut. But the lucky few who are able to achieve replication rapidly begin adapting to the environment. They can reproduce sexually or asexually, with small random mutations occurring in their spawn.
A pixi's genome defines everything about it - it's size, shape, color, how its brain functions, and how it communicates with its fellow pixies. A pixi's body is generated using extremely complex mathematical functions that can produce practically infinite variety in structure. Its behavior is produced by a relatively simple matrix / network of sensory inputs which connect to each of its potential actions with varying weight, dependent on its genetic makeup. Though simple, their brains are refined through the pressures of natural selection to produced fairly sophisticated and highly efficient survival strategies.
Let it run for long enough, and you'll observe the pixies' bodies become streamlined in alignment with their behavior. I find it fascinating when predator-prey relationships develop between species, or when a single species branches into subspecies with different tasks. I am continuing to look for ways to enrich the sandbox with a wider range of senses/actions to allow for more specialized pixi species to develop.
Pixies' bodies interact on a per-pixel basis. When pixies collide their overlapping pixels are destroyed; the pixi with the larger mass gains energy from the interaction. If a pixi contacts the 'heart' (lighter colored portion) of another pixi, it effectively eats it, absorbing its energy. Pixies may also choose to be peaceful - two peaceful pixies will not harm each other, but an aggressive pixi will destroy a peaceful pixi without taking damage.
You can save pixi genomes that you find interesting for whatever reason, and load them into the instance in real time. Feel free to share them here, I'd love to see what you uncover - I'm interested in accumulating a "library" of specialized pixies that can be thrown into the ring against each other. You can also play god by cross-breeding pixies to select for whatever traits you desire.
You can peak into their brains by selecting a pixi and scrolling over its "senses". Each sense is paired with a gene, and each 'nucleotide' on the gene determines how strongly that sense affects each action. Values less than 5.5 affect the action impulse negatively, while values greater than 5.5 affect it positively. If the action impulse (shown for each action) crosses a certain threshold, the pixi performs the action.
I am planning a larger write-up about how this all works, along with some screenshots and maybe videos. Eventually I'll get around to posting the source code. I am an amateur/hobbyist coder with no formal education, so I'm trying to learn how clean up my code for public consumption. I'm frankly embarrassed to post it, since I'm certain it's of such low quality. This is the biggest thing I've ever made, and my god it's 1400 lines in a single file >_<
In the meantime, please let me know what you think so far! I'd love to get some feedback on what direction I should take this project. Perhaps there are ways to "gamify" this project to make it more interesting for people to interact with. If you don't find evolution simulators inherently interesting, then... this is little more than an odd screen-saver haha.
Next steps:
--Give users ability to adjust settings such as food density, movement cost, breeding cost, mutation rates, max size, resolution, etc.
--Implement an actual GUI (ughh.....)
--Save/Load whole instances, not just individual pixis
EDIT: love file has been updated to latest version.