Page 1 of 1

A small evolution "game"

Posted: Tue Jun 03, 2008 1:50 pm
by Hurga
Hello

I played a bit around with some game/simulation.

Here is the result...
Image

There a a constant plant-food (the green dots) and there are some plant eater (herbivores- the with boxes). You can set some parameter for them (which will applied for new Herbivores)

And there are some hunters :twisted: as well. (The red boxes)
They hunt (and eat) herbivores. And you can set some parameter for them, too.

You see in a graph with the population of the herbivores and the carnivores at the bottom of the window.

You can also see and edit the "genes" of each individual.

The refresh rate means after how many cycles the screen will redrawn.


What doenst work right now
herbivores: the sences, cannibale
carnivores: cannibale



Here you find the download

http://purebasic.stdojedmahr.de/projekte/Evolution.zip


Your hints, suggestions and opinion is welcome.
Hope you have some fun with it.

Re: A small evolution "game"

Posted: Tue Jun 03, 2008 1:53 pm
by UserOfPure
It's very hypnotic. :)

Posted: Tue Jun 03, 2008 11:42 pm
by Tipperton
This looks like an enhanced version of a simulation that was published in Creative Computing back in the early 80s.

The original published version didn't allow for real time changing of the parameters, you had to edit the code then run it again. I modified it so that parameters could be changed while it was running.

I have fond memories of playing with it's many parameters for hours to see what affect they had over time.

I later added the ability to save and restore a simulation so I wouldn't have to start over every time I ran it.

Posted: Wed Jun 04, 2008 7:32 am
by dige
I like it - could watch for hours.. :)

Posted: Wed Jun 04, 2008 9:36 am
by Hurga
Thx for your comments

Nice that you like it.

I worked on it a bit...
- the Herbivores now may use their sences (it they had some) to run away from carnivores
- the movement-speed is more exakt, so small differences may effect the outcome of a hunt
- the statistic with individuals is a bit better, (but it has sometimes a bug that creashes the proggie (an ima...)

Same link ...

The idea is old. I first read in a magazin "Spektrum der Wissenschaft" (is it "science"?) about it.
So it just played around with the main idea... ;-)

Posted: Wed Jun 04, 2008 10:17 am
by Foz
I love this :)

Three possible things to do with this:
1. For watching full screen would be awesome.

2. (This ties into 1) Make this into a screensaver where you can give a time to create ### amount of herbivores and then ### amount of carnivores.

3. To speed rounds up, if you want to make some slight changes, but want to speed up the process times: switch off screen output - I'm guessing that screen output this is the slowest part of this.

Posted: Wed Jun 04, 2008 1:01 pm
by Derek
Nice, passes the time away in work quite well. :wink:

Posted: Wed Jun 04, 2008 5:26 pm
by Demivec
Hurga wrote:- the statistic with individuals is a bit better, (but it has sometimes a bug that creashes the proggie (an ima...)
The "ima" I think is related to the gadgets used. I noticed in the previous version that there was a big delay in drawing the gadgets on the main display. I suspect you are using #PB_ANY when creating multiple new gadgets and you are not freeing the former, no unused gadget #'s.

I enjoyed using your program. Now that the herbivores can run from the carnivores the carnivores have to gang up on them to drive them into each other. :wink:

Posted: Wed Jun 04, 2008 10:39 pm
by Hurga
I suspect you are using #PB_ANY when creating multiple new gadgets and you are not freeing the former, no unused gadget #'s.
Strangly not. I used constants (the good ol visual designer greets you ;-) )

But i recogniced this behavior as well...

I compiled the exe with 4.2 and it runs well.. maybe a bug in 4.1...?

The new version is available with the old link in the first post...


@Foz
Let me see what I can do... maybe an option to switch it to full space as an option in the pref... (not sooo cool, I know... ;-) )

The screensaver idea is nice .. I think I´ll try this when the proggie is running fine. Thx for the idea

To increase the speed, you can change the "refresh" - value. A value of 1 means, the screen will be refreshed after 1 cycle, 10, after 10 cycles and so on. That is, in other words switching off the screenoutput for (refreshrate) cycles.

Hope that speeds it up for you :-)

Posted: Thu Jun 05, 2008 12:23 am
by IceSoft
If you like Evolution....maybe you like also PetriDish?
http://www.purearea.net/pb/showcase/sho ... yProj&sQ=0
Image

Posted: Sat Jun 07, 2008 4:28 pm
by Hurga
@ Icesoft

I know petridish.. it´s a nice one, I like it...


Here is a small update

You can now use fullscreen mode
Some internal changes...

Same link in first post

Posted: Tue Jun 10, 2008 9:31 am
by Foz
I'm feeling dumb. :oops:

How do I get full screen?

Posted: Tue Jun 10, 2008 5:57 pm
by Hurga
Hm, when you start the program, a small window appears where you can preset the display. There should be a checkbox with "Fullscreen" (left bottom)

Maybe you has an older version, then download it again...

:wink: Good luck