Charging Crossbowmen

Discussion in 'The Temple of Elemental Evil' started by Gaear, Nov 12, 2009.

Remove all ads!
  1. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    This might be off topic, but do you think Black jay's script is screwing up the spiritual weapons? I am referring to the fact that mobs run around the weapon a bunch of times trying to find a spot to hit them from, but never attacking them.
     
  2. The Royal Canadian

    The Royal Canadian Established Member

    Joined:
    Oct 29, 2005
    Messages:
    741
    Likes Received:
    4
    Hi Gaear
    Another report from the meadow. I actually played it twice in 5.6.0 just to double check my results. Is it possible that the Skeletons in the meadow are scripted differently depending on whether they have Light or Heavy Crossbows ?? The reason I ask (and this is the reason I played it twice) is that I noticed that Skeletons equiped with Heavy Crossbows are more likely to charge than Skeletons with Light Crossbows. In my two tests Skeletons with Heavy Crossbows would charge about 20 - 25% of the time, whereas Skeletons with Light Crossbows would only charge 10 - 15% of the time. It goes without saying that a Skeleton that charged would not use the 5 Foot step to avoid AOOs , but a Skeleton that didn't charge would.
    The Royal Canadian
     
  3. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    I don't think so. They're not really scripted to do anything but use the default AI strategy.

    :shrug: That wouldn't be an issue so much with the spiritual weapons' AI as the other attacking .mobs.' I don't know where an order of attack preference is specified other than 'closest,' 'threatened,' etc. Maybe internal.
     
  4. The Royal Canadian

    The Royal Canadian Established Member

    Joined:
    Oct 29, 2005
    Messages:
    741
    Likes Received:
    4
    Hi Gaear
    Just played the meadow for the third time to see if I might see something that would give me a clue as to why some Crossbow Skeletons charge and some don't. I even tried to keep notes of each fight (the order they popped up, what they did , etc... ), but I couldn't find anything that leads to conclude "if x is true then the crossbow skeletons will charge". I did notice something odd when I reviewed my notes though. It seems that the number of Skeletons is determined randomly, or at least if their is a set number of skeletons in the meadow, their weapons are determined randomly.
    The Royal Canadian
     
  5. GuardianAngel82

    GuardianAngel82 Senior Member

    Joined:
    Oct 3, 2007
    Messages:
    3,481
    Likes Received:
    5
    There are 6 in the northern fight, 8 just south of that and 7 near the giant.

    No bandit random encounters, yet.
     
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Regular skeletons indeed have their weapons generated as they're spawned from a set list of possibilities, including crossbows. So it's quite likely that they'll be different on successive plays.
     
  7. Thorsson

    Thorsson Established Member

    Joined:
    Apr 28, 2004
    Messages:
    121
    Likes Received:
    4
    Except that apparently behaviour has changed from Co8 version to version.
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    I've encountered dagger switching in the past when spawning crossbowmen via console, not sure what causes it. Haven't encountered it in the Moathouse, though. What party are you using? At what point does the dagger switching occur - when combat begins, at the start of the bowmen's first round, at a later point? Do they ALL switch to daggers?

    There's a possibility that it might be solved using Livonya's combat scripting (which is still largely unimplemented in ToEE).

    BTW, when you say 'added the two lines', I assume you mean replaced, right?

    Edit: Ok, I've encountered dagger switching.
    EVERYONE switched to daggers! (including the lieutenant)
    It happened when I started a new game to test this stuff.
    The strange thing is that I have a savegame where they DON'T switch to daggers (and I haven't touched the AI...).
    It could be that the dagger switching is a side effect of using teleport to get to the Moathouse, or perhaps not doing something else that I'd normally do in an ordinary game. Perhaps having an NPC on board? Very bizarre. Moments like this make me want to throw all my weight behind helping DarkStrom and his engine recreation project.

    I thought that was to accommodate the NPC dialogue flags?

    If you'll notice, that script is also tailored to very specific NPCs (namely: Ettins, Elven Rangers, Grank's Bandits, and Half Orc Assassins), via 'if npc.name == X' statements. The guardsmen aren't in that list, so they shouldn't execute the item_wield_best_all command.

    Also, weren't Black Jay's scripts brought to use a long time ago? Doesn't seem like it's the scripts specifically.


    Here's the original default stategy:
    Code:
    Default    use potion            target closest            attack closest            target ranged            target closest            approach            attack            
    
    Here's my analysis, based on my experience with the AI: (see ToEE's AI thread for some accounts of my experiments with AIs)

    • Default- the strategy's name.
    • use potion - standard break free enabler.
    • target closest - targets closest.
    • attack closest - no such command exists - thus the AI won't do anything yet at this point.
      • There's a possibility that it also breaks the rest that follows since it can't parse the command. In that case the AI may do all sorts of strange things.
    • Assuming the AI isn't completely fucked due to the broken command:
    • target ranged - targets a party member with a ranged weapon (assuming one exists).
    • target closest - overrides the above, targetting the closest party member.
    • Up till now, it's all targeting (remember, attack closest is "broken")

    • approach - this is the first actual action besides use potion. Makes the AI approach its selected target, which is manifested in the charging...
    • attack - attack... but it has to be close to its target, otherwise the approach action will execute first and prevent from attacking. So what the AI really needed was a working attack command before the approach command.

    BTW, it seems that in 5.0.0 thru 5.0.5 (probably 5.0.6 too) the Default strategy was actually the Gorgon's strategy, since in effect the default strategy is obj_f_critter_strategy = 0 (references first line in strategy.tab).
    That strategy was:
    Code:
    Gorgon (target dying)    target closest            cast area        'Petrifying Breath (INTERNAL)' domain_special 0    target threatened            attack threatened            target ranged            target closest            charge            attack            use potion            target closest            approach            
    The petrifying breath would be ignored by most creatures since they don't have that ability, and instead they'd go:

    • target threatend, attack threatened
    • if none is threatened:
    • target ranged, overriden by target closest, charge, attack
    Not sure how ranged AI treats target threatened/attack threatened, will have to test.

    The vanilla default AI was:
    Code:
    Default    attack threatened            target closest
    This can lead to all kinds of bork as well :)
     
    Last edited: Nov 17, 2009
  9. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Just a party of 4 pre-gen characters.

    At the start of each crossbowman's first round. Everybody but the lieutenant and the crossbowman to the left of him switched. I had a cursory look at that crossbowman's .mob and didn't see anything different from the others.

    Yes, replaced.

    Incidentally, to test this myself I've just been starting a t() party and teleporting straight to the coordinates outside the guards' hallway, so my experience is similar. Others seem to be reporting this in normal play, however. But it's inconsistent.

    Yeah, that was probably it. Unnecessary again atm (or will be).

    I guess not, but it wouldn't be the first time ToEE has suddenly started behaving oddly for seemingly no good reason. ;)

    I noticed that too, looking at vanilla strategy.tab. So despite the fact that a name is indicated in protos.tab, the game still looks for a line number? That would be kind of funny if all along in vanilla people were fighting against the gorgon's strategy.

    I don't understand much about strategy.tab, frankly, but I did find it odd that there were so few entries in vanilla. Did we really add all that other stuff - 'tripper (medium),' 'Rage - flanker - close w/move,' 'Falrinth (was too easy to kill),' and 'Barbarian (tumbler no ranged),' etc.? Weird.
     
  10. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    I think some of that was in vanilla. I'm pretty sure I remember dealing with crazy trip-happy bugbears before I found Co8.
     
  11. The Royal Canadian

    The Royal Canadian Established Member

    Joined:
    Oct 29, 2005
    Messages:
    741
    Likes Received:
    4
    Hi Gaear
    More notes and a thought from your crazy canadian beta tester. I am now at the first level of the temple, after clearing the tower. Here are my observations:
    1.) Tower archers / crossbowmen didn't "charge", but in all honesty I wasn't paying real good attention and I did use an entangle spell. I did notice a few archers using the 5' Step.
    2.) All the skeletons with crossbows in the bone-filled hallway charged.
    3.) The Earth Temple Guards just North of the Ogre Chief, did not charge, but also did NOT use the 5' step
    4.) I had 1 Earth Temple Guard in the room just south of Romag charge. The other 4 or 5 didn't and also used the 5' step.

    Here's my crazy thought: Has anyone taken a good look at the script for the Bugbear Archers and compared it to the script for the crossbowmen / skeletons ?? The reason I ask this, is that the Bugbear Archers never charge, always use the 5' Step until cornered, and then switch to a melee weapon. In fact the only thing bugbears goof on (and again I haven't been paying real good attention to this, so I don't know if it is the archers or the melee bugbears) is failing to take a 5' step before drinking a potion.
    The Royal Canadian
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    A t() party, heh :)
    Anyway, same here.
    The other game where they all behaved fine was a completely normal game. Before altering the AI the crossbowmen would do the approach thing (without switching daggers), and after altering the strategy.tab they'd fire their x-bows.
    I'll have to test further to see what causes this.
    So far what I can think of:

    • Lack of worldmap travel
    • Not having areas[2] marked
    • Having an NPC on board
    • Not having had combat before

    Yeah, I call it 'ToEE general FUBAR syndrome' :).

    No, I said that was the case in 5.0.0. In vanilla the first line in strategy.tab was indeed Default.

    If there is no AI entry in protos.tab, it probably just sets the strategy variable to 0, and then the game references the first strategy.tab entry.

    If a protos.tab entry should explicitly list Default as the strategy, then Default it will be (no matter what line number it is). Incidentally, no protos.tab entry actually does that, rather the AI field is simply left blank in most cases. In the latter case, the default strategy is the first line in strategy.tab, because the strategy variable equals 0.

    Maybe, maybe not. You can look up AIs in the ToEEWB with the advanced search. The numbered ones are used by Livonya'a scripting, for sure (they are assigned to creatures via script).

    Is having too many harmful? Well, try trimming everything except Default and Sniper and see if anything happens in that fight...
     
    Last edited: Nov 17, 2009
  13. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Meant to mention - one other difference I've noticed from the 5.5 strategy.tab to the 5.6 version is a bunch of tabs either added or removed (can't remember which atm) at the end of virtually every line. Now, I never knowingly did this myself, but it's possible that when I was fiddling the file for the high-level party entries (the only changes I ever made, appended to the end), this was somehow done 'for me' by Microsoft Excel. I say this because Excel did other things for me without consultation, such as removing single quotes (') from the start of spell names in caster AIs. (I went nuts trying to figure out why Hedrack had suddenly decided he didn't want to fight anymore in a pre-release. Excel had deleted a single quote from one spell name and it broke his entire routine. Took me days to find that. I think I was trying to use parts of Hedracks routine for testing with the high-level party.) So don't use Excel to edit strategy.tab. It's all Ranth's fault btw - he recommended it! :angry: (j/k) ;)

    Anyway, long story slightly shorter, I painstakingly deleted (or added, whichever) all those tabs to reflect the 5.5 condition, tested, and saw no difference at all.

    I don't really have a clue, but if I had to guess I'd say no, as long as it's the entry names that are being refereced and not line numbers (in which case adding a line anywhere but at the end would in theory screw up everything after that line).

    Skeletons should not be a problem now. The ones at Emridy I tested with Sitra's AI tweaks worked fine, and being as wherever they appear they're the same prototypes (using the default AI) and never carry daggers, we can assume their only issue (charging) will have been fixed for all of them with the new default AI. The only other skeleton variety, IRC, is Liv's priest guardian. They don't use daggers or crossbows either.

    Give skeletons the bugbear AI? That's not a bad idea, aside from the fact that they don't have (and likely wouldn't use) potions, but the issue here is not so much finding an AI that works as discovering why an AI that used to work suddenly no longer does.

    At any rate, I won't be changing any AI assignments myself, as strategy is not something I understand well enough.
     
    Last edited: Nov 17, 2009
  14. The Royal Canadian

    The Royal Canadian Established Member

    Joined:
    Oct 29, 2005
    Messages:
    741
    Likes Received:
    4
    Hi Gaear
    I wasn't suggesting that you assign the Bugbear AI to the Skeletons or Crossbow using guards, what I was thinking was more or less open the Skeleton AI and the Bugbear Archer AI in whatever editing program you use and compare them side be side to see if there is something missing (or added) to the Skeletons AI to make them act stupid.
    The Royal Canadian
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    I've now encountered weapon switching with the Moathouse Courtyard bandits too. Seems the crossbowmen switch to their rusty swords, just as the guardsmen switched to daggers.


    • This was with an NPC party member onboard.
    • I didn't use teleports this time (got the location of the Moathouse the old fashioned way).
    • Doesn't appear to be connected with my party's weapon loadouts. (tested all melee, and all ranged, same results)
    • Have rested before.
    • Have completed a quest.
    • Clearing the cache doesn't solve it.

    Also tried:

    • Removing/switching some commands from the AI: took out sniper, took out clear target, added partial charge, added reload at the beginning, etc. No dice.
    • Erasing the default AI completely, leaving it blank - still got weapon switching (the behavior is otherwise as expected)
    • Changing the targeting from 'target closest' to 'target threatened' (as in vanilla) - didn't work.
    • Looked up what AI the bugbear 'archers' use - it's just the sniper AI. Strangely, the ones in the back room will switch weapons, while the one where the scout is - doesn't, despite having the same AI.

    These findings lead me to suspect that the weapon switching is not really related to the strategy.tab entry itself. Probably something more basic than that. Not sure what, and the apparent inconsistency is driving me crazy.

    Other things to try:

    • Guardsmen without san_start_combat scripts.
    • Other desperate measures...?
     
    Last edited: Nov 17, 2009
Our Host!