food chain simulation
Community Forums/Showcase/food chain simulation
| ||
A simple media-free program I created for fun. 4 types of life struggle to survive in this program. Plants try to grow and reproduce. Insects try to eat the plants. Mammals eat the insects. Carnivores eat the mammals! All 4 types look for food on their own and reproduce when conditions are right for them. Note: This program requires no input from the user, altough you CAN add some plants and insects to the program if you wish. Instructions: ESC key quits. Hold i key to add insects... (this is keydown, not keyhit, so be careful not too add thousands on accident) Press p key to add 1 plant. You should not have to add anything at all, actually. Edit: I forgot to mention.. Plants are green, insects white, mammals grey, and carnivores are red, in case anyone was wondering. Here is the link: (613 kb) http://www.mediafire.com/?yxdyfj4uyfp |
| ||
very cool! |
| ||
Lol, on my second simulation I just left it alone and they all died off in, I think, less than 5 mins. |
| ||
Kazillion inects just swarming the hell out of the plants lol. |
| ||
Lol, on my second simulation I just left it alone and they all died off in, I think, less than 5 mins. Aye, I've run it dozens of times for testing and the results are always drastically different. I've seen all the insects get eaten within 30 seconds of starting. It all depends on how each lifeform thinks. Each creature is given randomly generated "wants" when it born. Some will find mating more important than eating, some will eat rather than mate, a few will just sit and do nothing, some will wander around aimlessly. Most will behave normally as one would expect, though. |
| ||
Ohhh very interesting stuff !! thanks |
| ||
This is cool. Can you make it run in a Window so I can leave it running and still work? |
| ||
This is cool. Can you make it run in a Window so I can leave it running and still work? Of course I can. The only thing is, the chain will eventually break itself at some point, in which case the whole "world" suffers and eventually die out. I have some optimizations I want to complete and also a few other choices for each species I want to implement as well. For example, I'm working on getting the mammals to also eat plants when the insect population gets too low. I'm having a lot of fun with this program so hopefully it won't take me too long. |
| ||
I like this, but it would be more fun if we could experiment with the code of this little ecosystem to see how much we can warp it. |
| ||
Nice. |
| ||
Hey nice one :D I might have a play tomorrow and try something similar. |
| ||
Mammals eat insects? I thought they only ate plants/grass/vegetables/fruits/etc? |
| ||
Mammals eat insects? I thought they only ate plants/grass/vegetables/fruits/etc? you are a mammal. Do you only eat plants? Not all mammals are herbivores, some are carnivores, some are omnivores, some are frugivores and some are insectivores, etc. |
| ||
Mammals eat insects? I thought they only ate plants/grass/vegetables/fruits/etc? This is the first link I found: http://kids.yahoo.com/animals/mammals/mammals-eat |
| ||
lol, yeah. Mammal just means it doesn't lay eggs |
| ||
Oh, right. silly me. Carry on then. :) |
| ||
Nice job! Now all you have to do is add a genetic code, and you'd have the makings of a nice evolutionary sim! ;) |
| ||
@chwaga, both the echidna and the platypus lay eggs. @Drak, awesome. Why not try making the mammals run away from carnivores? Or even fight back when in large numbers? Could be interesting... |
| ||
@Buggy, I like the idea of mammals fighting back if the numbers are big enough. I may have to try and implement this. As far as running away goes, this will take some code tweaking. In the current version, mammals are always faster than insects, and carnivores are always faster than mammals. However, if I were to implement some genetic code... the mammals that were faster would live longer, and their children would also be faster than other, slower mammals. That's natural selection right there. |
| ||
you also could make it that mammals have to seek out another mammal to mate this would mean that they would clump together more and form groups. |
| ||
This would make a good screen saver |