Welcome To Darwinbots > Newbie
Newbie starting a complex simulation
Moonfisher:
One of the big issues you're facing is the very small environment. This tends to cause one specie to exterminate the others rather fast.
Another issue is that any specie can produce chloroplast in the latest version of DB, so anyone could become a vegy.
There's another topic where some people where putting together a "wiki bot" where each person adds one line of code at the time.
(I should mention some of the lines are taken from other evolved bots, making the code very hard to read.)
This is what it looked like:
--- Code: ---start
.tie inc
*.focuseye .eye5 add * 0 >
*.nrg 1000 sub sgn 0 floor 49 *.venom sub sgn 0 floor mult 5 mult .strvenom store
7 .venloc store
-2 .venval store
59 << *.robage 192 ceil >> rnd << << ++ store
*.eyef 0 sub sgn abs -- abs .focuseye mult inc
clearbool
*.refbody << *.timer rnd 3 ceil mult ++ .up store
59 << *.robage 192 ceil >> rnd << << ++ store
*.refeye 4 sub .sx store
.shoot dec
5 .sharenrg store
*.body *.trefbody sub 10 div 65 floor .sharenrg store
stop
--- End code ---
I tried running a sim with the wikibot and an alge, it had a hard time surviving but eventually mutated to a point where it was stable (after about 1600 cycles), the code looked like this:
--- Code: --- start
.tie inc
*.focuseye 505 add * 0 >
*.nrg 1000 sub sgn 0 floor 49 *.venom sub sgn 0 floor mult 5 mult .strvenom store
7 0 store
-2 .venval store
59 << *.robage 192 ceil >> rnd << << ++ store
*.eyef 0 sub sgn abs -- abs 511 mult inc
clearbool
*.refbody << *.timer *323 rnd 3 ceil mult ++ .up store
59 << *.robage 192 ceil >> rnd << << ++ store
*.refeye 4 sub .sx store
.shoot dec
5 .sharenrg store
*.body *.trefbody sub 10 div 65 floor .sharenrg store
stop
--- End code ---
It would eventually kill the alge it was feeding off, but the sim would repopulate the alge so it didn't die out.
However after 24K cycles it reached a point where it stopped shooting. It would still feed off the alge through ties, but wouldn't kill it.
It would also produce chloroplast though. So it had in a way evolved into a parasitic alge.
This was the end result:
--- Code: --- start
.tie inc
*.focuseye 505 add 0 xor
* *.nrg 1000 sub *.venom 49 floor 0 sgn sgn 0 floor mult 5 mult .strvenom store
store
0 7 -2 .venval floorstore
59 clearbool
*.robage 192 ceil >> rnd << << ++ store
*.eyef 0 sub abs -- abs 511 clearbool
inc
mult << *.timer store
div rnd 3 logx mult ++ .up store
59 *.robage 176 ceil >> rnd << << ++ store
store
7 830 10 div 65 floor 830 overbool
store
stop
--- End code ---
The problem with all of this is that the code is unreadable and very hard to follow. I'm assuming you want to somehow document what has changed in each bot.
It also sounds like you want to be able to modify a specie during the sim. But if you simply have 2 species in a sim, then they will evolve in each their way and it will be out of your control. (You can only control the environment they're in)
One option could be to take a descent bot from the F3 or maybe F2 league and run the sim with a basic alge which repopulates. Then at some point switch out the alge with a slightly stronger bot, something from the bottom of the F3 league. And then basically slowly increase the strength of the repopulated bot as the bot in the sim evolves to be able to kill the repopulated bot easily.
At least that would be a way to show visible improvement in one bot. But if your goal is to show 2 bots coexisting that will be harder.
I have only seen this happen once in a sim, where a bot branched out into 2 species, where one fixed it's position and reproduced in small clusters while the other moved around but had a hard time feeding off an alge as it kept pushing it out of the way. The only reason both species managed to coexist was because they depended on each other. The bots that moved could not survive without something to block the alge it was pushing and holding it in place, and the fixed bot could not survive without something pushing alge over to it.
But over time one of them (Don't know which one) evolved into something else, and wiped out the other bot.
The best chances you have of 2 species coexisting is for them to depend on each other somehow. Or at least for the stronger one to depend on the weaker one. In a very large sim with very few alge, bots will tend to feed off the alge without killing them, since once the alge is dead it may take them a long time to find a new food source. But this is rarely completely stable.
The last of the 3 code samples I've shown may be able to coexist with a weak bot, provided you still have some alge which repopulates in the sim. But I'm not sure how long it would be stable though.
pieflavor:
Thanks for the advice, Moonfisher.
My original statement wasn't totally clear regarding what specifically I want for the simulation. Basically, I want coevolution in which there is a prey and predator species in an "evolutionary arms race". This would require populations to not die out, and if possible I'd like it to be so that they reproduce by themselves and don't have to be repopulated by the simulation.
I would like to be able to document the changes, and ideally I would start with very simple DNA that would progressively get more complicated for both species as the sim went on; however, I'd also like (again, if possible) not to have to edit or replace any species mid-sim. I realize this might be a lofty goal, but I do have a significant amount of time to get this right so any ideas you have are greatly appreciated.
Thanks!
Peter:
In order to keep it as stable as possible and keep bots from extinction, you'll need quite a simulation. At the least 1000 bots, if possible more, the more the better. And a sizable simulation.(size 10?)
Coexisting bots is hard. It can go well and they could run into a evolutionary arms race, but likely at some point one of them gets a solid advantage and wins it. Maybe if you get 3 different sims, one were the prey is at advantage, one where the predator is at a advantage and one where they're equal. Connect the sims with teleporters, et voila.
Anyone got a idea on which settings to use in sims like that to implement this? I was thinking higher light energy for the prey sim. Lower light energy and lower cost multiplier in the predator sim.
Moonfisher:
Peters suggestion is a good one. High light and thick fluids along with higher costs in the prey sim I would say. And very low light and low costs in the predator sim (Maybe have some basic alge which repopulates in the predator sim). And well, something in between in the sim in between.
This should prevent either specie from being wiped out and keep an ongoing battle for the ground in the middle.
Or at least it'll increase the chances.
You should be aware that any specie can evolve using chloroplast though. So the predator could start using chloroplast and invade the prey sim eventually.
On a side note. Made 2 bots and tested them a bit. They seem to be able to coexist. But like peter mentions, the bigger the sim the better and the more bots the better. Also you can't actually cap the amount of bots really, so you need to tweak things like light and costs, which could just end up wiping out one specie.
One important thing, if you plan to try out Peters idea (And I think you should), then be aware that the predator of these 2 bots I'm posting is using chloroplast, but a small amount. (You could simply adjust light settings so the small amount the predator uses isn't enough, or you could just remode that from the code.)
Anyway here are the bots. I added some constant values at the top of each you can use to tweak. But things like maxpop tend to break very easily I'm afraid. Never took long before the population just exploded and sim speed went down to 0.1 cylce per sec.
(You should expect it'll take 1-2K cycles before sim starts to get going)
Prey:
--- Code: ---def maxpop 1500
def maxchlryoung 300
def maxchlrold 1000
def childpct 20
def reprosize 3000
cond
*.robage 30 <=
start
.deltie inc
.mkchlr inc
*.nrg 50 >
100 .sx store
stop
cond
*.robage 30 >
*.nrg 100 <= or
*.totalmyspecies 150 <= or
*.nrg 10 > and
start
*.chlr .maxchlryoung <
dupbool
*.nrg 100 > and
100 .mkchlr store
dropbool
.mkchlr inc
*.chlr .maxchlrold <
*.nrg 100 > and
*.robage 1000 > and
100 .mkchlr store
*.nrg 500 >
*.body 1000 < and
*.nrg 5 div 100 floor .strbody store
*.shflav 0 !=
*.body .reprosize > or
*.numties 1 >
*.nrg 100 >
*.body 300 > or and or
*.totalmyspecies 150 < or
300 rnd .aimsx store
100 .dx store
0 .shflav store
.deltie inc
dupbool
*.timer 50 mod 0 != and
*.totalmyspecies .maxpop < and
.childpct .repro store
dropbool
*.timer 50 mod 0 = and
*.totalmyspecies .maxpop < and
.childpct .mrepro store
stop
--- End code ---
Predator:
(Consider removing chloroplast from it, basically take out any part with .mkchlr)
--- Code: ---def maxpop 1000
def childpct 30
cond
*.nrg 50 >
*.robage 100 < or
start
60 .sharenrg store
*.robage 0 =
450 .eye5width store
.eye5width .memloc store
.robage .tmemloc store
*.body 400 >
*.eye5 0 <=
*.body 700 > or and
*.totalmyspecies .maxpop < and
500 rnd .aimsx store
dupbool
*.timer 50 mod 0 != and
.childpct .repro store
dropbool
*.timer 50 mod 0 = and
.childpct .mrepro store
*.nrg 500 >
*.body 1000 < and
100 .strbody store
*.nrg 300 <
*.body 100 > and
100 .fdbody store
*.chlr 100 <
.mkchlr inc
*.eye5 0 >
*.memval 450 != and
*.refvelup 50 *.eye5 sub 0 floor add .up store
*.refveldx .dx store
*.refxpos *.refypos angle .setaim store
.tie inc
dupbool
*.refbody *.refnrg > and
*.tmemval 500 > and
-6 .shoot store
dropbool
dupbool
*.refbody *.refnrg <= and
*.tmemval 500 > and
.shoot dec
dropbool
not
30 60 rnd sub .aimsx store
30 .up store
.deltie inc
stop
--- End code ---
The sim I ran was rather large (Over half way on the slider), with 1/8 mutation, started spawning 200 prey and 50 predators. Light settings are tricky, seems to work with either just 80 light, or 300 light per kilo veggy.
Biggest issue here is that there's a manually added maxpop in the code and this will break fast and end up freezing your sim eventually.
You may want to remove it or set it higher and then try to control population through environment settings instead, tweaking light and costs slightly.
Remember that when tweaking settings you should change them slightly and then give it lots of time to take effect before tweaking again, or you 'll suddenly have wiped the sim.
In any case good luck, and I second Peters idea. I think it's your best option.
I should also mention that when I made these 2 I simply had one large sim in mind. I think Peters idea is better, so if you want I can try to set that up myself and make some modifications to made the bots more suited for that purpose. (Unless you want to adjust them yourself)
Shadowgod2:
the vegi and prey are done but the predator doesn't work as well so i am letting it evolve a bit until it can hold it's own. when i have the predator good i will give it to you but you can see how the other are doing.
Edit: ok so i forgot about leaching so the predator is done too.
explained the vegi uses poison which is released when shot so the prey uses ties to feed from. the predator has slime to prevent ties but this is not a fool safe way so it also leaches when there is a tie. so lets see if the prey can find a way around this and so forth. i'm thinking about a virus for vegis to put in. hmmm :thinkey:
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version