AI update

Discussion in 'General Modification' started by Livonya, Feb 28, 2005.

Remove all ads!
  1. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Strange. I couldn't get the spiders to use web even one time until I created a special AI for them.

    In any event, they will now always use web. Every single time. I think that is an improvement.

    I have a theory about what happened to change it from every time to once in a blue moon, but it is no more than a theory and I have no way to test/prove it.

    - Livonya
     
  2. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Allyx -

    Thanks for the great list!!

    I already started to consult the 3.5 monster manual to fix some monsters, but some fixes are simply not possible.

    Right now I am trying to get the broken things fixed and then I will work on making the monsters act more accordingly to 3.5 rules.

    I am saving the AI scripts for the Balor, St. Cuthbert, Jaroo, and some other very high level NPC/Monsters for last. I intend to make them HARD. They won't cheat, but if you want to kill one of these NPCs/Monsters then you will have a brutal hard fight on your hands.

    The Balor will be especially fun to work with.

    Anyway, I hope to get to some of this tonight. I am still trying to figure out a way to get nearby monsters to join the fight when their comrades are in combat... but so far not a lot of luck... though I still have some untried ideas.

    - Livonya

    PS: I have to say I am having a blast making all these new scripts!! Every time I figure out a solution to some annoying problem I am just more energized to do more!
     
  3. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,009
    Likes Received:
    255
    Thanks I apologise profusely in advance to everyone who stuggles to kill the balor only to be obliterated utterly ehen his death throws kicks in (provided you can code that into the game)!

    Keep up the great work, i'm looking forward to trying out the AI overhaul.
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    IIRC, Co8 had some concerns in the past regarding the Web spell. It didn't seem to be engineered very well, and many people (if not most) thought it was overpowering as applied in this CRPG. (I'd have to agree: most times once you cast Web the battle's over.)

    The thought that it might have been altered some way by moebius seems plausible to me, although I guess it wasn't eliminated completely, as Kalshane still gets it.

    This leads me to another question: do we know we're not countering more moebius .dll changes? I do believe he documented his stuff pretty well . . . we may want to check that.
     
  5. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    I think web is only over-powered when the player's party uses it since the monsters/NPCs never try to break free.

    It is pretty easy for the player to deal with since s/he can easily select break free as an option.

    Currently the monster/NPC AI has no way to detect the fact that they are stuck in a web.

    One of the things on my to do list is to figure out if I can't find a way to get monsters/NPCs to attempt to break free... same goes for trying to get them to move out of the way from Stinking Cloud, etc...

    - Livonya
     
  6. Jota

    Jota Member

    Joined:
    Apr 21, 2004
    Messages:
    40
    Likes Received:
    0
    Do you know where can i find this documentation.
     
  7. Morpheus

    Morpheus Mindflayer Veteran

    Joined:
    Nov 11, 2003
    Messages:
    539
    Likes Received:
    1
    His temple.zip contains a number of text files that describe the changes he made.
     
  8. Jota

    Jota Member

    Joined:
    Apr 21, 2004
    Messages:
    40
    Likes Received:
    0
    i see what you mean. Thanks
     
  9. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Livonya,

    I may be speaking out of turn, but couldn't you detect whether a monster is in a web with something like...

    def san_heartbeat( attachee, triggerer ):
    if (attachee.obj.has_spell_effects(spell_web)):
    // do code here to try to break free
    return RUN_DEFAULT

    I'm guessing that attachee has a .obj parameter, but something like that should be about the right way to do it, I'd guess -- it's how you do it for pc's (i.e. try game.party[0].has_spell_effects(spell_web) )

    -- d
     
  10. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Dulcaoin -

    This is a good idea. And actually, if "attachee.obj.has_spell_effects(spell_web))" works then it is solid building block.

    You don't want to be using the Heartbeat during combat... it is better to use Start_combat though you could use the heartbeat I reckon, but you absolutely have to end with "return SKIP_DEFAULT" or you will also get a standard AI run for that round and that will most likely replace whatever you script in the heartbeat/start combat.

    The real problem is figuring out if there is actually code to break free. You can probably use break free in the AI scripts, but there is no way to check for the spell effect in the AI scripts...

    At this point I don't know of a way to actually make them try to break out.

    I can have a spell caster cast Freedom of Movement or try to dispel the web.

    In any event I haven't used obj.has_spell_effects(spell_web) before so posting that is very helpful, as it gives me ideas. I will have to test it out.

    thanks.

    - Livonya
     
  11. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0

    I'm still just tinkering and figuring things out, so I guess I got kinda lucky.
    I took some heartbeat code, gutted it, and pseudo-coded up the solution I thought might work. (That's why the RUN_DEFAULT)

    I would THINK you'd want heartbeat (or something repeating) over start_combat, or wouldn't the creature only have one chance at breaking free; whereas PCs can choose to try to break free repeatedly during the process? I'm truly asking, I don't know enough yet to be effective (only dangerous :))

    I don't know whether "attachee.obj.has_spell_effects(spell_web))" actually works, but I do know the that code I gave for checking your party members does, so it's likely a good starting point.

    I think I would go about it by trying to cast Dispel Magic on the web (roll the dice to do the strength check yourself, and if it succeeds, cast Dispel Magic as some really-high-level spell). I can't tell from the PHB (3.0) whether DM is supposed to get rid of Web. Technically, "Breaking Free" of web means a successful strength check (or an Escape Artist check) that allows the subject to move a certain distance through the web (depending the check results) before having to check again. I don't suppose there's a way to do a strength check for just any creature?

    I ALSO wonder what happens if you were to set a condition on the create with the spell_web with a 1 duration, so it would then expire for that creature, hopefully "erasing" the first invocation of spell_web in the first place [this is dangerous, could end up causing something like the "permanent silence" problem]

    Just some ideas...


    -- d
     
  12. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Just so you know...

    Start_Combat occurs ever round of combat

    Enter_Combat only occurs the first time


    The Heartbeat does also occur once every round, but it also occurs other times, and it can cause strange effects if you use it in a combat round.

    Of course you have to add a script ID code to the proper column to use these effects...

    Also, you should know that when you over-ride the normal AI for an NPC's round with Start_Combat or the Heartbeat you will cause strange events to occur... you want to do it as little as possible.

    For instance if you cast a spell with the regular AI the NPC does a concentration check and there is no AOO, but if you cast that same spell from the Heartbeat of Start_Combat then you will evoke AOO and the caster will still do a concentration check as well.

    Just a heads up.

    - Livonya

    PS: I will let you in on a trick of mine. Often I find it easier to modify a spell than to modify the NPC. For instance to fix it so that when Iuz animates the dead corpses around her I actually simply made her cast Animate_dead. I then modified the Animate_Dead spell so that if Iuz is the caster the spell picks multiple targets and casts Animate_Dead using a different spell graphic. The end result is that she now creates zombies but the loot/armor on the corpses doesn't disapear.

    The danger with this trick is making sure you don't screw up the spell. One typo or error and the spell becomes unusable the rest of the time.

    But this works well. So the AI tells the enemy Cleric to cast hold person on the target that is threatening her position. The spell checks to see if the caster is an enemy cleric and not a party member. If the caster is indeed an enemy NPC then the spell checks the target, and if the target is actually invalid for the spell then the spell picks a new valid target.

    So my hope with Dispel Magic is that I will have the AI tell the enemy NPC to cast Dispel Magic, then the spell will actually prioritize targets.

    It is impossible to make the AI check for valid/invalid targets, so the only way to do it is to change the spells.

    I have modified at least 15 spells in this way. Previously it was impossible for NPCs to cast these spells as they required radial choices upon casting.

    Anyway have fun, and if you have any questions shoot 'em at me.
     
  13. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0

    Thanks, that's really good to know (about Enter_Combat existing). That makes the scripts make a whole lot more sense.

    I'm way behind where you think I am. I mostly just read problems people are having, and see if I can find likely calls and parameters to those calls that will help.

    My next step is to consider (strongly) whether to start on an editor. ProtoEd is currently looking inaccessibly dead (though I don't want to ring the bell on that one too early), and is missing a few "easy" features I'd really like to see (like lookup of tag names in description.mes), and the Mod Studio has some issues that I'm not too happy with (for instance, not working with the data in situ and forcing one to duplicate files). I am thinking that that area would be the best place for me to apply my talents right now, though figuring out python calls IS fun. :) I might give a proto.map editor a go and see how quickly it falls together, and if that works I'll start pulling in more and more .mes and .tab files until I have a pretty nice integrated solution. Then .dlg would follow. I'm giving it a couple more days to see whether that really seems necessary or not.

    -- d
     
  14. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    ProtoED works great. That is what I use.

    But I guess people can't get it anymore. I am not sure about that.

    I use ProtoED for proto changes and I use notepad and wordpad for everything else. I find it best to just do the scripts in notepad and the dialogs in wordpad.

    I also built a room in the game where I can create any situation to test creatures and what not. This is easier than trying to go to them.

    Last night I added a new reputation to the game, and put in a new situation that I think people will enjoy.

    I also found a reputation that was broken due to a scripting error. So in effect there will now be 2 new reputations in the game with new consequences that didn't exist before.

    fun, fun, fun...

    - Livonya
     
  15. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Well, I've finished a proof of a ProtoEd style editor (nice timing). I'm currently reading in and parsing the protos.tab table, reading and parsing the description.mes file, hooking gother the IDs from both, and building a treeview. A couple more steps (most importantly, writing the file back out, of course), and I'll have an improved ProtoEd to use. Mine will let you change .mes entries eventually, too.

    -- d
     
Our Host!