Hello,
I made an artificial life simulation just for fun and I thought I should share it. It is still nowhere near done (I only worked on it for 3 days so far
), and still quite buggy, but it is already possible to witness some interesting patterns!
So far I have seen simple gathering, competing for food, predators, baby-eating (nerfed), timed grazing intervals (a swarm of creatures moving on a clock), upgrading agility to eat before the rest of the swarm arrives, and lots of dying.
I aim to make one of the most complex artificial life simulations ever (big ambitions I know, I can dream
).
Here is how it works so far:Each creature gets a fixed number of points. These points can be allotted to 15 different attributes:
- Health
- Armor
- Main Damage
- Piercing Damage
- Speed
- Agility
- Energy Consumption
- Starting Energy
- Reproduction Rate
- Reproduction Energy Loss
- Range
- Healing
- Max Life Span
- Size
- Attack Rate
The way these points are allotted is evolved over time. Creatures can reproduce either with binary fission or with sex. A creature can lay down pheromones to help remember where things are (stigmergy). Creatures can evolve which pheromone type they lay down as well.
Each creature is controlled by 2 neural networks: A dopamine distributing network that defines the reward that the second actor network receives. The former is evolved, and the later both learns in its lifetime through hedonistic synapse modification and evolution (knowledge is not lost). As inputs, the neural network receives the creature's velocity, the grid around it, the nearest N creatures with information about them (direction, health, size, similarity), and the nearest food source. The creatures then decide how to move, attack, mate, and eat.
For the AI, I used my NNBrain library:
http://en.sfml-dev.org/forums/index.php?topic=13449.0Creatures can evolve to become either carnivores or herbivores. There are no omnivores at the moment.
Right now, there are major balancing issues in the stats. I also want to add construction (block placement), omnivores, and more complex fighting, among other things.
Here is the download link:
https://sourceforge.net/projects/alifennplasticity/?source=navbarBe warned though, it is incredibly processing intensive! I get only like 20 fps on my rig. The reason is that there are simply too many creatures (and I need to add a spatial tree).
There are typically around 1000 creatures at once if I had to guess.
It's not exactly visually stunning, but here is an image of it (each colored square is a creature):