Skyrim Special Edition

The Bug
The bug causing the "cost" of player enchanted items to change after you save and reload has lead to debate over the years. If you have ever used an Arcane Enchanter to create your own enchantments then you have encountered this bug. The cost of enchantments affects the value of enchanted items, and how much charge enchanted weapons drain on each successful hit.

Spoiler:  
Show

While it has shifted over time, the prevailing sentiment now appears to be that the cost is correct after you reload. This is because the value of player enchanted items decreases as your skill in enchanting increases before you reload, whereas the opposite is true after you reload. However, it is important to consider that the cost of an enchantment also affects how much charge enchanted weapons drain.

Having looked at the code, I believe that the cost is correct before you reload. The cost of an enchantment is informed by the cost of each of its effects, where stronger effects are more costly. Generally speaking, this means that weapons with strong enchantments are quickly drained of charge. Fortunately, the cost of player created enchantments is counterbalanced by your skill in enchanting.

Specifically, the cost of player created enchantments is modified by the following formula:

(1 - (EnchantingSkill * fEnchantingSkillCostBase) ^ fEnchantingSkillCostScale) * (fEnchantingSkillCostMult * (EnchantmentCost ^ fEnchantingCostExponent))


As you can see, it depends on your skill in enchanting. This can obviously change over time, which means the cost of enchantments can only be determined when they are first created by the player. When this is calculated it overrides the default cost of the enchantment, which does not use this formula. The game then first looks to see whether it has been overridden each time it needs to know the cost of an enchantment.

Unfortunately, the overridden cost of an enchantment is never saved by the game. While it would be simple for Bethesda to update the game to save and load it, this would change the format of save game files. If this were to happen, the game would be unable to load existing saves. You can hopefully see the dilemma.

The overridden cost is also destroyed if any of an enchantments effects have conditions. When the player creates an enchantment the game first looks to see whether it has been created before, to prevent duplicates. It does this by comparing the effects that will be used to create the enchantment with the effects of existing enchantments.

The conditions of these effects are intentionally removed when an enchantment is created. However, these conditions are only removed after this comparison is made. This means the game does not recognise enchantments with effects that have conditions as duplicates. While this can have other consequences, the most obvious is the overridden cost of the enchantment being destroyed.


The Fix
These two bugs are fixed in the following ways:
  • SKSE64 co-saves are used to save and load the overridden cost of player created enchantments.
  • The conditions of effects used to create enchantments are no longer compared.

The Enchantment Cost Fix can be safely installed or uninstalled at any time. However, it will only affect enchantments created while it is installed, unless you create a duplicate of an existing enchantment. If it is uninstalled, the overridden cost of each enchantment will be lost.


Comparisons
These bugs have been addressed by other mods in different ways. Most notably, the Enchantment Reload Fix and the Enchanting Adjustments and Price-Charge Bug Fix. I will briefly contrast these alternatives with the Enchantment Cost Fix to the best of my knowledge.

Enchantment Reload Fix
The conditions of weapon enchantment effects are saved. Instead of fixing the bug that causes these conditions to destroy the overridden cost of an enchantment, it is avoided. This is done by removing all of these conditions when the enchanting menu is opened, and then adding them all back again when the enchanting menu is closed.

This is presumably done for weapon enchantments and not for armour enchantments because frost damage is the only enchantment that has effects with conditions in the base game. Unfortunately, this means that the overridden cost of armour enchantments will still be destroyed by conditions if they are added by mods.

Your skill in enchanting improves each of the effects of the chaos damage enchantment. However, it has been implemented by taking an imperfect brute-force approach. This addresses the game intentionally improving only the costliest of an enchantments effects. While this has not been changed by the Enchantment Cost Fix, it has been by the Multiple Enchantment Effects Patch available in Scrambled Bugs.

Enchanting Adjustments and Price-Charge Bug Fix
Player created enchantments never have their cost overridden. This is done by exploiting the bug that causes conditions to destroy the overridden cost of an enchantment. This has been implemented by giving each enchantment dummy conditions, and by using Papyrus scripts to change the value and charge displayed in the enchanting menu.

It also makes various other changes to enchanting that I will not go into here. If you are interested, then I recommend that you read the mods description.


Switching
Only one mod that addresses these bugs should be installed at any given time. I will briefly outline how I recommend you switch between the Enchantment Cost Fix and the Enchantment Reload Fix or the Enchanting Adjustments and Price-Charge Bug Fix.

Enchantment Reload Fix
Both the Enchantment Reload Fix and the Enchantment Cost Fix can safely be installed or uninstalled at any time. These mods can also both be installed at the same time. While this is mostly redundant, you can take advantage of this to carry the overridden cost of enchantments over from one mod to the other.

If you want to switch from the Enchantment Reload Fix to the Enchantment Cost Fix then all you have to do is create a new save with both of these mods installed. You can then uninstall the Enchantment Reload Fix.

If you want to switch from the Enchantment Cost Fix to the Enchantment Reload Fix then all you have to do is open the enchanting menu and create a new save with both of these mods installed. You can then uninstall the Enchantment Cost Fix.

Enchanting Adjustments and Price-Charge Bug Fix
While the Enchantment Cost Fix can safely be installed or uninstalled at any time, the Enchanting Adjustments and Price-Charge Bug Fix cannot. I recommend that you do not uninstall any mod that uses Papyrus scripts from an ongoing playthrough. Wait until you begin another playthrough and decide which mod you would prefer to have installed then.

Article information

Added on

Edited on

Written by

KernalsEgg

