• Yes. I did mean control maps. =) thanks. Selecting Control Maps fixed the problem.
  • Mind if I use this thread to ask a few more questions about AI?
  • No, go ahead :)
    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!
  • edited December 2019
    Alright. Some of this is just making sure I'm understanding how the AI system works right so I might try to explain things in my own language.
    1. I think I'm not totally understanding how AI Rulesets interact with AI Behaviors. In the tutorial for that they both say they are executed in the order their listed. Is it like:
    For a given equipped AI Ruleset and AI Behavior
    AI Rule 0 applies to Battle AI 0
    AI Rule 1 applies to Battle AI 1
    etc?

    2. Am I correct in thinking that for a typical Final Fantasy / Dragon Age party member AI of:
    If (Condition A) (Use Ability 0) else
    If (Condition B) (Use Ability 1) else
    etc,
    the "If (Condition X)" part of that would be handled by AI rulesets, that the various abilities to be used ranked in terms of priority would be handled by the AI Behavior. And that each specific instance of "(Use Ability X)" would be it's own Battle AI?

    3. Is there a way to include movement commands in Battle AI's or AI Behaviors? Currently I've created an ability which enemies have whose event moves them to within 2 yards of the targeted unit and they have a Battle AI which executes that ability if their target is more than 2 yards away. But I'm wondering if there is a better way of handling it?

    (EDIT: I deleted my fourth question because I figured out the answer right after posting this.)
    Post edited by Whatexists on
  • 1) No, AI rulesets apply to all battle AIs.

    First of all, AI behaviours are basically equipable battle AIs and are used before the battle AI set up in the combatant (i.e. if equipped AI behaviours don't find an action to use, it'll fall back to the combatant's battle AI). They can also change the move AI.
    E.g. use them to change the role of a combatant, like attacker (using attack abilities and a move AI to hunt targets) and supporter (using support/healing abilities and staying away from the enemy).

    AI rulesets define rules for all battle AIs, e.g. blocking certain actions, prioritizing certain targets, but also using a certain action or battle AI.

    2) Yes and no :)
    Generally, you can set that up just in battle AIs. If you want to use rulesets for that, you can use an Action rule and use the User Requirements and (optionally) an additional Target rule with requirements for conditions.
    The rulesets are checked in the order they're equipped, i.e. if slot 0 isn't used, it'll check slot 1, etc.

    3) Yes, all 3 of them can change the move AI. The battle AI has Move AI nodes, the AI Behaviour has Move AI Settings and AI Rulesets have Move AI rules.
    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!
  • 1. So with Rulesets then how does that play out? Would it be like: Check if Ruleset 0 will apply to the battle AI, if it does apply it, else check if Ruleset 1 applies, etc?

    2. So then do a combatant's personal battle AI's also execute in the order they're listed in under Battle Settings > AI settings? Meaning that for an NPC that doesn't need to have it's AI swapped around by a player (such as an enemy who only has one combat role) you can just set up it's whole AI using a series of battle AI's and ignore AI Behaviors entirely?

    3. I've currently been finding that when I try to use the move AI (by having the "Close with Enemies" battle AI use a Move AI node to swap their move AI mode to Hunt from Auto instead of using an Ability Node to use the before mentioned "Move to target" ability) the enemies AI will interrupt their move by constantly using their attack abilities at random (including abilities their other Battle AI's don't include instructions for using.) I'm sure I'm doing this wrong but don't really know how.
  • 1) Well, it's a bit more complicated than that and depends on what your AI rulesets do - it works like this if an AI controlled combatant selects an action (in that order):
    - checks rulesets for actions (i.e. Action and Battle AI rules)
    - checks behaviours
    - checks battle AI
    First of them that returns an action will be used.

    Each action that is selected will be checked if it can be used - which also checks the rulesets (e.g. if an ability is blocked via a Block Ability rule). If the action can't be used due to that, the AI continues searching for an action (i.e. the order above).

    If an action is found and can be used, it'll set the action's targets - which also checks the rulesets for Target rules.

    2) Yes, battle AI's are used in the order they're added.
    AI behaviours/rulesets are completely optional and you'd probably only use them if you want to create a flexible system to e.g. influence your AI controlled party members, like in Final Fantasy XII's gambit system

    3) Combatants will use their base attack if none of their battle AIs found an action. If you want a combatant to do nothing if the AI doesn't find something, you need to set up a battle AI with a None action and add it as the last battle AI of the combatant.
    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!
  • 1. So Battle AI's are base level AI programming. Behaviors let you string multiple different Battle Ai's together with an order of priority. And Rulesets create a sort of... over-everything framework that everything gets checked against in case you want certain rules or behaviors to over-ride everything else?

    2. Excellent. Thank you.

    3. I've included a None action at the bottom of the AI stack. Now if they're not close enough to use their basic attack Battle AI they end their turn. How do I have a battle AI tell them to close with their target until their within range 2, then move on to other battle AI's?
  • 1) Pretty much, yes :)

    3) If you're using grid battles, you'd use the Grid Move action for that.
    Otherwise, you can use the Move AI nodes to change the move AI (although the battle AI will still continue and use an action) - however, you can use actions even with targets out of range and the move AI will move within range before using them.
    For this, make sure to disable Need Targets in the action's node and that the use range (where you're probably using a battle range template) has Move Into Range enabled (should be on by default).
    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!
  • 3. We're considering switching to grid battles. So far I've been impressed with what I've seen there. :)
    But that does explain the problem. My basic attack abilities don't have use ranges. They're relying on activating a damage dealer on the weapon and using an animation to hit the target. I made it that way specifically so that players could make attacks while out of range. I guess I can make copies of the abilities for NPCs to use and set their use ranges appropriately.

    4. Alright, on a totally different but still battle AI sort of related front: is there a way to do PVP? To set up two opposing player controlled factions? I'm not worried about various control schemes or networks or anything like that right now. It'd be fine to have people standing at the same computer and swapping use of the same mouse/keyboard.
  • 3) The range settings (for non-grid battles) can optionally only be used by AI controlled combatants by enabling Only AI Controlled. So your player can keep swinging the sword around and AI combatants will use the use ranes :)

    4) Well, yes, but actually no ...
    Out of the box there's only one player (group), so you can only control that one group and can't have 2 separate factions being controlled via input keys - the non-player faction/group will always be AI controlled.
    You'd have to do some custom scripting to get that working, e.g. using the Access Handler could be an option here.
    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!
  • 3) thanks! That's super helpful.

    4) Well, considering that we actually hoping to do this more for play-testing mechanics balance then for actually shipping the game are there friendly fire settings?
  • 4) No, it's pretty much a script it yourself thing :)
    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!
Sign In or Register to comment.