Page 1 of 1

Being able to test conditions on objects that passed previous conditions

Posted: 30 Dec 2016, 22:10
by pier4r
Thanks to the post of trigary (1) I started to reflect how to make an and between tags. The problem is that filter options before tags were mutually exclusive, so using an or was quite natural.

Cannot be that an enemy is carrying and not carrying resources.
Cannot be that an enemy is at the same time at short and long range.
Cannot be that an enemy has shield between 75 - 100 and between 0 - 25.
Same for health .

But can be that a bot has multiple tags.

Now this is not so easy to filter with conditions because a condition is tested on the items regardless of the "selection output" of previous conditions.

So a player cannot say : select with one condition all the bots with tag 1 and if those, apply another condition to select those also with tag 2. In other words I cannot really simulate filters (to narrow a selection) with multiple conditions.

So my request is : being able to apply to the same selected items multiple conditions. This would be possible with currently targeted for example, although CT would contain only one item, because this is passed along different conditions that test on the same object.


(1)http://gfx47.com/games/Gladiabots/Forum/viewtopic.php?f=6&t=236#p2465

Re: Being able to test conditions on objects that passed previous conditions

Posted: 30 Dec 2016, 22:17
by Ritter Runkel
+1

had exactly the same problem when I wanted to filter all bots not tagged A and not tagged B

Re: Being able to test conditions on objects that passed previous conditions

Posted: 30 Dec 2016, 22:47
by Trigary
Yes, I also believe something should be done. I think the easiest solution would be to add a tickbox which changes the filter category's "boolean logic" from "OR" to "AND" (obviously this would only be enabled for BotTag and TeamTag categories) or to create a copy of that category (for example: are 2 BotTag categories, in the first one you tick BotTag1, BotTag2; in the second one you tick BotTag3, BotTag4 -> if the bot is tagged with [1 or 2] AND [3 or 4] it goes through the filter (combinations: 1+3; 2+3; 1+4; 2+4)). These, especially the second might be difficult to understand at first, but you only have to figure these out once :)

Re: Being able to test conditions on objects that passed previous conditions

Posted: 31 Dec 2016, 00:54
by HBomb
+1
However it gets done, NotBot1 AND NotBot2 would be spiffing.

Re: Being able to test conditions on objects that passed previous conditions

Posted: 31 Dec 2016, 01:06
by Ritter Runkel
A negation could work.

NOT tagged 1 AND NOT tagged 2
Equals
NOT (tagged 1 OR tagged 2)

Works for if conditions, bit not for actions

Re: Being able to test conditions on objects that passed previous conditions

Posted: 31 Dec 2016, 01:08
by NullPointer
Maybe GFX could fix this by splitting filter categories this way:

BotTag
- BotTagged1
- BotTagged2
- NotBotTagged1
- NotBotTagged2

to

BotTag1
- BotTagged1
- NotBotTagged1

BotTag2
- BotTagged2
- NotBotTagged2


Then you can do

NotBotTagged1 AND NotBotTagged2

because "AND" exists only between filter categories.

Re: Being able to test conditions on objects that passed previous conditions

Posted: 31 Dec 2016, 05:59
by HBomb
NullPointer wrote:BotTag1
- BotTagged1
- NotBotTagged1

BotTag2
- BotTagged2
- NotBotTagged2


Filters menu would be cluttered as duck.


I'd take it.

Re: Being able to test conditions on objects that passed previous conditions

Posted: 31 Dec 2016, 10:01
by GFX47
NullPointer wrote:Maybe GFX could fix this by splitting filter categories this way:

BotTag
- BotTagged1
- BotTagged2
- NotBotTagged1
- NotBotTagged2

to

BotTag1
- BotTagged1
- NotBotTagged1

BotTag2
- BotTagged2
- NotBotTagged2


Then you can do

NotBotTagged1 AND NotBotTagged2

because "AND" exists only between filter categories.


That's what I plan to do even if it will make the filter list cluttered like Hbomb said.

Re: Being able to test conditions on objects that passed previous conditions

Posted: 31 Dec 2016, 10:08
by Kanishka
Not necessarily. You could do:
BotTag
- BotTag1
- BotTagged1
- NotBotTagged1
- BotTag2
- BotTagged2
- NotBotTagged2

Like this. Would be convenient. No cluttering.

Re: Being able to test conditions on objects that passed previous conditions

Posted: 31 Dec 2016, 14:20
by pier4r
Ritter Runkel wrote:A negation could work.

NOT tagged 1 AND NOT tagged 2
Equals
NOT (tagged 1 OR tagged 2)

Works for if conditions, bit not for actions


Exactly with de Morgan one can play a bit but it is limited since actions have no "not"

Re: Being able to test conditions on objects that passed previous conditions

Posted: 01 Jan 2017, 21:16
by Wooolf
Hello,
My first post here, in league 3 currently.

I believe this can be currently implemented using recursion. I wrote a subtree that successively tests a condition on all enemy bots in a perdetermined order for example closesness.

Re: Being able to test conditions on objects that passed previous conditions

Posted: 02 Jan 2017, 03:57
by Ritter Runkel
How did you do that?

Re: Being able to test conditions on objects that passed previous conditions

Posted: 02 Jan 2017, 05:04
by Wooolf
Has someone requested an AI export option?..

This is my structure:
-Recursive sub tree
--If any bottag4 enemy not exist
---1. Exclusvbottag4 shotgnclass bottagged5 enemy
---2. Bottag5 closest notbottaged5 enemy

It's not TRULY recursive because the tree is evaluated from the start every cycle but the 5 tag is used to mark the bots satisfying condition 1 (in this case closeness order) and condition 2 is marked by tag4 in this case "is shotgnclass class". It takes a few cycles to find the match because it needs to go over all the bots that satisfy condition 1...

Re: Being able to test conditions on objects that passed previous conditions

Posted: 02 Jan 2017, 05:22
by HBomb
Wooolf wrote:Has someone requested an AI export option?..

This is my structure:
-Recursive sub tree
--If any bottag4 enemy not exist
---1. Exclusvbottag4 shotgnclass bottagged5 enemy
---2. Bottag5 closest notbottaged5 enemy


Firstly, welcome to the nerd forum! :)

Can you show me how I would achieve the following action using your subroutine? I can't see it myself.

"Shoot closest enemy that is Tag1 AND Tag2?"

And out of curiosity: If it works, how many ticks would it take?

And in answer to your question, yeah it's been requested. Check the roadmap (queue someone with the link?)

EDIT: Goddammit, autocorrect...

EDIT2: I've just read your post a handful of times and I think I get what you're saying now. If I'm reading it right, you apply an end tag to an object fitting a series of conditions that you check recursively, right? Our issue is that we can't perform actions specifically referring to targets that must have multiple tags.

That said, what youve got does allow counting up to three(plus) and is a useful stand-in until GFX puts counting in officially... Although the tag-counting takes an impractical length of time.

Re: Being able to test conditions on objects that passed previous conditions

Posted: 02 Jan 2017, 06:47
by Wooolf
to do what you want replace "shotgnclass" filter with tag1 filter. And add bottaggd2 filter to ---2.
The general version:

-Recursive sub tree
--If any bottag4 enemy not exist
---1. Exclusvbottag4, tagged1, bottagged5 enemy
---2. Bottag5 closest, tagged2, notbottaged5 enemy

it does is it checks the tagged2 bots one at a time for tag1

I am not sure I understand how you use this for counting...

BTW, aren't the filters AND anyway?
So you could do
Tag3 closest enemy, filters: tagged1,tagged2