Skip to content

(BG1) Trap disarm pathfinding fix

BhryaenBhryaen Member Posts: 2,874
edited August 2012 in Fixed
This bugfix derives from a thread created elsewhere and noted on the beamdog forum by @caruga:
http://forum.baldursgate.com/discussion/64/trap-disarm-pathfinding-fix


OBSERVED:
When you send a thief to disarm a trap, usually they walk up to the edge of it and it vanishes with a special sound. In some rare instances when the thief is sent, they don't stop at the edge of the trap but proceed right into it, springing it on themselves. This is different than having merely failed to disarm the trap and sprung it instead. They don't even manage to attempt the disarm, but actually proceed right into the trap itself.

It's not clear if this has more to do with the traps themselves- particularly given that they're all larger-sized traps- or whether it's something more general, but for sure it happens in these instance more than others:

1. Durlag's 2nd level wall smash trap (AR0512- x=2603, y=890)
2. Firewine Ruins Fireball trap (AR5201- x=572, y=1471)
3. Nashkel Mines Entrance to Level 3 (AR5403- x=3180, y=2558)

Erm, actually I just tested them to find that, in fact, they're already working better (but not correctly) in BGEE than vBG1...

1. It seems like the only way to disarm it that works is by standing at around x=2535, y=864 before clicking the disarm. You still walk right into it, but the disarm comes fast enough not to trigger the trap springing. Unfortunately if you approach the trap from most anywhere else, even wearing BOOT01, you disarm the trap a split second before it smashes you.

[snip]

2. For this one, it seemed possible with BOOT01 to walk straight into the center without tripping it, but the disarm should occur at the edge. Sure enough doing the straight-forward disarm shown below without BOOT01 set off the trap. Also approaching from a different angle makes the distance walked through the trap itself longer. You can see in the screenshot that the thief must walk about 1/3 of the trap width before they disarm it.

[snip]

3. This one usually works perfectly fine even with BOOT01 off in vBG1, stopping the thief right in front of the trap successfully... if you approach the outer ring trap from the center. However, if you approach from a different angle- perhaps having tried to circumnavigate it first, you end up springing the trap instead, and this time you walk clear through it up to the next trap for the disarm point.

[snip]

I'll list more here if I find them.

EXPECTED:
If all traps have a specific location designated for disarming them, then it looks like we need to find every problem trap and list it. If all traps have a common pathfinding algorithm, however, it needs to be tweaked.

This is a post from someone named th3rulXT on the sister thread for this issue on the Friends of Baldur's Gate subreddit forum in case it has merit here:
'i would suggest to had a minimal distance from the trap so that a thief that is X pixel from the trap center (where X could be "trapwidth/height + a constant") . Usually one of the best way to do the trick unless something like; "If PJ "walksOnTrap" then if PJ "disarmingState" then DoNothing else "TrapLaunch(PJ)"" is possible'
Post edited by Bhryaen on
TanthalasAndreaColomboZinodin

