Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Testlund on September 10, 2014, 08:49:07 AM
-
I'm trying to use venom to make a bot release all it's energy in random directions. How do I do that? I've tried this but it doesn't work:
cond
100 *.venval <
start
100 .strvenom store
stop
cond
*.eyef 0 >
*.refshoot 0 =
start
-3 .shoot store
.aimsx rnd .shoot .vloc store
-2 .venval store
stop
-
I found out myself. I have to use different eye distance values to be able to use more than one venom shot and to make it use feeding shots afterwards.
'*********************
'* Venemous Predator *
'* *
'*********************
cond
*.robage 0 =
start
67 .memloc store
101 67 store
0 .fixpos store
stop
cond
*.venom 50 <
start
1 .strvenom store
stop
cond
*.nrg 32 >
start
16 rnd .aimsx store
16 rnd .aimdx store
.up inc
stop
cond
*.eye5 0 >
*.memval *67 !=
*.refeye 0 >
*.reftie 0 =
*.reffixed 0 =
*.venom 16 >
start
*.refxpos *.refypos angle .setaim store
*.refvelup .up inc
stop
cond
*.eyef 5 >
*.eyef 20 <
*.memval *67 !=
start
-3 .shoot store
.aimsx .vloc store
314 .venval store
stop
cond
*.eyef 20 >
*.eyef 30 <
*.memval *67 !=
start
.fdbody .vloc store
128 .venval store
stop
cond
*.eyef 30 >
*.memval *67 !=
*.venom 100 <
start
128 .shootval store
-1 .shoot store
stop
cond
*.eye5 0 >
*.memval *67 =
start
314 rnd .aimright store
stop
cond
*.eye5 0 >
*.refeye 0 =
*.reftie 0 > or
start
-314 rnd .aimright store
stop
cond
*.shflav -1 =
*.shflav -6 = or
start
*.refxpos *.refypos angle .setaim store
.fixpos .vloc store
1 .venval store
-3 .shoot store
32 .dn 314 rnd .aimright store
stop
cond
*.body 16000 <
*.nrg 8000 >
start
2 .strbody store
stop
cond
*.body 16000 >
*.nrg 8000 >
start
50 .repro store
314 rnd .aimright store
stop
end
It would be nice if I also could make a bot explode into a cloud of nrg shots.
-
first it will never store up venom with that because 100 will never be less than -2
cond
*.venom 100 <
start
100 .strvenom store
stop
now this here is a mess
cond
*.eyef 0 >
*.refeye *.myeye != '(or whatever you want to use as recognizing)
start
-3 .shoot store
1 rnd 6 add .vloc store
-2 *.vloc 2 add sgn -1 mult 1 add mult 314 rnd *.vloc 6 sub sgn 1 add mult add .venval store
stop
random turn and a random -2 shot
i hope you have a good targeting system
...well fine then post while i'm posting lol
-
Actually ".strvenom" is correct.
http://wiki.darwinbots.com/w/.strvenom
Thanks for the code though. I will check it out.
-
oop sorry i kinda got use to mk and forgot str
edit: the cond was a bit off though
-
This makes the bot shoot info shots instead:
-2 *.vloc 2 add sgn -1 mult 1 add mult 314 rnd *.vloc 6 sub sgn 1 add mult add .venval store
I wanted a venom shot to cause another bot to behave like if it had this gene:
start
314 rnd .aimsx store
10 .fdbody store
-2 .shoot store
stop
But maybe that isn't possible to do.
I had this crazy idea that a venom shooting bot would cause another bot to do the above, and while it's doing it, the venom bot would make small bots close to the infected bot which would then feed it's offspring that way.
-
Code: [Select]
start
314 rnd .aimsx store
10 .fdbody store
-2 .shoot store
stop
But maybe that isn't possible to do.
actually i think i can manage that, shouldn't be too difficult. i'll work on it tonight.
-
What are all the features that you want in it?
-
Once the prey has been infected with venom I want the attacking bot to multiply close to the prey. I think I can do that myself unless you want to. :)
-
this is what you wanted but only works if continual shooting...
cond
*.venom 100 <
start
100 .strvenom store
stop
cond
*.eyef 50 >
start
-3 .shoot store
50 inc
0 50 *50 4 sub sgn 1 add mult store
.fdbody *50 sgn -1 mult 1 add mult .shoot *50 1 sub abs -1 mult 1 add mult .aimsx *50 2 sub sgn 1 add mult add add .vloc store
10 *50 sgn -1 mult 1 add mult -2 *50 1 sub abs -1 mult 1 add mult 314 rnd *50 2 sub sgn 1 add mult add add .venval store
store
btw your bot doesn't work very well, always turning away, not towards?
-
It turns out this doesn't work as well as I had hoped. Limitations in the program I guess. The bot can as well just use -1 shots instead. :sleep:
btw your bot doesn't work very well, always turning away, not towards?
Yeah, it's movement isn't very effective, but that's on purpose. I like to make bots that are good at different things and I try to make them work together in an eco system.