Increase AI hazard aversion

Discussion in 'Wishlist Requests' started by Vaentorian, Jul 1, 2021.

  1. Vaentorian

    Vaentorian Localization Team

    Messages:
    527
    Likes Received:
    1,019
    Trophy Points:
    63
    Location:
    UK
    For context, this suggestion is mainly motivated by Satyr Fighters and fire traps in Elysium Mines where I regularly have the following experience:
    • Satyr and I spot each other from opposite ends of a corridor.
    • Satyr charges at me yelling HO HAH IMMA CRUSH YOR BONEZZ.
    • I step on the pressure plate and flames shoot out of the walls at either side, right in front of me.
    • Satyr stops right in front of me and gets thoroughly roasted while I beat the crap out of it.
    I can understand running into a trap which hasn't been triggered, I can understand running through a trap to get at me, I could even understand stopping in the flame jets to try and knock me back then immediately pushing forward into a clear space; but standing there showing no sign it understands the negative effects of fire seems at odds with the otherwise relatively intelligent nature of satyrs.

    Because the example is very situational I don't know how widespread this behaviour is (i.e. maybe wolves & bears have a flag that would make them more likely to avoid the flames?) and for some creatures it kind of makes sense (like ghosts being only loosely tethered to the physical plane might be genuinely oblivious to inanimate traps).

    Anyway I don't consider this a high priority especially since it makes my enemies easier to dispatch, it's more that I like the idea of them having some sense of self-preservation if it can be worked in at some point.
     
    FrostII and Anpu like this.
  2. Toular

    Toular Avatar

    Messages:
    601
    Likes Received:
    586
    Trophy Points:
    93
    And the same with pets - both tamed and summoned. "Hey, stupid fire elemental, please get out of that ice field."

    This is a problem in many games, where an otherwise good npc/pet kills itself due to some easily avoided environmental factor.
     
    Vaentorian likes this.
  3. Aldo

    Aldo Avatar

    Messages:
    2,425
    Likes Received:
    3,840
    Trophy Points:
    153
    Gender:
    Male
    On the other hand, and further proof that we need smarter mobs: When he spotted you at the end of the hall in all your splendid decked out glory, he should have turned and hid down the adjacent tunnel. Or perhaps he was really smart and figured since his job in this game is to put up some kind of fight, he ran to you, stopped in the flames and let you beat on him. Going down faster cuts the workload.
     
    Vaentorian likes this.
  4. Mikal Raine

    Mikal Raine Bug Hunter

    Messages:
    66
    Likes Received:
    43
    Trophy Points:
    8
    It would be great if they stopped on the other side just far enough away that you had to step through or around the trap. I mean they live there and would know where the traps and pitfalls were located. This would necessitate a line of sight check to stop ranged attackers from using it to their advantage. Not sure if this kind of logic can be implemented or not.


    EDIT because I type gooder. o_O
     
  5. Jakkal

    Jakkal Avatar

    Messages:
    237
    Likes Received:
    268
    Trophy Points:
    18

    No idea how they do things, but that actually might not be too difficult. If they use something like the A-star algorithm for plotting movement they could just add a slightly higher movement cost for those hazardous areas. Then the creatures would tend to plot a course around those locations if they had another route available that wasn't significantly longer to travel. Might make fire mages a little mad if the creatures run around their rings of fire, but the players would just need to be a little more tactical about where the rings of fire are placed. That logic exists to some degree already as they'll move if they don't have a line of sight, so the devs could also be set to trigger movement if the npc is standing in a hazardous area and their is another "safe" location to move to and attack the player, or even move to defensive cover themselves.

    If I recall correctly, they did add some logic so player pets don't stand in lava but it doesn't apply to npc's as far as I'm aware.

    It's best if this stuff remains fairly unpredictable so we can't plan a perfect tactic. So sometimes they would move, and other times they don't depending on the nature of the hazard and their resistance to it.

    It should also affect their attack behavior. Making it slightly less likely they'd run through the fire if they have a ranged attack to use instead of a melee attack. I'm not saying it should be decisively different behavior, just an increased chance they do the "right" thing. The worst thing is when the ranged enemies have a movement de-buff on them and choose to move rather than attack. It's actually a useful tactic to use against them. Like the envy boss, disable, move to cover, she chooses a spot to go to and walks very very slowly to it, you attack until she reaches it, disable/duck into cover again and repeat until she's dead. In that case she should be recalculating her action while she moves, so if you appear out of cover she stops walking and attacks immediately.

    Some actions are just weird. How many times have we seen mages cast a teleport when they could have walked to the new location quicker.

    In general the AI is pretty slow. They'll take an action and then stand still for a time before starting next action. This is likely due to processing them every half second, so if they finish an action after 1/10th of a second has passed, they have 4/10th's of a second of do nothing time before they figure out the next action. Several options to reduce this. 1) lower the .5 seconds to .4 seconds. 2) reduce the cast time of the npc glyphs by about 1/10th of a second so they appear to react quicker and are more likely to be finished the action before the next .5 second interval so they get more actions in, or 3) have the AI pre=determine it's next action in advance so when it finishes its current action it already knows the next action to take. In some cases that next action may be illogical, but in the majority of cases it should be fine. My preference is the last option but the other 2 would improve things and may be less work.

    It would make the AI more interesting.
     
  6. Vaentorian

    Vaentorian Localization Team

    Messages:
    527
    Likes Received:
    1,019
    Trophy Points:
    63
    Location:
    UK
    That's what it's all about in the end, of course it's challenging to create human-like AI opponents in any genre, but anything that pushes the balance further from "artificial" and closer to "intelligence" is sure to make interactions more interesting. And I agree that a bit of unpredictability helps with that - the satyr archers are a lot more dynamic than the fighters and force a much more considered approach to combat, at least for a melee build.