Comments

  • BhryaenBhryaen Member Posts: 2,874
    edited August 2012
    CURRENT BEHAVIOR
    In some instances (not confirmed if it is always particular traps, but it's likely) when a thief is sent to disarm a trap, they end up stepping in and setting off the trap before they get to a location where they begin to disarm the trap (if they've survived the trap springing). This is most obvious with the "wall smash" trap in the second floor down from the basement of Durlag's Tower: there is no way to disarm that trap because regardless of what side the thief attempts it, they walk into it first. It's located here (in the corridor NE of 6 & 14):
    image

    I believe the Fireball Trap in the Firewine Ruins Dungeon is like this too (left of the "2," below the "3"):
    image

    Note that both of these traps are larger in size.

    CORRECTED BEHAVIOR
    Prevent thieves from walking into traps when sent to disarm them.

    Suggestions:
    1. If trap disarm is a function of a setting made for each trap individually, make trap settings universal at least in regard to trap disarm attempts.
    2. If trap disarm is a general setting, widen the range at which they come to a stop to disarm the trap or make it a dynamic function of the trap size to stop so many pixels short of the periphery.

    This was a further suggestion by th3rulXT on the reddit forum:
    'i would suggest to had a minimal distance from the trap so that a thief that is X pixel from the trap center (where X could be "trapwidth/height + a constant") . Usually one of the best way to do the trick unless something like; "If PJ "walksOnTrap" then if PJ "disarmingState" then DoNothing else "TrapLaunch(PJ)"" is possible'
    Post edited by Bhryaen on
  • lansounetlansounet Member Posts: 1,182
    Indeed this happens quite a lot if you don't micromanage your thief positionning and then there are those traps like the Durlag one you just can't disarm without triggering it (though I wonder if that is intended, there is another way around which I usually take). If such DisarmingState exists or can be made it would be a nice addition. Of course trigger the trap if the disarming failed.
  • HeroicSpurHeroicSpur Member Posts: 907
    edited May 2012
    This can be an incredibly irritating bug. This request is supported 104.82% by me.
    AndreaColombo
  • BhryaenBhryaen Member Posts: 2,874
    @HeroicSpur I really feel that you could be giving this bugfix your full 105%. Tsk tsk
  • HeroicSpurHeroicSpur Member Posts: 907
    105% would constitute me travelling to Overhaul HQ, holding Trent Oster at gunpoint and ordering him to work until the bugfix was implemented. 104.82% is plenty.
    Bhryaen
  • AndreaColomboAndreaColombo Member Posts: 5,524
    This has been bothering me ever since my first time through BG. Definitely a needed fix.
  • IgneousIgneous Member Posts: 368
    Agreed, quite a discombobulating bug.
  • BhryaenBhryaen Member Posts: 2,874
    Just fixed this fix for the fix forum format finally. Phew.
    AndreaColombo
  • BhryaenBhryaen Member Posts: 2,874
    edited June 2012
    Just found a new place this shows up repeatedly: yet another large trap (seeing a pattern), this time in AR5403 (Nashkell Mines, Lvl2, exit to Lvl3) at x=3200, y=2557 (though it's the outer-most trap that wraps around a wide area). Definitely an annoying BG1 bug...
  • GemHoundGemHound Member Posts: 801
    Just found a new place this shows up repeatedly: yet another large trap (seeing a pattern), this time in AR5403 (Nashkell Mines, Lvl2, exit to Lvl3) at x=3200, y=2557 (though it's the outer-most trap that wraps around a wide area). Definitely an annoying BG1 bug...
    and I was going to mention this one until I reached this post. This trap has killed my thieves 50 times out of 100 play throughs.
  • ArdanisArdanis Member Posts: 1,736
    Adjusting disarming positions in .ARE files is usually sufficient to prevent accidental stepping on a trap you try to remove.
  • LuneverLunever Member Posts: 307
    Actually, this only ever happened to me in original BG1/ToSC. It never happened in Tutu or trilogy.
    Since EE already IS using the TOB engine, this problem is probabaly already fixed a priori.
  • BhryaenBhryaen Member Posts: 2,874
    @lunever
    I had it happen to me on Tutu in Durlag's and Firewine. The one at the end of Level 2 of the Nashkell Mines remains hit-or-miss.
  • kamuizinkamuizin Member Posts: 3,704
    Take the opportunity to fix the monks detect traps too, as they can detect them but can't disarm them. Or at least give monk characters the ability to trigger a trap from affar, therefore avoiding its effects.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    We need a this button because: ^^ this.

    It seems like thieves try to move to the center of the trap to disarm it if they're not in their 'disarm' range--this is obviously a problem for large floor traps or long, skinny traps as @Bhryaen documents.

    AndreaColombo
  • AndreaColomboAndreaColombo Member Posts: 5,524
    Yes. Please fix this. Pretty please *huge misty eyes*
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Checking the trap center is obviously not the way go. Probably it should stop before stepping over any edge of the targeted trap. If there is an "operating point" then it should also say: "It is impossible to get closer to the trap without setting it off". If there is no operating point, then it could just try to disable it at this point.

    Also @Bhryaen: it is "algorithm" not "logarithm".
  • SethDavisSethDavis Member Posts: 1,812
    edited July 2012
    Checking this one now

    [EDIT] Potentially fixed - Floor (and potentially container) based traps will now take their size and shape (via their rendering bounding box) into account when deciding if the thief is within range to disarm the trap.

    The small annoyance is that these bounding boxes are square, so if the trap is wonky it may not look like the thief is getting as close to the trap as they do others.

    I've tested with the traps listed above, but if there are others that need the range extended slightly let me know.
    Post edited by SethDavis on
  • BhryaenBhryaen Member Posts: 2,874
    edited July 2012
    @Avenger_teambg
    But I wasn't referring to a set of rules for solving a problem in a finite number of steps as much as I was referring to the exponent of the power to which a base number must be raised to equal a given number which... ok, no, I wasn't... had to look both up. :-P
    SethDavis
  • BhryaenBhryaen Member Posts: 2,874
    edited August 2012
    [EDIT]

    Confirmed Fixed

    The trap disarm pathfinding for the above examples is working excellently well! Even the oddly-shaped trap in Nashkel Mines 3rd level is disarmable from multiple directions- both ends, even from inside the "U"- and the Firewine one also gets disarmed just as it should- both without BOOT01 on. Durlag's trap is far easier to disarm- doing so at its edge now- but difficult to detect, as it should be.
  • TanthalasTanthalas Member Posts: 6,738
    edited August 2012
    Confirmed Fixed

    I tested the traps mentioned by Bhryaen and had no trouble disarming them. Tried approaching the traps from different sides.

    @Bhryaen
    I think you can move this one to Confirmed Fixed.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
  • SethDavisSethDavis Member Posts: 1,812
    Got it, now only checks bounding box for floor traps.
    Bhryaen
Sign In or Register to comment.