Author Topic: Self Inflicting Virus  (Read 4502 times)

Offline kage

  • Bot Neophyte
  • *
  • Posts: 49
    • View Profile
Self Inflicting Virus
« on: November 27, 2006, 06:24:42 PM »
Hey, I'm really new to DB and have had a problem making my bot. I basically copied the animal minimalus in the tutorial made to generate viruses, but altered it slightly.  My goal was to make them cause the other bots to reproduce so rapidly that they died, but it seems to infect my own bots right at the start before they can generate the virus. Here is the coding I have for it:

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

cond
 *.vitmer 0 =
start
50 .repro store .mkvirus store
stop

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

cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 50 .vshoot store
stop

cond
 *.eye5 50 >
 *.refeye *.myeye !=
start
-1 .shoot store
 *.refvelup .up store
stop

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

cond
 *.nrg 15000 >
start
 30 .repro store
stop
end

Please let me know what I did wrong
« Last Edit: November 27, 2006, 06:25:55 PM by kage »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Self Inflicting Virus
« Reply #1 on: November 27, 2006, 06:55:41 PM »
Welcome.  DNA takes a bit of practice, but you should be able to pick it up fairly quickly.

The problem is that you replaced code in the wrong places.  The first gene is the one that fires the virus.  The second one is the actual virus.  Here's what I think you meant to do:

Quote
cond
  *.vtimer 0 =
 start
3 .mkvirus store
 stop
 
 cond
  7 *989 !=
 start
  50 .repro store
 stop

That should do what you want (just replace the 2nd and 3rd genes in your bot with these.

This is a little more stable against viruses infecting your own bots:

 
Quote
cond
   *.vtimer 0 =
  start
 *.thisgene 1 add .mkvirus store
  stop
 
  cond
   7 *989 !=
  start
   50 .repro store
  stop

Offline kage

  • Bot Neophyte
  • *
  • Posts: 49
    • View Profile
Self Inflicting Virus
« Reply #2 on: November 27, 2006, 07:38:04 PM »
Quote from: Numsgil
Welcome.  DNA takes a bit of practice, but you should be able to pick it up fairly quickly.

The problem is that you replaced code in the wrong places.  The first gene is the one that fires the virus.  The second one is the actual virus.  Here's what I think you meant to do:
That should do what you want (just replace the 2nd and 3rd genes in your bot with these.

This is a little more stable against viruses infecting your own bots:


Thank you, it makes more sense now.

Sorry if this is a really stupid question, but how do you change values to make the virus fire after you have started a simulation and the virus has been generated?
« Last Edit: November 27, 2006, 07:51:24 PM by kage »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Self Inflicting Virus
« Reply #3 on: November 27, 2006, 08:48:25 PM »
Quote from: kage
Sorry if this is a really stupid question, but how do you change values to make the virus fire after you have started a simulation and the virus has been generated?

Not at all, ask as many stupid questions as you want.

.mkvirus will cause the virus to begin being created.  This will take a while, depending on the length of the virus in question.  The time left is given by .vtimer.  Once vtimer reaches 1, the virus is ready to fire.  You then need to fire it using .vshoot.

The DNA as is constantly tries to fire the virus wether it's ready or not if there's a target visible (another bot that's not the same species).  If you take out the vshoot line, and start a new gene with a *.vtimer 1 = in the condition and the vshoot line in the body, you'll have more control over when it fires.

Offline kage

  • Bot Neophyte
  • *
  • Posts: 49
    • View Profile
Self Inflicting Virus
« Reply #4 on: November 27, 2006, 09:25:31 PM »
Quote from: Numsgil
Not at all, ask as many stupid questions as you want.

.mkvirus will cause the virus to begin being created.  This will take a while, depending on the length of the virus in question.  The time left is given by .vtimer.  Once vtimer reaches 1, the virus is ready to fire.  You then need to fire it using .vshoot.

The DNA as is constantly tries to fire the virus wether it's ready or not if there's a target visible (another bot that's not the same species).  If you take out the vshoot line, and start a new gene with a *.vtimer 1 = in the condition and the vshoot line in the body, you'll have more control over when it fires.


Okay thanks, I thought that I had to change some coding halfway through a sim somehow, but if it fires whether I try to or not, thats a lot simpler. Now I just need to figure out a way to keep them alive long enough for them to fire, lol.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Self Inflicting Virus
« Reply #5 on: November 28, 2006, 12:48:43 AM »
Quote from: kage
Now I just need to figure out a way to keep them alive long enough for them to fire, lol.
One of the biggest issues for bots dying for new users is waste.  If you have a waste threshold set, but your bots don't have a gene to deal with waste, they will die fast.  You should set your waste threshold to -1 unless you bots have a gene to deal with waste buildup.

You might also want to turn off costs while your building your bots, until/unless you are ready to run an evo sim.

Welcome aboard!
Many beers....

Offline kage

  • Bot Neophyte
  • *
  • Posts: 49
    • View Profile
Self Inflicting Virus
« Reply #6 on: November 28, 2006, 06:39:35 AM »
Quote from: EricL
One of the biggest issues for bots dying for new users is waste.  If you have a waste threshold set, but your bots don't have a gene to deal with waste, they will die fast.  You should set your waste threshold to -1 unless you bots have a gene to deal with waste buildup.

You might also want to turn off costs while your building your bots, until/unless you are ready to run an evo sim.

Welcome aboard!


Thank you as well.