Bots and Simulations > DNA - General

Self Inflicting Virus

(1/2) > >>

kage:
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: ---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
--- End code ---

Please let me know what I did wrong

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:


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

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
--- End quote ---

kage:

--- 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:
--- End quote ---


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?

Numsgil:

--- 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?
--- End quote ---

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.

kage:

--- 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.
--- End quote ---


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.

Navigation

[0] Message Index

[#] Next page

Go to full version