Life Simulation banner

Life Simulation

8 devlogs
20h 37m 33s

Using neural networks, I created a life simulation where organisms compete against each other to consume enough food to survive and reproduce.

Demo Repository

Loading README...

Cinders

Tagged your project as well cooked!

🔥 Cinders marked your project as well cooked! As a prize for your nicely cooked project, look out for a bonus prize in the mail :)

samanantha.com

I revamped the UI so that this simulator is more bearable to look at. I am really happy with the final result!!!

Attachment
0
samanantha.com

Shipped this project!

Hours: 19.8
Cookies: 🍪 286
Multiplier: 14.43 cookies/hr

This ended up being more difficult than I thought it would be, but I’m fairly satisfied with the final product. In the future, I would love to attempt to code in carnivores and herbivores to add another layer of complexity beyond the seasons in this simulation.

samanantha.com

I did some minor debugging (got the population and traits counter to work). The simulator is done!

Attachment
0
samanantha.com

I added seasons and a move to group neuron, which encourages organisms to move to a nearby organism. I also removed the ability to change the food spawn rate, so that that variable is only changed through the seasons.

Note to future self: the population counter/organism and their traits list is very faulty (they don’t display the proper population).

Also, something really interesting I observed: over time, the organisms. learn to not move around during winter. I honestly don’t know how that happened, but it somehow did. What they would do is that they would stay still and reproduce (their children spawned with full hunger regardless of parent’s hunger).

As for functionality, all I need to do now is to fix the bugs and make the website a bit prettier. Other than that, I am basically done!

Attachment
1

Comments

samanantha.com
samanantha.com 29 days ago

Another note to self: make it so that food that has been sitting around for a long time decays/disappears somehow

samanantha.com

I got rid of the carnivores because it was too buggy and too difficult to code. Instead, I added options to change the food spawn rate, spread a virus, and change the animation speed.

Next time, I want to add neurons that encourage these organisms to stay together. Another thing on my bucket list is to add seasons and natural disasters that impact the energy it takes to move, food scarcity, etc.

One bug that I was too lazy to fix right now: some squares will stay green (has the cellInfected class) but it isn’t alive (doesn’t have the cellAlive class).

The video quality is pretty terrible due to file size limits.

0
samanantha.com

Added carnivores and herbivores. However, I mainly attempted to fix some bugs, but ended up making it worse :)

Will fix later when I have time

Attachment
0
samanantha.com

Added a few more neurons, created a simple asexual reproduction algorithm with occasional mutations, and created graphs + species stats to understand what is happening in the simulation.

Attachment
0
samanantha.com

Coded the backbone logic and created very basic organism movements.

Attachment
0