Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: kage 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:
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
-
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:
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:
cond
*.vtimer 0 =
start
*.thisgene 1 add .mkvirus store
stop
cond
7 *989 !=
start
50 .repro store
stop
-
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?
-
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.
-
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.
-
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!
-
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.