DEV Community

eranelbaz
eranelbaz

Posted on • Edited on

1 1

Code Tryouts - Natural Selection

Hey,
In the last week I wrote simulation in Unity3d,
In this simulation we have animals that can walk around the map and they search for food, water and another animal to mate with.

Each animal currently have 2 genes - Speed and Search Radius.

When a new animal is born it can inherent each gene from one of the parents,
and in 80% of the cases the gene will also change a bit.

I let the simulation run twice, each time for 5 minutes and the results are
Alt Text
Alt Text

Alt Text
Alt Text

Alt Text
Alt Text

What that shocked me was that in the second run the Search radius didn't raise all the time as the first run, and I think that the reason for that is because the population explodes, and so there are more animals that are probably closer to water and food.

I think I'll revisit this project in the future and will add predators and will see what happens.

For more information you can watch the development process in youtube:

Click here to this project github page
Click here to download the run data

Have a great day 😋

Like this post?
Support me via Patreon
Subscribe to my YouTube Channel

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay