File information

Last updated

Original upload

Created by

herbert100

Uploaded by

herbert100

Virus scan

Safe to use

About this mod

Willpower will determine the percentage of your maximum magicka that gets regenerated each second. Highly configurable. Atronachs can regenerate magicka with customizable penalties, or not at all. Works for the player and NPCs. Restores magicka when traveling/resting. Requires MWSE.

Requirements
Permissions and credits
How is this mod different from the others?

Most of the other mods calculate the amount of magicka you regenerate independently from your maximum magicka. I found that this could make the percentage of magicka regenerated vary quite a bit as your maximum magicka changes. I also wanted intelligence and willpower to play different roles in magicka regeneration, and wanted there to be some options for Atronachs. So, I made this mod.

Also, this mod works as a framework for making your own proportional magicka regeneration mod. If you like the concept of proportional magicka regeneration, but don't like the provided formulas, you can make your own formula with just a few lines of code. More detailed instructions at the end of the description.

How regeneration works

The total amount of magicka regenerated each second depends on your current intelligence (indirectly) and your current willpower (directly). The same formula applies to both the player and NPCs (but it is possible to set different multipliers for the player or for NPCs).

Willpower:
determines the percentage of maximum magicka being regenerated.
Intelligence: influences magicka regeneration by raising maximum magicka.

This has the effect of making magicka regeneration feel pretty consistent throughout a playthrough, and it also makes the impact of
willpower much more noticeable.

Willpower does not linearly affect magicka regeneration (so doubling your willpower will not double the amount of magicka you regenerate). This is so that getting to obscenely high values of willpower won't give you infinite magicka. I made three different curves that you can choose between, and you can view them either in the mod picture, or on Desmos. You can choose between these different curves in the MCM menu. The x-axis denotes current willpower, and the y-axis denotes the percentage of maximum magicka being regenerated.


Atronach Regeneration

You can configure how Atronachs regenerate magicka with this mod. There are three main settings here:

  • A flat multiplier on magicka regeneration for Atronachs. (Setting this to 0 will disable regeneration for Atronachs).
  • Whether Atronachs can restore magicka by resting
  • Whether Atronachs can restore magicka by traveling.

Why did I do this? There are already lots of ways of getting around the Stunted Magicka penalty, and those methods can be more tempting if you don't passively regenerate magicka (at least I found them to be). By allowing magicka regeneration, but at a much slower rate, I think it can help to make the Atronach sign more appealing on a modded playthrough. (Regenerating 80% less magicka is rough, but not as bad as not regenerating any at all.)

Disabling the regeneration on traveling/resting helps to this effect, since you no longer get a "restore all magicka button" to use outside of combat. But it's entirely optional. :)


All Configuration options

You can customize:
  • The formula that gets used.
  • The multiplier that's applied when in combat (e.g. regenerate 33% less magicka when in combat).
  • The multiplier that's applied to Atronachs (e.g. Atronachs regenerate 20% of the magicka that others would). Setting this to 0 will disable magicka regeneration for Atronachs.
  • Whether Atronachs can regenerate magicka by resting/sleeping.
  • The Multiplier for player regeneration.
  • How many times per second the player magicka regeneration is calculated. (This does not affect how much is regenerated per second.)
  • Whether to enable/disable player regeneration
  • The Multiplier for NPC regeneration
  • How many times per second NPC magicka regeneration is calculated. (This does not affect how much is regenerated per second.)
  • Whether to enable/disable NPC regeneration

Installation
You can install this via the BAIN Installer, or manually place the files into your Data Files/MWSE/mods directory.

If my other mod (herbert lib) is installed, the amount of magicka restored will be approximated by polynomials, resulting in a (theoretical, but most likely not noticeable) performance increase. herbert lib is not required to use this mod, though.


Making your own formula

This mod was designed to be highly extensible. If you want to make your own formula, all you have to do is write one function. Here's an example:

local regen_formulas = require("herbert100.proportional magicka regeneration.regeneration_formulas")

-- this will show up in the MCM as "Linear".
function regen_formulas.linear(willpower)
return willpower / 100
end

The above formula will show up in the MCM labeled "Linear". A picture of what this looks like is provided in the mod photos.

Here's how it works in general:
  • import the table of regen formulas (this is done by the "require" statement)
  • add a new formula to the "regen_formulas" table by defining a function.
  • Save the file in the MWSE/mods directory. For example, you could save it at "Data Files/MWSE/mods/my_custom_regen_formula/main.lua"

The function you're defining should take in one argument (the willpower), and return the percentage of maximum magicka you should regenerate at that willpower value.

In the example, we're returning 0.5 at 50 willpower and 1 at 100 willpower, which would translate to 0.5% at 50 willpower and 1% at 100 willpower.

Then you're done! It will show up in game, work with the MCM, and be treated exactly the same as the formulas included in this mod.

In addition, if my herbert lib mod is installed, polynomial splines will be used on your custom function as well. This means that you don't even have to specify values for each willpower willpower value. You can write something like

local regen_formulas = require("herbert100.proportional magicka regeneration.regeneration_formulas")

function regen_formulas.my_new_formula(willpower)
if willpower < 10 then
return 0.05
elseif willpower < 20 then
return 0.06
elseif willpower < 30 then
return 0.09
elseif willpower < 60 then
return 0.6
else
return 1
end
end

Then the spline will "fill in the blanks" to generate a smooth curve, based on the values you've given. This also means you can go crazy with the complexity of your functions and it won't impact performance at all.


Feedback/Questions/Contributing

I'm open to suggestions on new features people would like, or suggestions on how to do certain things differently. Let me know if you encounter any bugs
and I'll try to fix them as soon as I can. If you would like to make changes/add new features, that would nice as well.

Feel free to contact me with any questions/suggestions you have about this mod. The same goes for if you have any suggestions or if you would like to contribute in some other way. I'm in the Morrowind Modding Community Discord, and if you join you'll be able to send me a direct message. You can also post comments/questions/feedback on the mod page if you'd prefer. :)