Talk:FStatsHealthLevelMult

From the Oblivion ConstructionSet Wiki
Revision as of 02:23, 24 May 2006 by imported>Inbredmonkey
Jump to navigation Jump to search

INBREDMONKEY: Formulae are provided so that we can figure out how these variables are used, not to calculate them. Why would we want a C++ program for this? That's irrelevent and makes it difficult to find the desired information. Furthermore, distributing programs to the unknowing masses (assuming they manage to compile it) could be very dangerous - I haven't read your code, though I assume it was clean, but it could easily have been malicious. Therefore, no programs ought to be distributed this way through the Wiki.--DragoonWraith 01:45, 16 May 2006 (EDT)


DragoonWraith: Your formula is wrong and misleading. (Health is not retroactive.)

I used C++ cause I wanted to make sure my formulas were correct and didn't want this troublesome mess of a formula to be my first attempt at scripting. The only thing c++ about it are the assignments, data type declarations, and possibly the % operator.

>>"makes it difficult to find the desired information" huh?

Explaination of my formula, with modulus removed. You can do it all in one formula, but it gets really confusing.


First we calculate how many levels we need to get the highest possible multiplier this should be rounded down to the nearest integer


max_levels = (current_endurance - starting_endurance) / iLevelUp10Mult


Next we calculate the attibute gain that is left over (one more level where we gain less than the highest multiplier)


partial_level_amt = (current_endurance - starting_endurance) - iLevelUp10Mult * max_levels


We also need to find out how many levels we aren't getting the highest multiplier.


remaining_levels = current_level - 1 - max_levels


This is how much health we would have if we got the highest endurance multipliers every level untill reaching the current endurance.


max_max_health = (current_endurance * 2) + (FStatsHealthLevelMult * (((current_level - 1) * starting_endurance) + (iLevelUp10Mult * (max_levels + 1) * max_levels / 2) + ((current_endurance - starting_endurance) * remaining_levels)))


And a breakdown of the components:


the retroactive part: (current_endurance * 2)

This part is self explanatory, but the rest needs to be un-factored into 3 parts to be explained.


This is the per-level health gain from your starting endurance:


FStatsHealthLevelMult * (((current_level - 1) * starting_endurance)


This is the health gained from levels while maxing endurance. For those of you who know how to sum series, you should see it is the summation of FStatsHealthLevelMult * iLevelUp10Mult * i where i goes from 1 to max_levels.


FStatsHealthLevelMult * (iLevelUp10Mult * (max_levels + 1) * max_levels / 2)


This is the per-level health gain from the difference between your starting and current endurance over the levels where you should have it makes:


FStatsHealthLevelMult * ((current_endurance - starting_endurance)*remaining_levels))


Another thing to consider is how much health we would have if we waited as long as possible before raising endurance.


min_max_health = (current_endurance * 2) + (FStatsHealthLevelMult * (((current_level - 1) * starting_endurance) + (iLevelUp10Mult * (max_levels + 1) * max_levels / 2) + (partial_level_amt * (max_levels + 1))))


I am not going to fully explain the terms, but basically, now you assume the levels where you weren't raising your endurance happened all at your starting endurance instead of your max endurance.


I really wanted to make a retroactive health mod, but there is no elegant way to do it, mostly due to the fact that there is no easy way to get the player's starting endurance, also it is hard to get the health to update only when it is supposed to.


Use my formula or don't use my formula, I don't care, just don't leave your incorrect formula on this site.