Darwinbots Forum

Bots and Simulations => Bestiary => Interesting behaviour bots => Topic started by: jknilinux on November 17, 2008, 03:17:00 AM

Title: Alga pollinator
Post by: jknilinux on November 17, 2008, 03:17:00 AM
Hey everyone,

Here's my first bot!   

It's an algae that shoots viruses whenever a bot is nearby, and the viruses force the infected bot to "pollinate" (AKA fertilize) the veggies, so they can sexrepro! Pretty cool, huh? This is meant for evosims, although I'm sure even (especially?) the f1-bots will get killed instantly by these guys. Come to think of it, this should do pretty well in internet mode...

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Alga_Pollinator
'By: jknilinux
'It infects bots with a virus that makes them pollinate it and spread the virus to other bots.

Code: [Select]
cond
*.robage 0 =
start
7 989 store
stop

cond
*.vtimer 0 =
start
3 .mkvirus store
stop

cond
7 *989 !=
start
*.eyef 0 =
10 .up store
not
*.refxpos *.refypos angle .setaim store
*.refvelup 5 add .up store
*.refveldx .dx store
-8 .shoot store
*.thisgene .mkvirus store
50 .vshoot store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
50 .vshoot store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop

cond
*.fertilized 0 >
start
33 .sexrepro store
stop
end

Let me know what you think!
Title: Alga pollinator
Post by: Peter on November 17, 2008, 10:44:00 AM
Instead of a veggie that will be raped, this is a veggie that will rapes others. In the end you will have a veggie with only fightbot genes. Atleast I think that is the idea.

F1 bots instantly killed is not entirely the truth. Ofcource the veggies plan will succeed with most bots with probably multiple repops. But not inmidiate.

Veggies have a constant nrg income. Keeps a little unfair that they too can use all fighting power.
Title: Alga pollinator
Post by: jknilinux on November 17, 2008, 01:00:48 PM
Quote from: Peter
Instead of a veggie that will be raped, this is a veggie that will rapes others. In the end you will have a veggie with only fightbot genes. Atleast I think that is the idea.

F1 bots instantly killed is not entirely the truth. Ofcource the veggies plan will succeed with most bots with probably multiple repops. But not inmidiate.

Veggies have a constant nrg income. Keeps a little unfair that they too can use all fighting power.

I completely agree, peter. Veggies should have some sort of handicap to offset the fact that they get free energy- maybe at least really poor movement efficiency, or a slow maximum velocity.

Also, the idea was really to make a veggy that needs bots to survive... However, they pretty quickly develop the ability to fertilize themselves, so they just kill off all the bots.
Title: Alga pollinator
Post by: peterb on November 17, 2008, 03:08:05 PM
hmm

