Darwinbots Forum
Welcome To Darwinbots => Newbie => Topic started by: That One Guy on April 03, 2010, 10:08:27 AM
-
Hi. Im not really new to darwinbots but i am to coding my own bots and to the community. anyway i made this bot trying to test how some of the features work and to me it looks as though it should work and for the most part it does but my virus effects my bot so if you could would you help me ?[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Animal_Minimalis
'Contains everything necessary for it
'to survive and reproduce.
cond
.shoot -2 =
start
.shoot 0 store
stop
cond
*.eye1 0 =
*.eye2 0 =
*.eye3 0 =
*.eye4 0 =
*.eye5 0 =
*.eye6 0 =
*.eye7 0 =
*.eye8 0 =
*.eye9 0 =
start
314 .aimdx store
stop
cond
*.robage 0 =
start
.fixpos .vloc store
1 .venval store
stop
cond
100 *.poison >
start
100 *.poison sub .strpoison store
.shoot .ploc store
stop
cond
*.refeye *.myeye !=
*.eye5 0 >
start
.refvelsx .sx .store
.maxvel .up .store
'fire venom
-3 .shoot store
stop
cond
100 *.venom >
start
100 *.venom sub .strvenom store
stop
cond
*.nrg 20000 >
start
.repro store
stop
cond
start
-2 .shoot store
*.thisgene .mkvirus store
50 .vshoot store
stop
cond
*.eye1 0 >
start
30 .aimsx store
stop
cond
*.eye2 0 >
start
30 .aimsx store
stop
cond
*.eye3 0 >
start
30 .aimsx store
stop
cond
*.eye4 0 >
start
30 .aimsx store
stop
cond
*.eye6 0 >
start
30 .aimdx store
stop
cond
*.eye7 0 >
start
30 .aimdx store
stop
cond
*.eye8 0 >
start
30 .aimdx store
stop
cond
*.eye9 0 >
start
30 .aimdx store
stop
end
its based on animal minimalis but i scraped most of its code. my big problems as i said are the virus affecting my bot (i tried to stop that with gene 1) also my poison doesn't seem to be firing. I was thinking of implementing a sexual reproduction gene but that seemed a little confusing. one last thing do you think the virus should stun and the venom make them shoot energy or the other way around like it is now? thanks
-
For the virus, put this as a condition:
*971 79 !=
Then put this as a gene in your bot:
cond
*971 79 !=
start
79 971 store
stop
Then you have to use another gene to fire your virus. Put this before your virus:
cond
start
*.mkvirus 0 =
*.nrg (whateverItNeedsToBe) > and
*.thisgene 1 add .mkvirusstore
*.vtimer 1 =
100 .vshoot store
stop
Also you can't fire poison, its automatically fired at enemies in place of -2 shoots when they fire -1 shots at you.
-
'Animal_Minimalis
'Contains everything necessary for it
'to survive and reproduce.
cond
start
*.mkvirus 0 =
*.nrg 500 > and
*.thisgene 1 add .mkvirusstore
*.vtimer 1 =
100 .vshoot store
stop
cond
*971 79 !=
start
79 971 store
stop
cond
*.eye1 0 =
*.eye2 0 =
*.eye3 0 =
*.eye4 0 =
*.eye5 0 =
*.eye6 0 =
*.eye7 0 =
*.eye8 0 =
*.eye9 0 =
start
314 .aimdx store
stop
cond
*.robage 0 =
start
.fixpos .vloc store
1 .venval store
stop
cond
100 *.poison >
start
100 *.poison sub .strpoison store
.shoot .ploc store
stop
cond
*.refeye *.myeye !=
*.eye5 0 >
start
.refvelsx .sx .store
.maxvel .up .store
'fire venom
-3 .shoot store
stop
cond
100 *.venom >
start
100 *.venom sub .strvenom store
stop
cond
*.nrg 20000 >
start
.repro store
stop
cond
*.eye1 0 >
start
30 .aimsx store
stop
cond
*.eye2 0 >
start
30 .aimsx store
stop
cond
*.eye3 0 >
start
30 .aimsx store
stop
cond
*.eye4 0 >
start
30 .aimsx store
stop
cond
*.eye6 0 >
start
30 .aimdx store
stop
cond
*.eye7 0 >
start
30 .aimdx store
stop
cond
*.eye8 0 >
start
30 .aimdx store
stop
cond
*.eye9 0 >
start
30 .aimdx store
stop
end
I changed it to this and now no virus is firing at all!
not ur fault im just not too good...
-
Move this gene right before your virus. It makes and fires the gene after it. By the way, where did your virus gene go?
cond
start
*.mkvirus 0 =
*.nrg 500 > and
*.thisgene 1 add .mkvirus store
*.vtimer 1 =100 .vshoot store
stop
Also it should have been firing your second gene as a virus anyway, but it didn't because a typo in the code. My bad, I fixed it.
-
The replicator code should really be inside the virus. Not only does that make the virus copy itself in new hosts, it also prevents infections from shifting the DNA and messing it up (this is only really important if the opponent also uses viruses.)
-
But how do you put it in the virus without having the virus activate inside your bot?
-
The point is to have the conditions inside the virus, not outside.
Which reminds me, the virus should only activate after robage > 0. You have no idea how many times a virus went wrong for me because it was inserted as the first gene and screwed everything up on reproduction.