Repository navigation
Why adding a single spell keeps getting more expensive #1069
Replies: 1 comment 1 reply
|
We appreciate all the work that goes into something like this and the attention to detail it requires for the sake of handling it's complexity. Would it help at all on your end if you added checkboxes to Spell Requests? Such as: Essentially just listing everything you mentioned that a new spell has to be checked for. Of course, leaving these as optional checkboxes in case someone doesn't know the answer or can't be bothered at the time. I think it could help to streamline even a tiny bit of the process so it's easier to organize your checklist with what the spell needs to be added to, but you tell me. |
Uh oh!
There was an error while loading. Please reload this page.
When this mod was small, adding a spell meant writing one stat entry, putting it on a spell list, and writing a description. That is no longer what happens, and I want to explain where the extra work actually goes — not as an excuse, but so requests and bug reports make more sense.
The baseline cost hasn't changed much. A new spell still needs its stat entry (mirrored in both the editor source and the generated data), an entry on every spell list that should offer it, localisation strings in every supported language, an icon, and a wiki page. That part is predictable.
What changed is the number of systems that have to know about every spell. The mod now contains several features whose entire purpose is "let something cast some other spell," and each one keeps its own copy of the spell catalogue that has to be updated by hand.
Magic Initiate. The origin feats and the regular class feats let you pick a cantrip and a 1st-level spell from the Cleric, Druid, or Wizard list. The engine's own spell-selection UI can't grant those spells in a way that upcasts correctly, so the feature is implemented as script: twelve Osiris goal files, roughly 3,600 lines, plus several hundred lines of passive definitions that exist only to hold the choices. Every new cantrip or 1st-level spell on those three lists has to be threaded through all of it — origin feats and the regular feats, which are separate code paths.
Pact of the Tome. Warlocks pick three cantrips from anywhere. There's no counter variable available at that point, so the number of picks you have left is tracked by stacking a marker status and comparing its accumulated duration against a threshold. The container spell can't grant the cantrip directly either; it routes through a dummy spell. That's about 1,100 lines of script for one invocation. And its catalogue is wider than Magic Initiate's — Bard, Sorcerer, and Warlock-only cantrips belong here even though Magic Initiate never sees them. Two lists, maintained separately, and forgetting one is silent: nothing errors, the cantrip just isn't offered.
Trickery Domain. Recent work lets Invoke Duplicity's duplicate cast the cleric's prepared spells. The duplicate is a separate creature, so "cast what the cleric prepared" isn't something the engine can express. Each castable spell needs its own status granting it to the duplicate, plus Osiris logic to read what the cleric actually prepared and hand over the matching ones, plus handling so the duplicate uses the cleric's Wisdom instead of its own. That's on the order of seventy per-spell statuses and 700 lines of script today, and it grows every time the Cleric list does.
Spell scrolls. This mod ships a scroll for very nearly every spell it adds — 270 of them at the moment. A scroll is not a flag you set on a spell; it's a parallel object. Each one needs a separate scroll variant of the spell, an item entry, a root template, an icon (extracted or composited, resized, and registered in the icon atlas), treasure table placement, its own localisation, and registration in the class-restriction helper that decides who can read it — a file that is now 628 lines of nothing but spell-to-class mapping. There are traps in it that produce no error at all: if the class-restriction call is given the spell name without the scroll suffix, the restriction silently stops applying and anyone can use the scroll; if the editor-side entry carries the mod prefix, the toolkit re-generates it with a doubled prefix and the scroll becomes uncastable. Both of those have happened, in batches, and were only found by auditing every entry by hand. On top of that, spells that present a choice when cast can't be made into scrolls at all — that combination crashes the game reliably, for reasons I never identified, so those either get a fixed-option scroll instead or no scroll at all. And the scroll list is itself an input to another feature: Thief's Fast Hands has to know about every scroll to allow it as a bonus action.
The result is multiplicative, not additive. Adding one Cleric cantrip is not one edit. It's the spell, the class list, the Magic Initiate origin feat chain, the Magic Initiate regular feat chain, the Pact of the Tome catalogue, the Trickery duplicate's status set, the scroll and everything the scroll drags with it, and — if it deals damage — the hardcoded whitelist that decides whether Potent Spellcasting applies. Miss any one and there's no error message; a feature just quietly doesn't include the new spell. Most of the bugs I fix in this area are exactly that: an omission, not a mistake.
Why not build it generically once? The engine doesn't offer the pieces. There's no runtime "give this creature the caster's prepared list," no conditional spell list, no integer variable where the pick count is needed, no "this spell is scrollable" property. Every one of these features is an approximation built from statuses, durations, and script, and approximations don't compose — each has to be re-approximated in its own context.
What this means for you. New spells land more slowly than they used to, and a spell arriving in the game is not the same as it arriving in every feature that could offer it; sometimes those follow in a later update. Regressions here are usually omissions, so a report that names which path you used — "as a Tome warlock", "via Magic Initiate", "cast by the duplicate", "from the scroll" — is far more useful than "spell X is broken." It also means the mod isn't built to run alongside other mods that modify spell lists or progressions; those conflicts aren't something load order can resolve.
None of this is a complaint about the requests — the features people ask for are good ones. It's just that "add one spell" now touches a system that expects it in seven places, and I'd rather you know that than assume it's being ignored.
All reactions