Talk:FStatsHealthLevelMult

Active discussions

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. --InbredMonkey
Not "my" formula, I just put it back to whatever it was before. If that is wrong, it needs fixing. My issue was not in the formula (as I don't know the formula), but with the presentation. A C++ (or any other) program is not desired, because it is more difficult to read than ordinary math, and we would not want one to have to run the code through a compiler and run it. This sort of thing should not be in ObliviScript, C++, or anything else, it should be in math. The goal is for people who come here to understand exactly how FStatsHealthLevelMult is used by the game - simply laying out the formula is what needs to be done. I'll go through what you've posted here, and update the article as necessary, when I get the chance.
You are, of course, welcome to do so yourself if you wish to. --DragoonWraith 10:26, 24 May 2006 (EDT)
Upon reading that more fully... I have a headache. This formula seems needlessly complicated, in my opinion. Whatever. Since I'm having trouble wrapping my mind around this, I hope someone else will do it; just write out the math, don't make a program out of it. I'm actually tempted to just copy over what InbredMonkey's written into the article, since that seems pretty good, but I'm not sure, so this is my official appeal for help. --DragoonWraith 10:54, 24 May 2006 (EDT)
What you wrote looks pretty good, cleaner than what I first wrote. The math for calculating max health is a real pain only because health is not retroactive. Test if yourself by using ModPCAttribute Endurance and gaining some levels. I really need a diagram to explain it.
TEST 1: ModPCAttribute Endurance 50, AdvancePCLevel, AdvancePCLevel
TEST 2: AdvancePCLevel, ModPCAttribute Endurance 50, AdvancePCLevel
The second trial's health should be 5 hp less.
Hopefully this will clear up the retroactive issue.
MaxHealth.png
The blue part is what you call base_health, the red part is lvl_health, and the green part is (endurance_delta * remain_lvls)
I hope this helps! --InbredMonkey

Article Still ConflictingEdit

I updated [[User::InbredMonkey|InbredMonkey's]] formula to a language agnostic format and broke it out into smaller, renamed terms that may help to clarify what he is doing. However, there is still a basic conflict in this article, which is that the preamble and initial description indicate that changes to endurance retroactively apply to the base health, whereas Inbred's formula is based on the notion that changes to endurance are NOT retroactively applied. I don't know which is correct and I can't verify either at the moment. -- Nezroy 12:42, 24 May 2006 (EDT)

I believe it is not retroactive as InbredMonkey has indicated, but I do not know for certain. Of course, I don't know if his specific formula is correct, but I'd guess that it is... I can't imagine making something like that up... --DragoonWraith 13:09, 24 May 2006 (EDT)
Return to "FStatsHealthLevelMult" page.