QoL: Condition SubAIs

Mahrgell
Script
Script
Posts: 12

QoL: Condition SubAIs

Post#1 » 20 Aug 2018, 20:30

As this was just derailing another suggestion here, has been often asked for in the Discord and the old threads regarding it felt very cluttered and unprecise, I'm just starting a new thread here for it.

So what would be desirable is a Sub-AI that works exactly like a condition.

How to implement this so it feels like current AI programming in the game?

Simple: You can choose between either creating a (Sub)AI (as it is right now) or a new SubCondition.

- A SubCondition can not be selected as script to run for a bot.
- A SubCondition can not contain any action nodes except tagging.
- While when creating a normal AI, you get an empty file with just a root node, you actually get 2 nodes when creating a SubCondition.
- The root node, as normal, and a single freely movable RETURN node. The RETURN node is treated like an an action, thus you can link to it, but not from it.

Now when a SubCondition is encountered inside a script, the evaluation on it is launched like if it would be a normal SubAI. The moment the RETURN node is encountered you return from the SubCondition and consider the SubAI true and the evaluation continues to whatever is linked behind it. If the SubCondition evaluation is finished and the RETURN node is not reached the SubCondition is considered false.

Bonus candy points if it is possible to Invert a SubCondition like it can be done with normal conditions.


So all that is required is effectively one new node, which is preset in this new kind of SubCondition. Reach it -> true, Don't reach it -> false.

That would be a very simple system and not change the character of the game or its coding in any way. It would also not add any new possibilities to the game... all that can be done right now too, you just have to copy paste the conditions to every place massively cluttering the code.


And I even prepared a wonderful visual demo:

Our SubAI
Image

One of our Bots using it:
Image

So the SubCondition is passed if the closest enemy is a shotgun moving to a res and we also see a res that someone moves to. If that's not the case, RETURN is never reached thus the SC is false.

If it was just one bot using it in one place, we wouldn't gain anything here. (except way more readable code... a benefit in it self)
But if we now had another bot, who would also want to act on the sneaky thief... But a different reaction, e.g. try to snatch the Res himself, shoot at any range or run to the closest enemy base, whatever you want... We could reuse it.
And if we later decide that this condition needs some changes, because, e.g., we want to also include Assaults as sneaky thieves, we only have to change one node. Instead of every occurrence scattered everywhere. And this is obviously a very simple example.

E.g. a SubCondition could als compare who has more Res in his half... Thats a decent number of nodes, potentially all bots could use it but react differently... Having to paste it everywhere is a massive annoyance.

sollniss
Automaton
Automaton
Posts: 178

Re: QoL: Condition SubAIs

Post#2 » 21 Aug 2018, 01:34

Why not this?
chkless.PNG
chkless.PNG (113.88 KiB) Viewed 862 times

chkless2.PNG
chkless2.PNG (166.14 KiB) Viewed 862 times

User avatar
Gilberreke
Hello World
Hello World
Posts: 8

Re: QoL: Condition SubAIs

Post#3 » 21 Aug 2018, 01:59

massive +1

pier4r
Skynet
Skynet
Posts: 3390

Re: QoL: Condition SubAIs

Post#4 » 21 Aug 2018, 12:22

and also here. viewtopic.php?t=175
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: QoL: Condition SubAIs

Post#5 » 21 Aug 2018, 12:24

pier4r wrote:and also here. viewtopic.php?t=175


Please check existing threads before posting :(

Mahrgell
Script
Script
Posts: 12

Re: QoL: Condition SubAIs

Post#6 » 21 Aug 2018, 12:28

And i knew this thread. And referenced it in my first paragraph.

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: QoL: Condition SubAIs

Post#7 » 21 Aug 2018, 12:42

Then why did you create a new thread?

Mahrgell
Script
Script
Posts: 12

Re: QoL: Condition SubAIs

Post#8 » 21 Aug 2018, 22:49

That's mentioned half a sentence later...
You might not agree with the reasons, but asking for them is kinda ...

And I still feel, that unlike the previous thread which had a lot of general ideas but no real "how to implement it" this is a very concrete implementation idea and different enough to deserve a new thread.

But I guess you are too busy arguing other stuff so you won't care.

pier4r
Skynet
Skynet
Posts: 3390

Re: QoL: Condition SubAIs

Post#9 » 22 Aug 2018, 11:27

Mahrgell, the tone is not helping the discussion.

And also having 38 threads on the same request, while single threads may be more or less "clear" than the others, doesn't help for a global overview. Having everything in one place at least helps to not lose track of the popularity of a request.

Last but not least, even if you suggest a more defined implementation, it doesn't mean that it will be implemented as you wrote. That is decided by GFX. We suggest only ideas, he picks what to do. Even cherry picking is ok. It is his game, we may enjoy it or not.

Also by experience I know that GFX gets on some request, only it takes time. The game was already amazing in alpha 5.3.1 , now it is ultra amazing (especially with multiple nodes copy and paste in the editor) there is no hurry.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

Return to “Feature Requests”

Who is online

Users browsing this forum: No registered users and 2 guests