(BG1) Trap disarm pathfinding fix
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:
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
3
Comments
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):
I believe the Fireball Trap in the Firewine Ruins Dungeon is like this too (left of the "2," below the "3"):
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:
Since EE already IS using the TOB engine, this problem is probabaly already fixed a priori.
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.
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.
Also @Bhryaen: it is "algorithm" not "logarithm".
[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.
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
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.
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.