edited July 2022 in ORK Support
Hey hey :)

I'm trying to understand queued actions in Battle AI. I set up the AI below as a test, in my turn-based grid battle game. The goal is to move to the nearest target and then attack. The Action Use Mode of both the Grid Move and the Attack nodes is set to Queue. Then I attempt to loop through all Queued actions to execute them.

However, it doesn't work at all like I was expecting. The first turn, I can see the AI select a target node, but it doesn't move, and the Queued Action loop is never reached. The next turn the Queued Action Loop executes and the Move happens, to the cell selected the previous turn. This then continues - on alternate turns, a target Cell is selected, and then the following turn the Grid Move takes the combatant to the cell selected the previous turn.

How should I set things up to get the Queue execution I was looking for (Queue a Grid Move and Attack, then loop through them to execute them in the same Battle AI). Is that even possible?

(Note that normally I wouldn't do this - usually I have the move and attack in separate AI. Just doing this as a test to understand how the Battle AI queue works...).

Thx
Stevan :)

Edit : So I can get it to work how I would expect if I connect both the Gridmove node's Next and Reachable connections to the Attack node. But I still don't understand why it's behaving the way it is without the Reachable connected. In that case, regardless of whether the target is reachable or not, it still has the same behaviour - selecting a node one turn, and then moving to it the next.

image
Post edited by StevieJay on
  • The Grid Move node's Next slot is used if no grid move happens (e.g. if the combatant is already at the target or the target isn't reachable). When queueing the action (i.e. the battle AI doesn't exit here), the Reachable slot is used if a grid move action is used. So you need to connect both slots, to queue the attack if no move happens and for after the move.

    The 2 queued action nodes are not needed - the Queued Action node would only be needed if you want to exit the battle AI at a certain point by performing the first queued action. The queued actions will be used after the battle AI finishes executing anyway.

    Generally, I'd recommend using the combatant's battle AI settings to use a battle AI in queue mode and the Default use action mode in the battle AI nodes. Otherwise you might accidentally mix use and queue modes by accident.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ah, yeah - everything seems to work better when I set the combatant to use queue mode. Even though I manually set all the nodes to use queue in the AI, something appears to be going on to that messes with the queue when the combatant is themself not set to queue.

    Thanks for the info... :)
  • Another thing on AI... Is there a way to loop a Combatant's Battle AIs...?

    What I'd like to do is have all the Combatant's AIs loop until their Action Bar is exhausted - is there a way to do that? Or I would have to define that inside each Battle AI?

    Thx :)
  • Hm, you'd currently have to loop within the battle AI itself.
    The combatant's battle AIs are gone through once, possibly exiting at the first found action when not queueing the actions.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Okay, cool, thx for the reply.
Sign In or Register to comment.