Jump to content

SubtleMods: 5E Spellcasting Rules Conversion


Recommended Posts

I haven't looked at the code, I only looked at the results of installing MESPells with the new function, and I saw that, in addition to SPPR101, SPPR102 etc., it also includes SPDR101, SPRA304, etc.. If I have some kit installed that has GA_D5PR101 in its CLAB file, would that spell end up in MEPR1.txt? I don't know and I don't really care. If I have to filter out dupes I have to filter out dupes. The particulars don't really matter to me. It's not a big deal, I already have some dupe filtering there. If anything, I'm more annoyed about the SP..x49 dummy spells with no headers that will make me add filesize checks. (Also, what if there is already an SPPR349.SPL when MESpells gets installed? Eh, I guess it's not my concern.)

Link to comment

Yes the current version of 5E Casting works with spells added via the latest version of Olvyn’s tool. 

Note, I don’t think Olvyn has updated his spell mod to actually use the new spell-adding tool. But I manually updated his spell mod and the 5E mod picked up the spells. 

I will give you these warnings, though, since you seem intent on packing as many spells into your game as possible:

  1. The 5E system assigns numerical values to the spells in the system from 101 to 999. So it can handle 899 memorizable spells altogether, both divine and arcane combined. If your game has more than 899 memorizable spells, the 900th and later ones will not work. Filenames can only be 8 digits long and there are only 3 available for 5E spell index numbers. 
  2. Even with “only” 899 spells, more spells incurs a noticeable performance hit. (The vanilla game only has about ~300  spells.) Having 800+ spells in the system might make the game not very fun. For reference, I'm currently using it with ~750 spells on middling hardware (a 2020 iPad) and it works fine. But there may be more noticeable lag on different platforms and different hardware, with more spells. Maybe.

Consider thyself forewarned. 

(Note exactly relevant to this thread, but Tome & Blood sorcerers have not yet been changed to work with Olvyn's new function.)

Edited by subtledoctor
Link to comment
4 hours ago, subtledoctor said:

Even with “only” 899 spells, more spells incurs a noticeable performance hit. (The vanilla game only has about ~300  spells.) Having 800+ spells in the system might make the game not very fun. For reference, I'm currently using it with ~750 spells on middling hardware (a 2020 iPad) and it works fine. But there may be more noticeable lag on different platforms and different hardware, with more spells. Maybe.

Out of curiosity, why would this performance hit happen? One would think most spells people install are not active most of the time. Or it's something like the game holding spell data in memory all the time even if they aren't actively used, and the strain increases hard with each bunch of mod spells added to the pile?

Edited by Connelly
Link to comment
2 hours ago, Connelly said:

Out of curiosity, why would this performance hit happen? One would think most spells people install are not active most of the time. Or it's something like the game holding spell data in memory all the time even if they aren't actively used, and the strain increases hard with each bunch of mod spells added to the pile?

The way it works is this: say you have 5 spell slots in each spell level. Call it 6 with various rings of wizardry etc. After you cast a spell, the game removes all your spells, recalculates your spell slots after having used one, then casts a subspell to give you your memorized spells back... one subspell for each spell in the system, for each spell slot you have. The vast majority are blocked by op206 effects, one for every spell you don't have memorized. But still, with 899 spells in the system, that means it tries to cast roughly 5,000 subspells... every time you cast any spell. And this happens every time, and if you have two priests and two wizards casting spells, that means ~20,000 ~10,000 subspells being cast behind the scenes, every six seconds.

The nice thing is, this is a game designed in 1999, and with modern computing power and EE engine efficiencies, it's not that big a deal. And the numbers above are probably exaggerated a bit. (On reflection, all 5,400 subspells would only apply to an epic-level cleric/mage multiclass, and you're not likely to have four of them in the party... single-class mages and priests will only use half that many.). Still, the long and the short of it is, it casts a crap-ton of subspells behind the scenes and there are limits as to how hard you can push that system. (My mana sorcerer uses a points-based version of the same system - as do my psionicist kits. But these are limited by how many spells you can know, 45 and 50 respectively. One player a while ago cheated 12 spells per level into a mana sorcerer's spellbook and it completely busted the game - every time they cast a spell the game froze for 15 seconds. Not fun.)

Edited by subtledoctor
Link to comment

Thankee for the update.

OlvynSpells has been updated to use the newest version of Olvyn's Spell Tool.  Our family's main PC has been a high end MSI gaming laptop that I got for Christmas of 2021.  (It's run Elden Ring fairly well.  I'm unsure how accurate of a benchmark that is.)

We didn't intend to have a party full of multiclassed divine/arcane casters.  CHARNAME is a Druid/Mage, and we planned to have other casters in the party, but only rarely would we have another Cleric/Mage, Druid/Mage, or the like.

Edited by Endarire
Link to comment
8 hours ago, Endarire said:

high end MSI gaming laptop that ... run Elden Ring fairly well

It will probably be fine. Though, there's not getting around the issue of possibly having 9-letter filenames. Easiest way to be on top of that: in a test instance of BG2EE, just install all the spell-adding mods you expect to use, then install 5E casting, then look at D5ZCLONS.2da. If the index numbers in the left column go above 999, then you can see how many spells you are over the limit.

Link to comment

How to handle spells over the 999 limit?  Can they still be prepared and cast as normal, even if they aren't spontaneous?

Does this mod work with Shadow Magic since Shadow Magic seemingly uses different file names and you added T&B compat to account for Shadow Magic?

What would be involved in adding T&B Sor compat to Olvyn Spell Tool and 5e Casting if it isn't there already?

Finally for now, I appreciate your patience, kindness, and thoroughness in our discussions.  I've been curious about many things and you've diplomatically responded.

Thankee!

Link to comment

Shadow Magic is exempted entirely, I think. Take it at its word that Shar set up a parallel magical Weave and it works how it works, distinct from the otherwise-normal (5E, in this case) magic system. 

Spells over d5z999 will have too many characters and there’s nothing to be done about that. I suppose you could design of this that separated arcane and divine spells so each could have 899 spells - basically, run two 5E systems simultaneously - but I considered and rejected that idea a very long time ago. I haven’t thought about it enough to understand what problems might arise - off the top of my head, the op172 effects could fails and you would get more and more castings of certain spells, every time you cast anything, ad infinitum. 

Honestly you should do a test install with just spell and kit mods to see if this is actually something you need to worry about. Maybe this is moot. 

Link to comment

5e didn't install on my test installation.  (Debug Log)

I only tested it with these mods which added spells:
-OlvynSpells/MESpells
-Out! Brief Candlekeep
-Shadow Magic
-Stone of Askavar
-Warlock

EDIT: I did another quick install and found that 5e Casting, when installed after Shadow Magic, had no effect on Shadow Magic.  As a Shadow Adept (Wizard), preparing 1 each of 3 spells acted like a vanilla Wizard when casting.

Coding-wise, I'm unsure what would be involved in adding the ability to use 5E Casting with more spells, like adding separate IDs for Bard spells, Shaman spells, Paladin spells, Shadow spells, Warlock spells, etc. instead of lumping them into P (divine) and W (arcane) with some outliers.

EDIT 2: Regarding other spells to add to your 5e white list, this list of PC-learnable spells is at least a handy start.

Thankee!

Edited by Endarire
Link to comment
On 3/5/2023 at 3:02 AM, Endarire said:

EDIT: I did another quick install and found that 5e Casting, when installed after Shadow Magic, had no effect on Shadow Magic.  As a Shadow Adept (Wizard), preparing 1 each of 3 spells acted like a vanilla Wizard when casting.

Yes:

On 2/28/2023 at 3:44 PM, subtledoctor said:

Shadow Magic is exempted entirely, I think. Take it at its word that Shar set up a parallel magical Weave and it works how it works, distinct from the otherwise-normal (5E, in this case) magic system.

...

On 3/5/2023 at 3:02 AM, Endarire said:

Coding-wise, I'm unsure what would be involved in adding the ability to use 5E Casting with more spells, like adding separate IDs for Bard spells, Shaman spells, Paladin spells, Shadow spells, Warlock spells, etc.

It would be so complicated, I can't even wrap my head around what it would look like. Like writing a whole new version of the mod - or multiple new versions to work in parallel. There's no way.

Like, I know you have a clear idea of the result you would like to see, but if you look at the code in this mod it probably looks like a bunch of gobbledygook. Well, realize that it largely looks like gobbledygook to me as well, and I'm the one who wrote it. It's black magic - and you don't try to bend black magic to your will.

Link to comment

You mentioned the possibility of expanding 5e to work with separate arcane and divine spells instead of one set of spells per class (Bard, Shaman, etc.)  Code-wise, what would be involved in this?  What's this about opcode 172 and how should its problems be mitigated/worked around/exploited to our benefit?

What say you to allowing 5e casting, as an option, to work with Shadow Magic as well?  The file names are seemingly fixed and this system isn't being expanded like the default spell system.

Thankee!

Link to comment
4 hours ago, Endarire said:

You mentioned the possibility of expanding 5e to work with separate arcane and divine spells instead of one set of spells per class (Bard, Shaman, etc.) 

No, you mentioned that. It wouldn’t make any sense anyway - bards just cast wizard spells, and shamans have their own separate casting system. 

4 hours ago, Endarire said:

What's this about opcode 172 and how should its problems be mitigated/worked around

Op172 does not remove spells with 8-character filenames (IIRC). There is no workaround for that. It simply fails if the filename is too long. 

In this case the filenames have a 2-character modder prefix (d5), a 1-character letter to indicate being part of 5E casting (z), a 3-character index number (101-999), and a 1-character indicator of which helper file it is (i, g, b, or l). That’s seven characters. That’s it. Nothing to be done here. 

5 hours ago, Endarire said:

What say you to allowing 5e casting, as an option, to work with Shadow Magic as well? 

Shadow Magic has its own distinct system, with a particular set of special spells and special stat bonuses that only apply to it, and special secondary effects that occur when casting. I don’t know how it works and don’t want to mess with it for fear of screwing it up. Letting it be parallel but distinct - like sorcerers, shamans, warlocks, etc. - ensures players have a smooth and bug-free experience when putting both mods together. Happily, it also jives with the setting lore that shadow magic is a distinct system. (Though the existence of shadow magic at all does not jive with the setting lore since the Shadow Weave did not exist at the time of BG2… but far be it from me to dictate how players change their games.)

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