AI Strategy Type

Discussion in 'General Modification' started by Enilno, Feb 9, 2006.

Remove all ads!
  1. Enilno

    Enilno Quicksword

    Joined:
    Dec 14, 2005
    Messages:
    86
    Likes Received:
    0
    Being a noob, I apologize if this is a really stupid question or has been answered over and over again. I have searched and searched and since 'AI' is a non-searchable term (too short), my results have been limited.

    Here is a thread where Livonya talks about making lots of script changes to the AI, but doesn't go into detail about where or how the scripts are stored:

    http://www.co8.org/forum/showthread.php?t=1313&highlight=witch

    I also didn't see anything the TOEEWB tutuorials that explained AI Strategy Type settings (or referred me to another source), but maybe I missed something.

    Where are the AI scripts stored? Are these Python scripts? Are there files for each of the AI options currently in use in protos.tab ('AI Strategy Type')?

    I want to create a new encounter, and am in the very early stages of trying to mod one. However, the opponents that I have created so far act really stupid and present almost no challenge (they use missile weapons in melee provoking multiple AoO's from my characters, even through they have melee weapons that would be the more deadly option to begin with). This was their behavior whether I had assigned no AI Strategy Type or whether I picked one for them (I tried 'Defender' for most of the and 'Flanker (with ranged)' for one that actually was more likely to be effective that way). These AI Strategy Types were assigned to some in the large group of fighters (or rogues -- whatever they are) outside of Romag's room. Maybe I just picked the wrong types, but how do I know which are best, and why is the default behavior so stupid. You'd think that the default would be to use melee in melee or if you're going to use ranged to at least take a five foot step first. I'm sure if I pick the right AI (or create a custom one), then new opponents can be made to be much more challenging.

    Thanks.
     
  2. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    The AI strategy type is defined in strategy.tab in the data/rules folder. I don't think there is an in depth tutorioal for this file, but if you open it in Phalzyr's ProtoEd you'll notice that each AI action uses 3 columns, try copying the enrties in these 3 columns from other strategy types for your new one. Spells must list the creatures caster type (EG. NPC proto entry has Cleric spells, strategy.tab entry MUST list those spells as clric spells too) otherwise they won't be cast.
     
  3. Enilno

    Enilno Quicksword

    Joined:
    Dec 14, 2005
    Messages:
    86
    Likes Received:
    0
    I've been able to make some progress by playing around with creating custom AI strategy types (using the existing field values), but I'm wondering how the logic behind the field values is programmed. For example, how does 'Use Potion' work -- how does it know which potion to use? Also, the seem to be some missing AI stategies -- for example, scrolls and bardic music. I tried putting in 'Use Scroll', but it seemed to have no effect. Anyone know more about how these AI strategy type fields work? Where is the logic behind the fields? Can more valid entries be created?

    Thanks.
     
  4. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    The only one who really seemed to know how the AI worked was Livonya and unfortunately she didn't document any of it.

    I'm fairly sure there is no way to make an NPC use a wand or scroll, which is why Liv created a bunch of NPC-only potions to simulate wands and scrolls.
     
  5. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Here is a list of AI strategy types ripped straight from the temple.dll, not sure what all of them do, but if you'd like to document your findings, It would benefit the whole community.
    Code:
    1029FA60: 'cast single alone',0
    1029FA74: 'target bad reflex',0
    1029FA88: 'target bad fort',0
    1029FA98: 'target bad will',0
    1029FAA8: 'target nearby buffed',0
    1029FAC0: 'go melee',0
    1029FACC: 'charge',0
    1029FAD4: 'use potion',0
    1029FAE0: 'coup de grace',0
    1029FAF0: 'five foot step',0
    1029FB00: 'target nospell',0
    1029FB10: 'target threatened',0
    1029FB24: 'attack threatened',0
    1029FB38: 'clear target',0
    1029FB48: 'approach',0
    1029FB54: 'cast party',0
    1029FB60: 'cast area',0
    1029FB6C: 'cast fireball',0
    1029FB7C: 'cast single',0
    1029FB88: 'target friend nospell',0
    1029FBA0: 'target friend hurt',0
    1029FBB4: 'target friend low ac',0
    1029FBCC: 'target friend high ac',0
    1029FBE4: 'target self',0
    1029FBF0: 'reload',0
    1029FBF8: 'go ranged',0
    1029FC04: 'trip',0
    1029FC0C: 'expertise',0
    1029FC18: 'power attack',0
    1029FC28: 'rage',0
    1029FC30: 'target prone',0
    1029FC40: 'target closest',0
    1029FC50: 'target ranged',0
    1029FC60: 'target damaged',0
    1029FC70: 'target high ac',0
    1029FC80: 'target low ac',0
    1029FC90: 'ready vs approach',0
    1029FCA4: 'partial charge',0
    1029FCB4: 'ready vs spell',0
    1029FCC4: 'flank',0
    1029FCCC: 'sniper',0
    1029FCD4: 'defaultCast',0
    Adding new AI action types will require a .dll hack unfortunately.
     
  6. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    Oooh, "target nearby buffed". I could make the fight with the Noble Salamanders a lot tougher, methinks.
     
Our Host!