How do you achieve not ( sniper and mg) tagless?

pier4r
Skynet
Skynet
Posts: 3390

How do you achieve not ( sniper and mg) tagless?

Post#1 » 23 Jan 2017, 21:00

Sometimes I would like to retreat or to avoid actions when a sniper and and mg are attacking the self bot.

Now the problem is to say "not ( sniper[attackingSelf, med range] and mg[attackingSelf, med range]". I do not mind to do this with one node, I'm fine with more than one.

I know that

Code: Select all

not (A and B ) = notA or notB


Indeed if I do two parallel nodes (that is the OR), say "not exist sniper[attackingSelf, med range] OR not exist mg[attackingSelf, med range]"

the first node will be true when there is no sniper attacking even if there is an mg attacking, the second node will be true only if there is no mg since the sniper for sure is there and is attacking (due to priority).

Am I missing something? maybe I'm tired but I'm not completely sure that it will work (for the moment I'm using AND and then tags, instead of "notA OR notB without tags"), especially when I extend to 3 conditions (say, adding "if not exist sg[attackingSelf, med range]".
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

Tralalo
Script
Script
Posts: 20

Re: How do you achieve not ( sniper and mg) tagless?

Post#2 » 23 Jan 2017, 21:15

If I understand correctly, can't you just put one after the other ?

If any sniper short/medium/long range attacking self exists
|
If any machinefun short/medium range attacking self exists
|
retreat

pier4r
Skynet
Skynet
Posts: 3390

Re: How do you achieve not ( sniper and mg) tagless?

Post#3 » 23 Jan 2017, 21:28

If you use positive assertions yes. I'm talking like "not". If "no (sniper and mg)" exist, then push.

Maybe I'm still not clear.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

Tralalo
Script
Script
Posts: 20

Re: How do you achieve not ( sniper and mg) tagless?

Post#4 » 23 Jan 2017, 21:39

Then isn't that what you explained in your first post ?

pier4r wrote:Indeed if I do two parallel nodes (that is the OR), say "not exist sniper[attackingSelf, med range] OR not exist mg[attackingSelf, med range]"

the first node will be true when there is no sniper attacking even if there is an mg attacking, the second node will be true only if there is no mg since the sniper for sure is there and is attacking (due to priority).


pier4r wrote:If "no (sniper and mg)" exist, then push

This means you can push if one of them doesn't exist (or both), so wouldn't this be fine ? :
Image

pier4r
Skynet
Skynet
Posts: 3390

Re: How do you achieve not ( sniper and mg) tagless?

Post#5 » 23 Jan 2017, 21:46

Eh, I'm asking exactly this - if it works - because I'm not sure if I miss a case in which one branch is active when I do not want to. Maybe is because I'm tired. On paper it works, in gladiabots I'm not sure (due to priority).
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

Tralalo
Script
Script
Posts: 20

Re: How do you achieve not ( sniper and mg) tagless?

Post#6 » 23 Jan 2017, 21:59

I'm not sure what you mean with priority in this case ? You have 4 possible scenarios :
If there is no MG nor Sniper : Left is true (since there is no MG) so you push
If there is a MG but no Sniper : Left is false, right is true (since there is no sniper) so you push
If there is no MG but there is a Sniper : Left is true, right is false so you push
If there is a MG and a Sniper : Left is false, right is false -> don't push

pier4r
Skynet
Skynet
Posts: 3390

Re: How do you achieve not ( sniper and mg) tagless?

Post#7 » 23 Jan 2017, 22:08

I mean with evaluation of the nodes. Yes definitely I'm tired, thanks for confirming that it works. Then Ritter in telegram said the same. So I have a way to be tagless on that and with the discussion we also created a little guide about OR and "not (A and B)" for the FAQ.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

sethcohn
Automaton
Automaton
Posts: 122

Re: How do you achieve not ( sniper and mg) tagless?

Post#8 » 23 Jan 2017, 23:21

+1, good explanation

User avatar
Aimer RC
Script
Script
Posts: 16

Re: How do you achieve not ( sniper and mg) tagless?

Post#9 » 23 Jan 2017, 23:36

pier4r wrote:Sometimes I would like to retreat or to avoid actions when a sniper and and mg are attacking the self bot.


Code: Select all

not (A and B) =/= notA or notB

not (A and B) = not (A and B) or not (B and A)


With this setup, priority doesn't matter:
Image

If you still want your AI to get active if only a sniper OR only a MG is attacking self, put Tralalo's example before this. ;) (To the left)

Return to “Questions”

Who is online

Users browsing this forum: No registered users and 1 guest