I just started dabbling with battle AIs but I am having a bit of a hard times.
I am trying to get an AI to hunt a target but if there's no target or the target is too far, randomly play an ability to spawn traps.
This is what I had so far:
image
Unfortunately the AI never seems to clear the target even if its distance is greater than 10 units.
The move AI is set to Hunt with a base detection range of 8.
I also added to the spawn trap ability the Game State condition In Battle=Inactive hoping it would have used the ability outside battles.
Any help is more than welcome
  • Battle AI and Move AI are not the same. The battle AI's targets are not automatically the move AI's targets. There are move AI nodes available for the battle AI, e.g. Check Move AI Target node to use the current target of the move AI.
    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!
  • I went through the ORK documentation but I admit I'm still struggling understand how the Battle AI and Move AI work together :(
    (https://orkframework.com/guide/documentation/features/move-ai/ and https://orkframework.com/guide/documentation/battles/battle-ai/).

    This is my understanding of the process, but I have a feeling I am getting something wrong since my AI are not working as expected.

    1) the Move AI detects targets set in Combatants>Move AIs>Enemy Detections.
    I assumed an enemy is defined as such if the sympathy between the user and target factions is less than zero.
    I am also not clear why in the Enemy Detection>Use Detection prompt, enemy detection is needed for Hunting and Fleeing but not Caution. What does Caution uses?

    2) if an enemy is in Range and aggressive, a battle starts and the Combatant Battle AI kicks in.

    3) The Battle AI can check (Independently from the Move AI ) for its own targets but the AI movement is still handled by the Move AIs.
    This is part is where I am confused. What happens if the Battle AI selects a target that's different from the MoveAI or outside the battle range?

    I did a test and set my Move AI to Caution Setting with a Caution condition avoiding the Player combatant type and a Battle AI not targeting the player and yet the AI still targets the player when close enough...

    image
  • Battle AI and move AI are mostly independent. The battle AI can check the move AI for targets to use actions on the same target. If an action (doesn't matter if used via battle AI or otherwise) is out of use range, it'll tell the move AI to move to that target. Also, a finished action will set the move AI to use the action's target as target to keep on it (if it's an enemy).

    1) Enemies are determined by faction sympathy, so yeah - sympathy below 0 is an enemy.
    Caution also uses enemy detection, not sure what you mean here? The settings are also only available when using detection is enabled.
    Caution tries to keep a defined distance between user and target, so basically hunting when out of range and fleeing when closer than their desired range.

    2) Not exactly - battles can start when the player gets close to an enemy, depending on the Battle Settings > Auto Start Battles settings in Combatants > Combatants > General Settings (each combatant can optionally override that for custom ranges, etc.).
    This is independent of the move AI or battle AI.

    3) See my explanation above :)
    Move AI just handles movement and detection, if the battle AI uses a target and the action needs to move closer, the move AI will do that. So, action takes priority.
    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 April 2023
    Thank you so much for the clarifications :)

    1) This is the prompt I was talking about that thew me off regarding the caution detection.

    image

    2) in Combatants > Combatants > General Settings battles can start when the player gets close to an enemy. Does that apply to AI vs AI?
    I am trying to get a hunter AI chase a target AI independently from the Player and I couldn't find any node in the Battles > Battle AIs to auto start battles.
    Post edited by ChimpLogik on
  • 1) Ah, yeah, will adjust that with an 'etc.' :D
    The text hasn't been updated when the new modes where added to move AI.

    2) No, only player to non-player.
    There's no battle going on without the player.

    Real time area battles can have enemies fight each other without the player being near them, though.
    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 April 2023
    There is still something that must be eluding me :(

    * My game is using a Real time Battle System

    * For my Ranged attacker AI, I have set the MoveAI to cautious with enemy detection and conditions that should limit the enemy type to the Player and Animals
    image
    image
    * For my BattleAI, I am first clearing found targets in the settings, the checking if the target is an enemy type == Animal (and use the ability shoot) and if not, if it is a enemy type == Player, still shoot.
    image

    Unfortunately the behavior I'm experiencing is the Ranged attacker AI is never shooting the Animals even when in sight (see image below), or sometimes chasing the player when animals are in range/sight and the Player is out of range, despite the Target Position Check>Target Lost Interval = 0.
    image
    Post edited by ChimpLogik on
  • Are the animals in a faction that are enemies of the hunter's faction?
    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!
  • Yes they are :(
  • Hmm ... are they in battle? Battle AI would only use combatants that are in battle.
    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 April 2023
    That's one of the parts I have hard time setting up, since battles can start when the player gets close to an enemy (depending on the Battle Settings > Auto Start Battles settings) but I am not sure how to trigger battles in the case of AI vs AI.

    All the combatants have set Battle Settings > Auto Start Battles > Own Auto Start Battles = true
    and the targets for the Battle AI I'm testing have no distance constraints. Is that enough to for AI to start battles between each other?
    Post edited by ChimpLogik on
  • As said, AI vs AI doesn't start a battle - only ongoing Real Time Battle Area battles can have that.

    There are Auto Join Settings available in Battles > Battle System > General Settings to automatically have combatants around a starting (or running) battle join in.
    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.