18 comments

  1. tarlazo
    tarlazo
    • premium
    • 3,022 posts
    • 532 kudos
    I'm a bit confused.
    Looks to me you're talking about "Enchantment Cost Fix" as if it were a part of Scrambled Bugs, but I can't find it anywhere [ScrambledBugs.json, optional files, mod description].
    I read "The Enchantment Cost Fix can be safely installed or uninstalled at any time" and "switch between the Enchantment Cost Fix and...".
    Where is the Enchantment Cost Fix?
    1. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      Sorry about that, I will be releasing it shortly. I didn't think anyone would actually bother reading this article without being prompted.

      It will be a separate download however because it relies on SKSE64 co-saves, which the .NET Script Framework unfortunately does not support.
    2. tarlazo
      tarlazo
      • premium
      • 3,022 posts
      • 532 kudos
      LOL, thanks.
    3. pangalan
      pangalan
      • member
      • 3 posts
      • 0 kudos
      I'll say, the way you presented it is like Catnip to OC cats. They(we) will definitely want to read it.
      ...also because...IMMERSION!!!
    4. pangalan
      pangalan
      • member
      • 3 posts
      • 0 kudos
      What I'm looking for, however, is the effect to charge drain.
      Does your patch also make it so charge drain will NOT change along with enchantment skill on existing enchantments?
    5. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      I'm not sure what you mean, but the higher your enchanting skill, the less charge your weapon enchantments drain.
  2. kreeten666
    kreeten666
    • member
    • 37 posts
    • 2 kudos
    all this thinking i gotta do - what do I do - - I'm running EnchantmentCostFix.dll - - could I or should I be using ScrambledEggchantments.dll at the same time>?
    1. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      The Enchantment Cost Fix is an earlier version of Scrambled Eggchantments, which includes the enchantment cost fix. So, you should only have one installed at any given time.

      Apologies for the late reply, for whatever reason Nexus does not notify me when someone comments on my articles.
  3. lilebonymace
    lilebonymace
    • supporter
    • 1,640 posts
    • 251 kudos
    So from the user point of view/end result your fix uses the value before reloading, unlike Enchanting Adjustments (whose page says that the value after reloading is correct)? Idk who to believe about which value is correct, perhaps you since you have arguments and Enchanting Adjustments fix shows original value in the UI so that's incomplete anyway
    1. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      I think of the Enchantment Cost Fix as a simplified and improved version of the Enchantment Reload Fix. Like the Enchantment Reload Fix, the Enchantment Cost Fix uses the values that you would be familiar with before reloading.

      The engine code that handles enchanting suggests that these are the correct values. The Enchanting Adjustments and Price-Charge Bug Fix actually exploits a bug to immediately change these values to what they would be after you reload, which is something that the Enchantment Cost Fix fixes.

      Both the Enchantment Reload Fix and the Enchantment Cost Fix can safely be installed or uninstalled at any time. If you want to switch from the Enchantment Reload Fix to the Enchantment Cost Fix then I suggest that you install the Enchantment Cost Fix before you uninstall the Enchantment Reload Fix, and then make a save with both mods installed.

      This allows the Enchantment Cost Fix to copy the values stored by the Enchantment Reload Fix. Otherwise, they will be lost when you switch mods.

      If you would like something else explained, or something that I have already explained put in simpler terms, please let me know.
    2. lilebonymace
      lilebonymace
      • supporter
      • 1,640 posts
      • 251 kudos
      okay thanks, so i got it correctly. this is what Enchanting Adjustments page says, tho
      In Vanilla, when a player enchants an item, both its price and charges are wrong. They do not match leveled items of the same enchantment strength and the gold value actually decreases with strength (which makes no sense). The wrong values correct themselves on game reload...
      i use Enchanting Adjustments and i could cut that fix from Enchanting Adjustments somehow to use it with yours but what it says about its own implementation makes sense too
    3. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      I do address this in the article. The cost of player created enchantments is intentionally different to the cost of other enchantments. The cost of an enchantment affects not only its value, but also how much charge weapon enchantments drain on each hit.

      The cost of player created enchantments decreases as your skill in enchanting increases so that weapon enchantments drain less charge. This is shown by the formula that I have included in the article. It does also decrease the value of the enchantment, but that is only a side-effect.

      This becomes pretty obvious if you take a look at the code yourself. For reference, the overridden cost of player created enchantments is specifically set at 0x1408737FC in SkyrimSE.exe version 1.5.97.
    4. lilebonymace
      lilebonymace
      • supporter
      • 1,640 posts
      • 251 kudos
      okay, makes sense.
      It does also decrease the value of the enchantment, but that is only a side-effect.
      sounds like another things you could try to fix :D
    5. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      Unfortunately there is nothing to fix. They made the decision that both the value of an enchantment and how much charge weapon enchantments drain should depend on the cost of the enchantment. You need to consider that if the value of the enchantment doesn't depend on the cost of the enchantment, then it needs to depend on something else.

      If you're interested, the value of armour and weapon enchantments are calculated using the following formulas:
      Armor enchantment value = EnchantmentCostWeapon enchantment value = (fEnchantmentPointsMult * MaximumCharge) + (fEnchantmentEffectPointsMult * EnchantmentCost)
      The best you could realistically do is change the function that gets the value of the enchantment to always use the default cost of the enchantment, even if it has been overridden. This would change the value of enchanted items to what you are familiar with after you reload, which people seem to be happier with.
    6. lilebonymace
      lilebonymace
      • supporter
      • 1,640 posts
      • 251 kudos
      the problem is that the value decreases with charge drain decrease, when it should increase. you can just use the old cost not modified by the skill level. it also could depend on the old/original cost that's modified in the opposite side by your skill level or the new cost somehow modified so it's equal to that. the EnchantmentCost value in the formulas can be modified using the enchanting skill level again
    7. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      Good idea, I actually just edited my post to suggest that the value of an enchantment could always use the default cost. Unfortunately, it would require rewriting the function that gets the cost of the enchantment. That won't take too long, but I do prefer to keep things as simple as possible.

      I'll take a look at it once I implement the fEnchantmentGoldMult patch that I mentioned in the posts section of the mod page itself. I should be able to implement this by patching the same function that I am already looking at.

      I might actually move all of my enchantment related patches over to the Enchantment Cost Fix plugin to try and simplify things for people.
    8. KernalsEgg
      KernalsEgg
      • premium
      • 1,147 posts
      • 283 kudos
      I have finally released the patch that allows you to use the default cost of the enchantment to calculate its value. It was simple to add, but I wanted to add a bunch of other changes before I released it. You can download it in Scrambled Eggchantments, but keep in mind that it is disabled by default.
  4. bdip
    bdip
    • premium
    • 622 posts
    • 9 kudos
    I really appreciate this article and it's thorough explanations. I never fully understood this bug or how the various attempts to fix it and how they differentiated from each other. Very insightful and interesting read. And, of course, thank you for providing your own take on the fix.