Jump to content

Barbarian and Monk get slowed by Free Action


suy

Recommended Posts

Barbarian and Monk get a bit of an increased movement rate. Both start with 2 extra points of movement rate at level 1 compared to other characters. Monk gets the movement improved at some levels (5, 10, 15, etc.) up to 10 more movement rate.

In terms of implementation, both get the extra movement rate via a #176 (movement modifier 2), which is "As opcode #126, but unaffected by Free Action", according to IESDP. Other items/spells use the 126 one. Makes sense. From a past conversation on effects:

Quote

Yeah, this. 126 and 176 are identical AFAIK; it's simply convention that 176 is reserved as the 'unblockable' movement rate opcode. It's like hold via ops 175 and 185--by convention 185 is the 'unblockable' hold, used to freeze your party member in the Hell selfish test or to hold undead.

The thing is, the Potion of Freedom and the spell, both have other effects besides Free Action (#163). I think the culprit is that there is a "Movement Rate Bonus (126)" setting speed to 100% (I have not tried anything, though). Seems that this effect, in being applied after, resets the speed that was gained via the innate improved speed, even if it's from a different "kind". The potion/spell also set an immunity to 126, so things like re-equipping the boots of speed doesn't work. But you can't re-equip the innate ability...

I think the proper way to do this would be engine-side: start with the 6 movement rate, apply the 126 effects, then the 176. If the innate abilities just add to the movement rate, then a "plot spell" needs to set it later to 0 for a cutscene, etc., then it would add up properly.

Otherwise I can't think of a nice way, unless one makes the innate effect reapply via casting it repeatedly each 5-ish seconds, then make the same thing with any "plot" that sets the speed to 0, but make that repeat even more often?

Another consideration: is the 176 *actually* used for plot reasons? Because if for locking someone in place for plot reasons the 185/Hold 2 effect is the only effect used, the 176 would be free for this innates, then making the repeating effect for the Monk/Barbarian movement could probably overcome the effects of the Free Action items/spells, I think.

This seems way beyond my knowledge to understand and fix, but I hope someone can give some input on how to tackle this. 🙂

The Free Action spell (or equivalent effect in items) is infamously known to be changed by some players because it doesn't seem to fit P&P or maybe even its description in some past incarnation. I'm fine with using a tweak mod to change it to what makes sense to me instead of blocking Haste, but Free Action blocking the innate movement seems broken to me. 🙂 Now I hope it isn't as controversial as the Hardiness vs Breach thread. 😄

Link to comment
3 hours ago, suy said:

OK, now I'm surprised and with a bit more hope: the Edventar's Gift equipped ring doesn't cancel the innate movement rate!

I'm pretty sure this one's about how the engine applies effects; there's a specific order. Both equipped forms of Free Action and spell forms of Free Action have a "set to 100%" opcode 126 effect followed by an immunity to opcode 126. The difference comes in how the engine handles these things.

First, immunity effects. Immunities block an effect from being applied; if there's a immunity to 126 in place, no new 126 effects can be added to the character. Try to put on boots of speed when you already have free action, and you won't go faster. However, the innate movement effects were already in place, and in any case aren't 126 effects.

Now, evaluate equip effects - in timestamp order. If you have a free action item, its effects come in here. Set movement speed to 100%, negating any speed boosts from items equipped earlier. Then grant immunity to 126 effects, so that items equipped later can't boost speed. A ring of free action trumps boots of speed no matter what you do. When loading a save, items are equipped in slot order.

With equip effects already in place, now evaluate the effects directly on the character - innate boosts, spell effects, all of that. This is handled in timestamp order (enforced by the internal ordering of effects in the CRE file). Obviously, effects that were applied when you created the character are going to come first. So the innate speed boosts come here, and increase speed. Immunity to 126 is irrelevant; not only is it a different opcode, but immunity doesn't do anything at the evaluation stage anyway. After all, free action gives immunity to haste too, and casting a haste spell then equipping a free action item will leave you hasted.

Finally, we get to the end of the evaluation stack, and here's where free action spells come in. Set movement speed to 100%, negating any earlier speed boosts. This will negate the innate barbarian and monk speed bonuses, unlike item free action.

(This is all based on my empirical observations. I do not have any sort of insight into the actual engine code.)

I don't think this is something that can be fixed at a mod level. The only way to allow the speed boosts through consistently without changing engine code would be to remove that "set speed to 100%" effect. Which would have side effects like allowing boots of speed to work with free action if the boots were on first.

... Wait. I can think of one thing. If we somehow moved the innate speed boosts to the end of the effect stack, they'd always evaluate last and come after the free action "set 100%" effects. Since there's no immunity to opcode 176 to worry about, the speed boosts would always apply. Rework the innate speed boost spells completely to filter through opcode 232 or 272; the actual speed boost gets repeatedly removed and reapplied. A free action spell would briefly slow the character, but only until the next remove/reapply cycle. I do not recommend this "solution".

Edited by jmerry
Link to comment

There is the question of whether the Free Action spell or potion should even be attempting to cure movement rate malus from #126 considering that last I checked it didn't cure slow or haste. Besides which, true penalties to a stat (such as the on-hit effect of Mazzy's sword) are not "cured" by setting it to 100%, the main thing FA currently accomplishes is negating the movement rate set to zero (from Entangle spell) or one (from Grease), if cast after the recipient is already entangled or greased, even if it didn't cure this ongoing effect, they would be free to move anyway on the next round due to the immunity granted, and ofc free to move through the AoE if FA was cast prior. Would it not make more sense to do this through #321 rather than fiddling with the movement rate opcode, given that all effects of an Entangle or Grease spell should be negated?

Link to comment

Opcode 337 on everything that Free Action grants immunity to sounds good, actually. Is that in scope for the Fixpack, or is it too much of a functional change?

Mechanically ... there's that "match parameter 2" aspect of 337. With four different values of that parameter that work in opcode 126, it might take four instances of 337 to actually clear that up. That's the clunky part - 337 doesn't seem to come with an "all" option there.

Edit: wait, no, that's not a problem. -1 is the ignore/all option. One instance of 337 per opcode to remove suffices.

Edited by jmerry
Link to comment
7 hours ago, jmerry said:

Opcode 337 on everything that Free Action grants immunity to sounds good, actually. Is that in scope for the Fixpack, or is it too much of a functional change?

Doesn't #337 ignore duration (except timing mode 9, "true permanent") in removing opcodes? I'd think it should be tied to the length of the Free Action spell or potion.

6 hours ago, Andrea C. said:

This is, however, one of those fixes that warrants backporting to the BG2FP. It’s cool to adopt an EE-only solution for the EEFP, but a discussion on how to handle it universally still has merit IMO.

On the original engine it would require a dedicated sectype and associated removal besides the typical mess involved in doing things this way... or simply removing #126 from the Free Action spell/potion's feature block. As I said, with a greased or entangled subject, they are free to move on the subsequent AoE tick, and FA is more generally cast as a preemptive buff than a curative (touch range and single target, so Remove Paralysis is almost always a better choice for removing these debuffs even if it weren't a 3rd level spell).

Link to comment

The intent here would be to remove the effects once, when the free action effect starts. After that, immunity takes care of anything new.

... Not sure how that works with item-based free action.

And by the way, you're wrong about Grease. The spell's description does not match the actual effect. Once applied, the slowing effect lasts for the spell's duration; if this happens later on, it can persist long after the grease field dissipates.

Link to comment
1 hour ago, polytope said:

Doesn't #337 ignore duration (except timing mode 9, "true permanent") in removing opcodes?

IIRC the issue with op337 is that its opcode removal is always permanent. So if used  carelessly, you might try to knock a skeleton down by applying a "1-second removal of sleep immunity" by applying op337 versus op39 with timing mode 0; but in fact the skeleton will be permanently vulnerable to op39 after that. Which would be weird. BUT, any new application of op39 immunity will work just fine - the permanent op337 effect does not act like an immunity.

So in the case of the Free Action  spell, it would remove all  op126 effects of any duration, which could lead to an overbroad result... but I'm hard-pressed to imagine a scenario in which this would be a problem. Permanent movement bonuses like the Monk's and Barbarian's are/could be/should be applied via op176, so that sort of thing would be exempt. Are there instances  of op126 in the game that should not be permanently disrupted by Free Action?

Because Free Action already acts like a dual-purpose spell. Some of its effect give timed immunity, but some of its effects give outright cancellation of other effects. Say you are Stunned for 20 rounds, and you counter it by having an ally cast Free Action on yourself, but the duration of your Free Action is only 10 rounds. You don't go back to being stunned for 9 rounds when the Free Action ends - the Stun effect is gone forever. So in this way Free Action already mimics the behavior of op337.

EDIT - looking at the Free Action spell, I see that it grants immunity to Slow, and removes a Slow portrait icon, but I cannot see any effects that actually remove the Slowed state. Is that an oversight? Does it need an op337 effect against op40? Or does op163 remove applications of op40? (The IESDP entry on op163 is, as usual, not sufficiently clear.)

Edited by subtledoctor
Link to comment
1 hour ago, jmerry said:

And by the way, you're wrong about Grease. The spell's description does not match the actual effect. Once applied, the slowing effect lasts for the spell's duration; if this happens later on, it can persist long after the grease field dissipates.

That is an introduced bug, it's not so with the vanilla game files. It's gone unfixed for a while because iirc no enemy spellcaster uses Grease.

The 3 rounds + 1 round/level duration should obviously be applied to the .PRO, not the duration in the feature block of the spell. Effectively this means 20 different projectiles with between 4 and 23 repetitions would be needed, or tbh just restore the behavior to original game and update the description to be accurate (11 rounds, the .PRO has 10 repetitions at 100 frames each ~66.67 seconds).

I tend to revert things like this and Burning Hands to their original state and thus forget about it.

Link to comment
56 minutes ago, subtledoctor said:

EDIT - looking at the Free Action spell, I see that it grants immunity to Slow, and removes a Slow portrait icon, but I cannot see any effects that actually remove the Slowed state. Is that an oversight? Does it need an op337 effect against op40? Or does op163 remove applications of op40? (The IESDP entry on op163 is, as usual, not sufficiently clear.)

Free Action has always been strange like that, but it doesn't remove the hasted state either, and like I said, tends to be used as a prophylactic rather than a remedy.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...