Game play questions concerning AI scripting

Discussion in 'The Temple of Elemental Evil' started by Livonya, Nov 4, 2007.

Remove all ads!
  1. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    I am working on a new system for AI strategy scripting that is far more dynamic.

    There are a few abilities that I am not 100% sure when to use. I know when I would use them, but I am more concerned with how other people feel they should be used.

    So these are just general questions for people that play ToEE and D&D, or for those that understand the best use of the rules.

    1) Barbarian Rage.

    Should a Barbarian always use Rage when they enter melee combat?

    When shouldn't they use it?


    2) Expertise.

    This seems purely defensive.

    Is there any reason to use it besides self-preservation? Currently I only have NPCs using Expertise when they are supported by friendly units and they are injured.


    3) Power Attack.

    Clearly this shouldn't be used all the time. In ToEE once an NPC turns this on it stays on for the rest of the combat.

    When should NPCs use this ability?


    4) Trip.

    Assuming an NPC has Improved Trip, when should they NOT use this skill?


    5) Ready Vs. Approach

    Does it make sense for NPCs to use this?? When would you recommend they do it?


    6) Charge.

    I am limiting Charge use to those times when NPCs are not heavily damaged. Are there other times when an NPC should NOT charge?

    And do you think animals and low IQ creatures should always charge when they have the chance?


    Anyway, those are just some questions.

    As I said I am overhauling the AI and I don't want the overhaul to be totally dependent on my own use of skills and feats. So all feedback is useful.

    Also, if there are actions that you really think that enemy NPC units should use more often or even less often then please feel free to post about that.

    Any and all ideas on how to improve NPC tactics concerning melee and ranged weapons is welcome.

    Feedback helps. Wish lists will be read.

    Thanks.

    - Livonya
     
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Tanks bodyguarding spellcasters.
     
  3. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Bodyguarding is possible. I hadn't thought of it, and it is a good idea. I could script for that. I just need to get a grasp on when to do it and when not to do it.

    How do you way the need to bodyguard versus the need to fan out in order to minimize area effect damage spells?

    Do you think it is better to have melee NPCs protect spell casters or to approach enemy spell casters to prevent casting.

    I can see having some melee NPCs that guard spell casters, and either switch to ranged until an enemy approaches or go Ready Vs. Approach.

    I will definitely try to add something in that does that.

    I can see this being very important at low to mid levels, and not very important at higher levels.

    - Livonya
     
  4. erkper

    erkper Bugbear Monk Supporter

    Joined:
    Jun 3, 2006
    Messages:
    1,201
    Likes Received:
    7
    Rage should only be used just before a melee attack. I've seen bugbears use Rage when they were all the way across the map, and by the time they closed with my party, it was about to wear off.


    Only when attacking foes with fewer levels/hit dice, or magic users (with low AC.)


    Much the same as Power Attack, but less restrictive. Maybe should not be used against foes with much greater BAB to prevent self-tripping?
     
  5. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Yeah, that is a good point. Don't want to waste it. I will make sure they don't start Rage until they are actually going to attack with a melee weapon. That will be an easy fix.



    Yeah, that is what I figured. I also have them using it on prone or helpless targets.



    I don't know how much I want to cheat. I could write a script that would actually determine the odds of success and then they would only try if they had a good chance of success, but that does verge on cheating....

    I was thinking of reserving Trip to times when there are additional friendly units to back an NPC up, and to times when the NPC is in good health.

    I could get into BAB detection, but it does verge on cheating... I think a little cheating is important, as the AI can't rationalize like a human can. So some cheating is to be expected, but the question is how much...

    What do you think? How much information should the script take into account?

    - Livonya
     
  6. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
    I'd say it's a visual assessment. You can hazard a guess of success based on what your opponent is wearing and/or how they engage. It'd be easier to spot troops that are more poorly equipped or who may be spellcasters. The guy in the back with the heavy armor vs. the guys up front wearing studded leather or scale mail; also, the character in robes with a staff. Chances are you'd be right about who to try tripping once you observed them for a few moments.
     
  7. berzerker

    berzerker Random Passerby

    Joined:
    Oct 23, 2007
    Messages:
    63
    Likes Received:
    0
    Liv..

    heres how I see it.

    consider the Dojo. the instructor and almost anyone whos been there a moment can fairly quickly size up someone on the mats.

    Similar thing at SCA.

    I have a feeling most of what yu will scripting for is closer to the porfessionals than the 1-night a weekers...

    Professional fighters will have a pretty good idea based on experience of whats works and what doesn't; and whom is a skilled combatant.
     
  8. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    ICan I suggest an alternative? Instead of factoring success, maybe do it based on random possibility (randomise out of 20 or 100 or whatever) vs intelligence and level / HD? Thus experienced or intelligent NPCs / monsters will have the better chance of making the more devastating attack.

    I hate cheating NPCs too, I think this would be a decent workaround.
     
  9. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    I think a few tricks that you would use for NPCs are ones you use for your PCs

    ready vs aproach;

    I use a ranger or fighter with quick draw as a body guard for my wizard - uses a bow untill an NPC gets near then switches to melee. I think a similar tactic in revers would work.

    tripping is excellent when the tripper is being flanked by characters with combat reflexes (and sneak attack).
     
  10. Kurt

    Kurt Member

    Joined:
    Nov 3, 2007
    Messages:
    13
    Likes Received:
    0
    IMHO NPCs should react as much as possible like PCs would: Use whatever is most beneficial for them in a given situation.
    Now I don't know what environment handles you have to make them react to a changing situation, but I think with some general rules and some placement tricks you should get pretty close to it.


    BTW, while we're speaking combat AI: There is nothing worse for gameplay than those kobolds rushing, one by one, a party of heavily armored/armed PCs... :roll:
    In their place I would retreat, try to form a solid wall (to get as many hits as possible on a given target), put myself into "ready vs.approach" and wait for the PCs to come, in a heroic last stand.
    All critters which come in groups should use group tactics, and not fight like a dozen individual fighters. Also, obviously outnumbered or too weak intelligent critters should not engage combat (stay neutral), even if they really hate you.

    What I usually do is scout with my monk (not even invisible), and when I find a group of enemies I fireball them (my mage has a very high initiative), then my tanks rush in and finish off the survivors. It's a cheesy tactic, but I think critters should be able to counter it, by having advanced scouts for instance, or by being in two distinct groups (so you fireball the small vanguard, and get flooded my the main host who was further away and didn't get blasted).

    A thing I'd love to see in the temple is patrols! If they see you, and you don't silence them quickly enough, they'll gate in a good host of guards... (Summoning)
    Make a dozen of those patrols on each floor, with long paths, this will keep players alert (no spells left after the last fight, in dire need of finding a safe spot to rest/heal - and then, at the turn of a corridor, you meet a patrol!)...
     
  11. Morgrim

    Morgrim Bane of Hobbits

    Joined:
    Jul 29, 2007
    Messages:
    3
    Likes Received:
    0
    The 2 AI's that I'd love to see would be a react to noise script and a defense of levels/dungeon script once PC's have been encountered and have retreated to lick their wounds/sell stuff.

    The first should only trigger if a fight breaks out within a certain radius and should bring troops from neighboring rooms. The second should trigger once the characters have left the dungeon or are moving slowly (i.e. resting) within a level - it should allow the defenders to change their placements, etc. to receive the challenge.

    There goes my lurker status...
     
    Last edited: Nov 4, 2007
  12. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Lots of good ideas. Keep them coming.

    I already wrote what I would call "react to combat" script so that monsters that can't see you will join the fight with ranged weapons.

    I scripted in a way for creatures to switch back and forth from melee weapons to ranged weapons.

    So for instance I have melee monsters attacking with melee weapons at less than 60 feet and with ranged weapons at more than 60 feet, while ranged monsters attack with melee weapons at less than 5 to 10 feet and with ranged weapons in all other situations.

    So in a large area, if you were to attack 1 monster then that monsters "tells" the other montsters, and those monsters "tell" more monsters.... which leads to almost all monsters joining in a fight.

    Normally, this isn't useful as monsters can only advance to combat from a certain range, but if they all have ranged weapons then they can join the battle from range.

    Anyway, keep the ideas coming, they are all useful.

    thanks...

    - Livonya
     
  13. berzerker

    berzerker Random Passerby

    Joined:
    Oct 23, 2007
    Messages:
    63
    Likes Received:
    0
    Liv; AI is the great weakness of almost all games IMO; one of the worst killers of replay value; and probably the most modded thing I've seen in other games - I think its a worthy project for certain!

    All the ideas I've heard here are good; Morgrim's reminded me of something I noticed the pther day - the fellow Screeg had mentioned Phantasie..

    Interesting that in a game made in the 80's; the monsters improved their defenses if you raided them and that games have gone backwards in terms of monster reactivity since then.

    *Another thing you might consider is having multiple scripts for Ai behavior so that; as the one fellow mentioned; kobolds react differently than say.. Bugbears; or organized monsters from unorganized ones.
    Ideally; even within a certain type of monsters you should not know how this particular group is going to act - predictability is the true weakness of most AI's.
     
    Last edited: Nov 4, 2007
  14. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    Well. there used to be the "aid another" action, i don't know if it's implemented in ToEE, or in 3.5 Ed...
    Aid another is a two option action: It works with a close ally and opponent, you should declare it, and made an attack check to a opponent that it's attacking (or going to act against) your ally, when you declare, you choose between aggresive or defensive help option, if you have succes in your attack check (dc 10, pretty easy) then you give your ally a bonus of +2 to attack (if aggresive) or a +2 to AC if defensive...
    I used to have a bodyguard (Cujo's suggestion) on my spellcasters, using expertise and ready vs approach, then they use the aid other to give +2 AC to the spellcaster who used also Expertise...since the attack check it's low, the penalty to attack given by expertise doesn't matter...and the attacking character suddendly it's faced between two characters that protect each other (and the spellcaster attacking with aid other to give his bodyguard a +2 to attack), and also flanked for an extra +2 bonus...
    since you have the melee/ranged option working, a spellcaster could have a bodyguard shooter, and when a character approachs, change to melee...which also gives cover to the spellcaster

    Melee mid-liners. Front liners probably get to melee the first round, so mid-liners could take a standard movement and set ready...that way palyers can't avoid the front liners to attack the rear lines easily...

    well, aside of those i mentioned or other people tell, there could be "specific race" tactics...
    Trolls and bugbears usually go straight to melee (trolls aren't afraid of nothing, even fire)
    Goblins and kobold tend to ambush, shooting a lot from two flanks (and kobold, being more inteligent, usually have some sorcerer leader, and also tend to attract melee opponents to to the shooters, and use alchemist fire or tanglefoot bags and that kind of things)
    Beasts don't spred between opponents, ussually attacking in pack at the same opponent (and probably tripping him) without regards of being the powerful or weaker, they attack the clossest thing (unless that they're more intelligent beasts, like Winter wolf and that kind)
     
  15. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
    Spellcasters should attract missile fire. Missileers would shoot until threatened, then switch to melee; unless all the other melee troops have gone down. Guards would do the same, but would switch when their protectee is threatened regardless of other concerns.
     
Our Host!