Page 1 of 2

conditional subtrees

Posted: 18 Dec 2016, 07:42
by HDeffo
Essentially allow a subtree without action nodes to act as a condition where it'll show green only where any full tree extension in the subtree shows green and reached a dead end. This will allow players to make their own more complex conditionals without actually adding more complicated items like variables or functions

Re: conditional subtrees

Posted: 18 Dec 2016, 08:11
by Kanishka
Can you elaborate? :?

Re: conditional subtrees

Posted: 18 Dec 2016, 08:17
by ConsciouS-0nE
IMG_20161218_151603.png
You wanted the left one?
But with action node?
IMG_20161218_151603.png (35.39 KiB) Viewed 2341 times
Wont work on just an ai full of conditions? Until it reaches dead and then execute the action 'beside'(not below)

Re: conditional subtrees

Posted: 18 Dec 2016, 10:56
by NullPointer
Good idea, there are still some parts of my AIs I can't reuse because subtrees can't have children nodes and need to end in an Action.

Maybe we could have a Return Action.

Re: conditional subtrees

Posted: 18 Dec 2016, 11:25
by Christian
Would be needed for trees that calculate a condition.

Re: conditional subtrees

Posted: 18 Dec 2016, 12:12
by GFX47
Let's keep it for later (https://trello.com/c/lkTsTRuo/347-condi ... -sub-trees).
It's another concept that seems a bit hard to teach without specific tutorials.

Plus, I'd like to wait for more feedback to see how the current version of the system is understood and used.

Re: conditional subtrees

Posted: 18 Dec 2016, 23:09
by The Eye
Basically, we're asking for procedure nodes, right? Go to MIT App Inventor 2, if you don't understand. Like this:

Image
Image

Re: conditional subtrees

Posted: 25 Jan 2017, 15:42
by sethcohn
As I mentioned on the trello card, require these AI to begin and end with a single connector, and then it shouldn't be hard to implement

Think of a complex and/or setup, turning it into a simple subnet rather than rebuilding it each time. "If A And B and not C and not D but if E then"

If you allowed multiple input/output connectors, the subnet linking would get harder to UI so I'd avoid that. This way it's either true or false, one path in, one path out

Re: conditional subtrees

Posted: 25 Jan 2017, 17:39
by pier4r
I cannot at the moment but a mockup can be even a sketch on paper

Re: conditional subtrees

Posted: 25 Jan 2017, 17:59
by ConsciouS-0nE
Got me a light bulb from my previous post above.

Screenshot_2017-01-26-01-02-36.png
Screenshot_2017-01-26-01-02-36.png (60.24 KiB) Viewed 2265 times
Screenshot_2017-01-26-01-04-59.png
Screenshot_2017-01-26-01-04-59.png (65.65 KiB) Viewed 2265 times


Hdeffo hax

Re: conditional subtrees

Posted: 25 Jan 2017, 19:29
by sethcohn
What he said. Good illustration.

Re: conditional subtrees

Posted: 25 Jan 2017, 20:04
by sethcohn
NullPointer wrote:Good idea, there are still some parts of my AIs I can't reuse because subtrees can't have children nodes and need to end in an Action.

Maybe we could have a Return Action.


Actually, I'm using bot tags to implement the equivalent of return actions.
I need to refine it better and do a illustration. edit: done now...
Screenshot_2017-01-25-19-19-36.png
Screenshot_2017-01-25-19-19-36.png (176.48 KiB) Viewed 2239 times

To run this demo, test arena team play (or any really), set all others to an idle AI, change the second enemy to a non assault.
Watch the bugger scurry back and forth get ever closer until he finally fulfills the end conditions.

But essentially:

self bot tag 1 if filter conditions
If self bot tag 1(you can also do If not, working out the differences now)
-- go subtree XYZ (etc)
next item after

in subtree XYZ:
do whatever
when ready to return: remove self bot tag1 (or add bot tag if you did If Not)

Re: conditional subtrees

Posted: 26 Jan 2017, 01:28
by sethcohn
Updated above with demo AI

Re: conditional subtrees

Posted: 26 Jan 2017, 01:41
by sethcohn
Also, doesn't have to be self tags... tag an enemy, or a base, etc... lots of options. The key is the conditional has to be placed earlier than the usage elsewhere, so it interrupts the tree scan and runs next.

Re: conditional subtrees

Posted: 26 Jan 2017, 01:43
by sethcohn
And of course these could be placed in a subtree... I didn't for the sake of the single AI demo.

Re: conditional subtrees

Posted: 26 Jan 2017, 01:47
by pier4r
Thanks for sharing. I should remember to put it in the faq

Re: conditional subtrees

Posted: 26 Jan 2017, 01:51
by sethcohn
Unrelated but I decided to put it in the above demo: I intentionally used the "Move Toward Enemy that I'm not moving toward" to force the bot to only take small steps each time, and iterate more for demo purposes so when you watch in the debugger, you see it running thru most of the loops repeatedly...

Re: conditional subtrees

Posted: 22 Feb 2017, 12:02
by Uthael
Unaware of this topic (didn't manage to find it on Trello), I created mine. Here's the OP quoted. I think it would make for a good implementation of this idea.

Uthael wrote:Here, the idea is to turn at least a half of the mess on the screen into small black boxes that refine inputs into outputs.

At the moment, connectors serve only to make your AIs visually tidy. They do that perfectly. But configuring them is greyed out. Sooo... How about marking a connector as an output? The sub-VI name would get extra dots on the sides or below it, depending on the number of outputs it has. The order of those dots is the same as the order of connectors in the sub-VI.

Now, I'm not sure how the game code is written, but this may also solve the "complex AI loading time" problem (if loading is segmented or the visual representation of the AI causes the problem). But even if it lenghtens that time slightly, the convenience of not having to add, configure and link several modules again and again would be worth it.

Edit: Yeah, in Mass Effect they differentiate Virtual Intelligence and Artificial Intelligence. Sentient software (AI) may be intelligent, but just a VI can't be sentient. I like that and got used to that :D

Re: conditional subtrees

Posted: 28 May 2018, 18:13
by ElvenMonk
+1 for conditional sub-ai and placeholder action.

Re: conditional subtrees

Posted: 01 Jun 2018, 22:25
by sollniss
This is easily possible with tags now. I use it in my AI a lot.