Jump to content

[not fixing] Bugs with wild surges and reduced caster level

Recommended Posts

This is being posted for posterity, namely because this would require a substantial amount of spell restructuring and would cause a lot of downstream mod compatibility issues for what's essentially an edge-case bug.

Steps to reproduce

  1. Start a new SoA game with a wild mage. Mash through the cutscene and Imoen's rescue dialogue.
  2. Add XP to reach level 12 and go through the level-up process: C:SetCurrentXP(750000)
  3. Add a Tenser's Transformation scroll and learn the spell: C:CreateItem("scrl7g",100)
  4. Memorize Tenser's, rest, get through Imoen's dialogue, and quick-save.
  5. Cast Tenser's Transformation and note the resulting THAC0 of your character on the Record screen.
  6. Reload and repeat step five until you get a THAC0 from a regular cast, and one with a wild surge where your caster level is decreased.


The THAC0 between the regular cast the lower-level cast are identical.


The THAC0 from the regular cast is better than the lower-level cast, one per every casting level--e.g. if caster level is reduced by five, the THAC0 should be five worse than the normal cast.


Modders already know the answer: the spell lacks headers and effects for levels 1-11.

For everyone else, the explanation requires some background. If you open an editor and look at a spell with effects that vary based on level, the spell file will have multiple headers with effects tuned to the level at which the spell is cast, up to the spell's level cap or the general level 20 spell cap (30 in IWDEE). E.g. a Fireball does 1d6 damage per level of the caster, so you'd find headers with the damage ranging up to its maximum 10d6 damage at level 10. Stoneskin has headers every two levels since a mage gets an extra Stoneskin every two levels, and Protection From Evil has headers at every level up to 20 since its duration scales two rounds per level of the caster.

The problem is that the original devs assumed that a spell could never be cast at a level below the level it can first be learned. If we were to look at Fireball, specifically, you'd find the following headers and levels:

  • Level 1*: 5d6 damage
  • Level 6: 6d6 damage
  • Level 7: 7d6 damage
  • Level 8: 8d6 damage
  • Level 9: 9d6 damage
  • Level 10: 10d6 damage

* By convention the lowest level header of a spell is always designated as level one, even though (in this case) it's the level five effects.

As a third level spell, Fireball can't be learned (and therefore used) by casters below level five. However, if a wild surge reduces caster level to the level 1-4 range, the caster will still get 5d6 damage. The spell would have to be restructured as such:

  • Level 1: 1d6 damage
  • Level 2: 2d6 damage
  • Level 3: 3d6 damage
  • Level 4: 4d6 damage
  • Level 5: 5d6 damage
  • Level 6: 6d6 damage
  • Level 7: 7d6 damage
  • Level 8: 8d6 damage
  • Level 9: 9d6 damage
  • Level 10: 10d6 damage

This is a major restructuring, and would have to be done for every level 2-9 arcane spell that has level-dependent effects. Even worse, because there are wild magic areas in Watcher's Keep, divine spells and innate abilities would also have to be reviewed and likely adjusted as well. (As a knock-on effect, we'd also have to adjust the fixed casting levels of scrolls to the minimum level that the spell can be learned to avoid changes with scroll casting.)

In other words, we'd have to do massive restructuring of many (most?) spells in the game--and the resultant downstream bugs and compatibility issues--to deal with the 'caster level lowered by X' wild surges. It's not worth fixing.

edit: Yes, this also affects oBG2, but I won't be addressing it in BG2 Fixpack either.

Edited by CamDawg
Link to comment

In my view, it's not even a bug. It's just the way spells work; the lowest possible effective caster level is (normally) the minimum level at which a full caster class gets a spell slot of that level.

Now, if there are any spells which outright lack a "level 1" header so that they can't be cast at all at unusually low caster levels, that's a bug.

Link to comment
7 hours ago, Luke said:

Besides wild surge, I think it's also relevant for level drain...?

Level drain will also drain memorized spell slots, so such a situation shouldn't occur.

With that in mind it might be more accurate to have such under-leveled spells simply fail (do nothing - empty spell headers for those lower levels).

Link to comment
15 minutes ago, kjeron said:

With that in mind it might be more accurate to have such under-leveled spells simply fail (do nothing - empty spell headers for those lower levels).

Spell descriptions are fairly clear with language like “1d6 damage per level” as opposed to “5d6 damage, plus 1d6 per level above 5th.” 

And wild magic is pretty clear that it alters effective caster level specifically for purposes of evaluating the effects of the spell being cast - unlike level drain which is more comprehensive. A +1 adjustment for a 5th level wild mage results in a 6d6 Fireball; the most reasonable interpretation is that a -1 adjustment would result in a 4d6 Fireball. I think leaving things as-is would make more sense than an empty header - wild magic already has other mechanisms for failure to cast the intended spell. 

Link to comment

Strongly related to this, a tweak I have pondered on for some time was to implement a chance for spell failure if a spell is cast (e.g. from a scroll) by a caster that is too low in level, as P&P says should happen.

Yes, doing this for every level-dependent spell would be a massive undertaking, and I see how it could cause some issues down the line.  I am half tempted to at least do it for damage-dealing spells in my own Fixes mod though. 😄

Link to comment

While I think duplicating extended headers isn't as complicated as they seem at first glance, a stronger argument against this change is how most creatures i.e. Genies do their spellcasting without any wizard or priest levels which defaults to 1. You'd also have to patch every single spellcasting creature in the game so they have nonzero CASTINGLEVELBONUSMAGE and CASTINGLEVELBONUSCLERIC which can be a headache not to mention mod compatibility as they have to change their creatures as well.

Link to comment

And this applies both for and against the player. The Call Woodland Beings nymph is a level 5 FAIRY_NYMPH with priest spells that range from level 2 to level 7. With the minimum effective caster level rule, that means the Barkskin is 7 rounds of AC 6, the Call Lightning is one 7d8 bolt, the Mass Cure is 1d8+9 healing, and the Confusion lasts 7 rounds. Apply any changes to how this works, and some of those become radically different.

Link to comment

Actually, if the code were to be changed so non-player selectable classes default to corresponding Wizard/Priest levels without needing CASTINGLEVELBONUSMAGE and CASTINGLEVELBONUSCLERIC to be set then I'd be in favor of additional extended headers down to 1 (which is highly doable in WeiDU), but that's outside the scope of the fixpack as of 2.6.6.

Link to comment

Between the macros already written for BG2FP (EXTEND-O-MATIC and MISSING_HEADERS) the technical part is straightforward, just long. Testing would be equally tedious.

The downstream effects are the real problem. Solutions which could require a broad swath of mods to adjust are not viable, and that goes exponentially given the number of active modders left.

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.

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...