the bot I'm working on doesnt get killed by it, or wasntg that the goal? (not a bot killing plant?)
not sure if thats the goal, or if the bot is finally doeing well.
It seams to win from several bots but some not.. its not an ultimate bot.
.. oh well that is.. maybe it could live together in symbiosis with a F1 killer.
Or is what I made a F1 killer, (I'm not that sure about classification neither)
-it doesnt do tie feeding, but it has poison, doesnt have a virus no slime, but does like pocorn

Title: Alga pollinator
Post by: bacillus on November 17, 2008, 06:55:25 PM
Interesting idea you have there. I agree to some extent that plants should evolve defenses against predators (poison and the likes), possibly also lethal defenses, but plants raping and generally annihilating its predators is a little off the mark...
Title: Alga pollinator
Post by: jknilinux on November 18, 2008, 02:55:38 AM
Quote from: peterb
hmm

the bot I'm working on doesnt get killed by it, or wasntg that the goal? (not a bot killing plant?)
not sure if thats the goal, or if the bot is finally doeing well.
It seams to win from several bots but some not.. its not an ultimate bot.
.. oh well that is.. maybe it could live together in symbiosis with a F1 killer.
Or is what I made a F1 killer, (I'm not that sure about classification neither)
-it doesnt do tie feeding, but it has poison, doesnt have a virus no slime, but does like pocorn

Peterb-
No, that wasn't the goal, although I'm sure you could easily modify it to kill any and all bots really quickly. This goes back to an old thread where I said that in any evosim, so long as the algae can evolve, they will ultimately evolve to kill all of their predators, since it's really just a contest of who will win- bots that start out simple but get free energy or bots that start out complex but need to eat other bots to survive. The problem is, it doesn't matter how they start out, evolution is working for the algae. There are two ways to solve this:

1: Give algae a handicap, such as inabilty to move, inability to shoot, etc... This is most like real biology- plants are stuck in a local evolutionary minima and will probably not evolve evasive movement for a few billion years.

2: Make algae want to keep their predators alive. The easiest way I saw for us to do this was to make the algae need the bots in order to reproduce, AKA require pollination. I thought this would be far more interesting. So, A. Pollinator was born.

Unfortunately, it does the opposite- It evolves to kill the predators faster. I still thought it was interesting, so I thought I'd show it off. We might still get it to work as intended, but that would require limiting genes, which would require mutation protection to survive evolution in an evosim...

Bacillus-
Yeah, that wasn't the intention...  

Title: Alga pollinator
Post by: peterb on November 18, 2008, 11:33:18 AM
Quote
Peterb-
No, that wasn't the goal, although I'm sure you could easily modify it to kill any and all bots really quickly. This goes back to an old thread where I said that in any evosim, so long as the algae can evolve, they will ultimately evolve to kill all of their predators, since it's really just a contest of who will win- bots that start out simple but get free energy or bots that start out complex but need to eat other bots to survive. The problem is, it doesn't matter how they start out, evolution is working for the algae. There are two ways to solve this:

1: Give algae a handicap, such as inabilty to move, inability to shoot, etc... This is most like real biology- plants are stuck in a local evolutionary minima and will probably not evolve evasive movement for a few billion years.

2: Make algae want to keep their predators alive. The easiest way I saw for us to do this was to make the algae need the bots in order to reproduce, AKA require pollination. I thought this would be far more interesting. So, A. Pollinator was born.

Unfortunately, it does the opposite- It evolves to kill the predators faster. I still thought it was interesting, so I thought I'd show it off. We might still get it to work as intended, but that would require limiting genes, which would require mutation protection to survive evolution in an evosim...

Bacillus-
Yeah, that wasn't the intention...


Intresting dough if my bot first eats (kills) the algey then it wouldnt be able to reproduce.
Hmm dough an intresting concept, maybe create an algey that monitors .pain and .nrg
so that if it almost dies then do a reproduce, and let the childs have a run a few seconds then stay in place.

When I test bots in first runs, I often take algea minimalis with an added gene that only moves in respond to pain or in respond to somethjing in eye5

like
cond
*.pain *.eye5 !=
start
30 .up store
stop

not that advanced, but plants shouldnt be too advanced.

Maybee thinking a seeds and .repro have somthing like  
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
cond
*.robage  450 <               (why is that robage instead of botage I wonder, it isnt a robot sim?)
*.pain 0 >
start
30.up store
stop

Cond
*.robage 450 >
*.pain 0 >
start
5 .repro store
stop


so only move if attacked, otherways grow in a group and have it only for young plants.
somewhere in the middle of having seeds and stable fixed plants.
Uh oh now I need to test this too...

.. Darwinbots is quite adictive I notice  

Title: Alga pollinator
Post by: peterb on November 18, 2008, 02:05:22 PM
'New code ready..

'ALGEA-DEPRESIA(4G).txt
'
'Plants have feelings too
'by peterb
'
'(like some trees only reproduce with forest fire)
'This algey only reproduces when attacked.
'When attacked, it wil have offsrping that run away when shot if age < 450
'Once an older algey is attacked it also rotates (so offspring goes into various directions)
'Note it becomes intresting after the new generation of 1st plants
'then the yong ones are vulnerable
'They also dont spread too far, so you get grean areas, and wastelands.
'Bots who are not in those wastelands have a reasonable chance to survive.
'And maybe kill them all or keep in balance.
'Without beeing eaten this plant cannt survive.
'======================


def auw 100
def heal 101

cond
*.pain 40 >
start
200 .auw store
400 .heal store
stop


cond
*.robage 450 >
*.auw 1 >
start
15 .repro store
*.auw .aimdx store
*.auw 20 sub .auw store
stop

cond
*.robage 450 <              
*.auw 0 >
*.nrg 2000 >
start
200 .dn store
*.auw  3 sub .auw store
*.tiepres .deltie store
0 .aimdx store
stop


cond
*.heal 0 >
start
.heal dec
else
0 *.auw store
stop
Title: Alga pollinator
Post by: jknilinux on November 18, 2008, 04:49:46 PM
The problem with putting in restrictive code like you did is that it tends to break extremely quickly in an evosim. That's why I suggested mutation protection for it. So I'm pretty sure the depressed algae will break it's restrictive genes in just a few thousand cycles. Alga pollinator has the same problem... From an evolutionary standpoint, why not just use .repro instead of waiting for a bot to find you?

Wait!

I have an idea-  

Make the virus delete all the bot's DNA except for the virus! The virus already has all the code needed to find and fertilize more plants. That way, fertilization will NOT put bot DNA in the plant- just virus DNA. Also, put an antivirus gene in the bots, and keep it from breaking by having another plant in the evosim that shoots viruses that kill any bots without the antivirus gene in, like, 2 cycles. That way, they'll keep the antivirus gene (or die), and if a virus tries to get away with evolving to not delete all the bot's genes (which would let it make a hybrid veggy when it polinates), it'll be erased the next cycle by the antivirus gene. The bot-killing virus veggies can't really be kept from devolving their anti-bot virus code (unless there was a reason to keep it, like making the first veggy shoot them when it see them- then the anti-bot virus will infect the first pollinating veggies and kill them), or we could make their mutation rate 0. The only reason why they're there anyway is to keep the anti-bot virus around, and at least we'll have one veggy co-evolving with the bot.
Title: Alga pollinator
Post by: jknilinux on November 18, 2008, 05:22:46 PM
Okay, alga pollinator v 0.2

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Alga_Pollinator_0.2
'By: jknilinux
'It infects bots with a virus that makes them pollinate it and spread the virus to other bots.

cond
*.robage 0 =
start
7 989 store
stop

cond
*.vtimer 0 =
start
3 .mkvirus store
stop

cond
7 *989 !=
start
*.thisgene 1 rnd 2 mult -1 add add .delgene store

*.eyef 0 =
10 .up store
not
*.refxpos *.refypos angle .setaim store
*.refvelup 30 add .up store
*.refveldx .dx store
-8 .shoot store
*.thisgene .mkvirus store
50 .vshoot store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
50 .vshoot store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop

cond
*.fertilized 0 >
*.nrg 5000 >          'Sometimes works better without this
start
33 .sexrepro store
stop

cond                      'This may not be necessary
*.genes 7 >
start
*.mkvirus .delgene store
stop
end

The problem: The algae get infected by their own virus, so in a few cycles you see algae with one gene running around trying to pollinate bots... No idea why...

I mean, this virus cannot work in the veggies, since *989 = 7, right?
Title: Alga pollinator
Post by: Numsgil on November 18, 2008, 05:51:15 PM
You're doing 3 .mkvirus store to create the virus, but if an algae gets infected it might change the order of the genes which might cause some weird gene duplication that could cause problems.
Title: Alga pollinator
Post by: jknilinux on November 18, 2008, 06:20:32 PM
Thanks! Okay, this should fix it:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Alga_Pollinator_0.3
'By: jknilinux
'It infects bots with a virus that makes them pollinate it and spread the virus to other bots.

cond
*.robage 0 =
start
7 989 store
stop

cond
7 *989 !=
start
*.thisgene 1 rnd 2 mult -1 add add .delgene store

*.eyef 0 =
10 .up store
not
*.refxpos *.refypos angle .setaim store
*.refvelup 30 add .up store
*.refveldx .dx store
-8 .shoot store
*.thisgene .mkvirus store
50 .vshoot store

else

*.vtimer 0 =
*.thisgene 1 sub .mkvirus store

stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
50 .vshoot store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop

cond
*.fertilized 0 >
*.nrg 5000 >          'Sometimes works better without this
start
33 .sexrepro store
stop

cond
*.genes 8 >
start
*.mkvirus .delgene store
stop
end

But it doesn't...
Title: Alga pollinator
Post by: peterb on November 18, 2008, 10:00:26 PM
hm intresting so you want to keep the algea from evolving by using a gene system.
I gues the gene system could also get damaged.
While the purpose of sexrepro was I think to exchange DNA... hmmm ahm hm well maybe that works I duno
Your idea is the reproduction method will depend on it so it becomes an evolutionairy force.

That is to say... until theoreticaly sexrepro turns into .repro
But thats a small chance


Dough if you dont want any evolving at all you might also put in the
So I asume you still like it to evolve but be more depended on other bots.
As a kind of penalty for their so easy living method to get energy.
And you dont want them to win each time in the end...

Compared to what I wrote I'm curious how well does it live in a sim?
The algea I wrote cant do repro (unless there he's eaten/killed) so it needs bots to survive.
It depends so strong on it that in fact the DB fishtank can dye, an eco disaster.
Often I saw a verry low population, while other bots florished and killed them all.
Then there was only none or one left, and so next the animals died too.

I never tried that repro nor did I try viruses.. but I wonder what is the effect of mrepro ? I rarely see it used
Title: Alga pollinator
Post by: jknilinux on November 18, 2008, 11:16:31 PM
You're right, my second idea wasn't too good. The goal is an evolution-proof way of keeping the veggies from killing their overlords, but maybe we just can't do that here...

Well the way real life works is the prey need the predators to prevent prey de-evolution... look at the dodo- no predators, and in just a few million years it turned into a waddling buffet.

Wait a second...

I just came up with a third method- the prey kill themselves without the predators:
All veggies continually shoot venom. They are not immune to their own venom, so if there are too many, they kill each other. Then, there's a predator that has slight immunity to the venom, and keeps the algae from killing themselves by killing enough of them that they're widely separated.

So, we just need an instakill venom attack... Any ideas?

Not as fun as pollination, but oh well.


You mean how well does alga pollinator do? If you put it in there with A. Minimalis, it steals their genes in 200 cycles, kills them all in 500.

mrepro increases the chance of mutations occurring in offspring.
Title: Alga pollinator
Post by: peterb on November 19, 2008, 11:55:29 AM
Sory but I'd like to mention that I also liked your ideas.
Its slightly different aprouch to a problem (veggies have an easy life let them be more dependant on bots).
So I like what you tried, dont give up.
I'd like to see a good working bot using your ideas.
Good is when you say its ready

new ideas are always welcome I think; new ideas give new insights.
Title: Alga pollinator
Post by: jknilinux on November 19, 2008, 05:26:08 PM
Why thanks peterb.  

The thing is I can't get away from .sexrepro turning into .repro after long-term evolution. We could use DNA scripts, if they worked, to limit bots to only using .sexrepro, but they don't. Then we could use mutation protection for .sexrepro, but that doesn't protect against an insertion/point mutation somewhere else to make the bot use .repro. We could use only deletion and reverse mutations, but that's way too limiting. Maybe we could get away with it by having very high population diversity to start with, and because they all use .sexrepro, they'll still be able to evolve through sexrepro only... That's one option, but evolution will not be able to do much with that.

The other option is to allow them to evolve .repro, but somehow .repro will have to be selected against so the algae can't get too far with it. Any ideas?
Title: Alga pollinator
Post by: peterb on November 19, 2008, 06:01:23 PM
You know what, your ideas got me wondering....

I was thinking the folowing, what if a virus forced a sexrepro, in such a way..
That it gives any species the option for sexrepro, vegies and other animals..
Basicly even sexrepro in nature was invented once too, so thats not that strange.
Since its a form of replication a good change it think it will stay to exist. (depends on factors of virus spreading).
Since only the best mutations stay alive this might be a positive presure on DB evolution.

So a virus not killing the species, but maybe as a last resort infect another species with DNA pairs of its host who allow sexrepro.
These days in bioligy have noticed that sideways DNA mutations do happen (for example from a muscito to a human or plant).
It might not do much in the beginning, but the virus could only exist and multiply if it hosts also includes his DNA.
Maybe the plants reproduction method also uses only this virus


The virus not as an atacking mechanism as it is generaly used, but as a vehicle who exchanges DNA between species.
In origin the DNA could be plant based as origin.
But in the end even the plants might get updates trough DNA exchange.
Maybe the virus should only fire once or twice, maybe not even based on *.nrg level, but rather a few times based on a large cycle; like :  
cond
*.botage 1500 mod 1498 >
start
...

Well better do that in a non Cond form in form like a single gene bot.. but above is more easy to explain
it might be more complex since infected bots should shoot this gene also to other bots (eye5) so they get forced into sexrepro too.
..


ohyour question ***>> wel basicly most algey use *.nrg as a conditional selector for .repro;
by not using it the chance is lower that it will  ever happen based on that.
Its a factor of chance too,  even if .repro starts to exist or .mrepro; it still (since its random DNA) not be optimal tuned.

dough I have not done any viruses yet.
Title: Alga pollinator
Post by: jknilinux on November 19, 2008, 07:36:58 PM
Funny you should mention that, I made an algae that shoots viruses that make it's host use .sexrepro a few days ago... I'm including it here:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'love potion
'By: jknilinux
'It infects bots with a virus that makes them learn how to use .sexrepro

cond
*.robage 0 =
start
7 989 store
stop

cond
*.vtimer 0 =
start
3 .mkvirus store
stop

cond
7 *989 !=
start
0 .repro store
*.fertilized 0 >
*.nrg 20000 > and
33 .sexrepro store
not
*.refeye *.myeye =
*.refxpos *.refypos angle .setaim store
*.refvelup 30 add .up store
*.refveldx .dx store
-8 .shoot store
*.thisgene .mkvirus store
50 .vshoot store
not
-6 .shoot store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
50 .vshoot store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop

cond
*.fertilized 0 >
start
33 .sexrepro store
stop
end

Also, although the chance is low that there will be a working .repro instruction, after a few million cycles it will happen, and since .repro is so much more efficient than .sexrepro (because you don't have to wait for fertilization), they will probably quickly replace the existing .sexrepro veggies. The reason why real life plants and animals use sexrepro is because it allows them to evolve to new situations much more quickly. However, in DB, the environment is so featureless and has the same physics everywhere, so it has no benefit here.
Title: Alga pollinator
Post by: peterb on November 19, 2008, 07:43:54 PM
Quote from: jknilinux
Funny you should mention that, I made an algae that shoots viruses that make it's host use .sexrepro a few days ago... Here it is:

Ok I'll gonna try it

I tried it myself to with my now favorite algey depresivia (as it uses a *.pain; it became depresivia)
added this gene, dough it isnt that optimal (I dont wanted it to dominate but now its maybe still to weak I think) :

cond
start
*.thisgene .mkvirus store
*.botage 70 mod 68 sub sgn 1 sub sgn 1 add *.fertilized mult sgn 30 mult .sexrepro
*.eye5 50 floor 50 sub sgn refage 10 mod 8 floor 8 sub sgn -8 mult .shoot
*.botage 70 mod 68 sub sgn 20 mult .aimdx store
stop

dough its not that optimal, I modified ABnew3.txt (a single gene bot) so it could get infected.. so far it runs but the bot is still on the winning hand, nad I dont have an infected population yet
Title: Alga pollinator
Post by: peterb on November 19, 2008, 08:44:41 PM
well I tried your algey and also my algey with the single bot gene (and another single bot gene which I will include also)
The first single gene was a good finder / killer
while the second one is a poor older version who uses tie connect.

I had set it up in a small pond mode with  moon gravity, over a while you see the algey learn the trick of their predators.
Intresting, algea using tie and gowing up to catch light.. untill it crashed...
Sadly the programs seams to hang / crash often now (it never did that), this only started since the virus experiments.
(in  a way funny DEP also agrees its  a virus  doesnt allow code execution in data parts, thats DEP)



I'm not sure why that is, I also got warnings about DEP; I know what that is, but strange I wonder if the program is good handling the increase of DNA length (caused by virusses) I think the program doesnt correctly handle array memore reservations in case of virus infections.

If not then a virus should have some code or so that it wouldnt multiply to often inside a bot.
 (that would be hard to tackle)... Dough maybe its simple to solve.
increase a mem area by 1 each cycle
then each 7 cycles check if the virus has increased 7 (mod function) if the valeu is not ok then delete al virus genes. (easy since they all would use the same killgene code)
Title: Alga pollinator
Post by: Endy on November 19, 2008, 09:50:13 PM
You could use the epigenetic based conditions to make species specific genes. Still some chance that the behavior will be copied, but the odds are considerably less.
Title: Alga pollinator
Post by: jknilinux on November 19, 2008, 11:22:28 PM
Alright, I didn't notice the "virus immune" checkbox... My veggy works now.   

Code: [Select]
'Alga_Pollinator v 2.0
'By: jknilinux
'It infects bots with a virus that makes them pollinate it and spread the virus to other bots.

cond
*.robage 0 =
start
7 989 store
stop

cond
*.vtimer 0 =
start
3 .mkvirus store
stop

cond
7 *989 !=
start
*.thisgene 1 rnd 2 mult -1 add add .delgene store
*.eyef 0 =
10 .up store
not
*.refxpos *.refypos angle .setaim store
*.refvelup 5 add .up store
*.refveldx .dx store
-8 .shoot store
*.thisgene .mkvirus store
50 .vshoot store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
50 .vshoot store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop

cond
*.fertilized 0 >
*.nrg 5000 >          'Sometimes works better without this
start
33 .sexrepro store
stop
end

You can just run it with good ol' A. Minimalis, but you need to check "virus immune" on this veggy, otherwise the virus will infect it for some reason...

Now, it will infect bots with a virus that deletes their entire genome, and makes them instead pollinate algae. When they pollinate, the veggies will only get the virus code in them, but won't be infected by it, so now we have true pollination!

An interesting side note: once a bot is infected with the virus, it apparently messes up the refeye/myeye conspec system, so if an uninfected a. minimalis sees an infected one, it tries to kill it! Pretty interesting...
Title: Alga pollinator
Post by: jknilinux on November 20, 2008, 12:12:28 AM
Actually, never mind. The "virus immune" veggies are still getting infected. Another bug?
Title: Alga pollinator
Post by: peterb on November 20, 2008, 06:16:03 AM
Quote from: jknilinux
Actually, never mind. The "virus immune" veggies are still getting infected. Another bug?

Does your system crash too ?
Could you perhaps try it with my bots to verify what causes DB to crash?
If your system keeps running stable then I know a litle bit more as I would like to run it too.

I used in one sim:
your vegy
My vegy
my 2 bots in these post above here.


(what would be intresting to see then is that one bot uses .tie wile the other does not >> what will the algey perfer in pond mode (gravtiy = moon).
Title: Alga pollinator
Post by: jknilinux on November 20, 2008, 04:01:13 PM
Yeah, mine crashes all the time just from my one veggy of doom. Reinstalled DB- That helped a little, but not much.. Maybe you could try that. I think there's something going on with the viruses...

-------

EDIT:

Sorry for getting off-topic with these error reports. However, I found that DB works for the most part if you restart it each time before you run a sim. So, maybe that helps peterb.