1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

Guide The Health Regen Formula Has Been Reverse Engineered

Discussion in 'Wynncraft' started by touhoku, Jun 1, 2021.

Thread Status:
Not open for further replies.
  1. touhoku

    touhoku heavy spell pioneer VIP+

    Messages:
    519
    Likes Received:
    837
    Trophy Points:
    91
    Guild:
    Minecraft:
    Here's a bit of a minithread while I procrastinate work on the archer testing; the way health regen, and specifically natural hpr works has been a bit of a mystery to many of us, so we decided to try to reverse engineer what is going on.

    Screen Shot 2021-06-01 at 7.49.00 PM.png
    (it wasn't that bad)

    The Basics:
    There are four components of the health regen formula: raw hpr, %hpr, natural hpr, and true hpr

    Raw and %hpr are the easiest to explain so I'll start there:
    - raw hpr is the raw hpr id stat in your build.
    - %hpr is the percent hpr id stat in your build.
    Simple.

    True hpr can be thought of as sort of similar to the penalty for repeated spell costs if you are familiar with that. Basically, if you do regen positive health, it will always be at least 3—this value is the true hpr used in the formula. It's simple (true hpr = 3) but I think it's kind of important to give it a name before I stick it in the formula later so it's clear where it comes from.

    Natural hpr
    This is arguably the most complicated part of the formula, so I'll dedicate a whole section to it.

    The natural hpr value (later used in the final formula) depends on three factors: current mana, current health, and maximum health.

    @CrunchyCol tested for a series of ticks starting at 1hp with a maximum hp of 10k, which I plotted on desmos here:
    Screen Shot 2021-06-01 at 8.15.19 PM.png

    In a bit of basic testing, we found that the first tick from 1hp was always about 1/60th of max hp + 3 (true hpr foreshadowing!?), and with that information, @hppeng quickly pointed us towards exponential functions, and we found the correct formula on our third or fourth try:
    [​IMG]
    mmmm exponential equations
    Screen Shot 2021-06-01 at 8.36.49 PM.png

    As you can see, mana has an impact on raw hpr, but only to an extent; being at zero mana essentially cuts your natural hpr by a flat 40% regardless of current hp.

    Case 1:
    Now for the final formula. Here is the most common case:

    Screen Shot 2021-06-01 at 8.21.23 PM.png

    This case applies when natural + raw is greater than zero.

    The natural value we calculate from the step above is added to the raw value in the build, all multiplied by 1 + % (for instance, 100% hpr leads to a 2x multiplier here), and then finally the true +3 is added. Overtime, as current health increases, natural decreases towards zero, which is why builds with no raw hpr eventually only gain 3 health per tick (true hpr).

    Case 2:
    Another case occurs when the raw + natural value is less than zero, and the percent hpr is not above 100%.

    Screen Shot 2021-06-01 at 8.26.32 PM.png

    The only difference here is how the % is applied: when you have negative raw + natural, negative % amplifies the effect of the negative raw/natural, and positive % diminishes it.

    It is important to note that some builds can have case 1 apply at low hp, but case 2 at high hp. A common case of this is low -hpr rage hero: when your current hp is particularly low, the natural term will be high enough to make the raw + natural factor greater than zero, leading to case 1 where health is gained. At higher health, as the effect of natural diminishes, we shift to case 2, and hp decreases back down towards a number where it stabilizes (assuming your mana stays constant).

    EDIT: @iTechnically has pointed out that cases 1 and 2 can be condensed into 1 formula:
    hpr = (natural + raw) + |(natural + raw)| * % + true

    Also notably, there is a special case within case 2 where %hpr is exactly 100%. The 1-% term is exactly zero, which means the initial part of the equation is neutralized and all that is left is 3, true hpr.

    Case 3:
    This case applies when natural + raw is less than zero, and % is strictly greater than 100%.

    Unlike the last note, this case follows a very simple formula:
    Screen Shot 2021-06-01 at 8.32.02 PM.png
    yep.

    Due to the way hprcancelling was implemented, when natural + raw is negative and % is greater than 100, wynncraft knows to not apply any health regen, including the true hpr. This suggests it is some sort of override, as mathematically we would expect a nonzero result; at least 3 given the position of true hpr in the formula.

    This means that for true "hpr-cancel" purposes (for rage builds most importantly), you actually need more than 100% hpr—just having 100% will lead to a gain of 3 hp every 4 seconds.

    Credits:
    @iTechnically
    @CrunchyCol
    @Gigavern
    @hppeng
    @Neptune
     
    Last edited: Jun 2, 2021
    Ingo, Crystqllized, Verle and 37 others like this.
  2. CrunchyCol

    CrunchyCol Crispy? Blah. Crunchy? Yum. CHAMPION

    Messages:
    550
    Likes Received:
    931
    Trophy Points:
    91
    Minecraft:
    Here is a two hour video of me watching my hp naturally regenerate:
     
  3. oinuk

    oinuk c lown

    Messages:
    3,437
    Likes Received:
    5,269
    Trophy Points:
    217
    Guild:
    Minecraft:
    lots of numbers lots of math lots of real world appl--
    i enjoy watching the funny hearts change colors at different speeds :slight_smile:
     
    Dream, CrunchyCol, Wxhlf and 3 others like this.
  4. Crokee

    Crokee Nudist poking eyes HERO

    Messages:
    1,121
    Likes Received:
    3,158
    Trophy Points:
    164
    Guild:
    Minecraft:
    I see Guide and I see Atlas Inc people I instant like.

    Now for the actual question: why is this formula so complicated.........
     
    Crystqllized, Dream, Dr Zed and 9 others like this.
  5. touhoku

    touhoku heavy spell pioneer VIP+

    Messages:
    519
    Likes Received:
    837
    Trophy Points:
    91
    Guild:
    Minecraft:
    hey at least we aren't running out of needlessly weird shit to test
     
    Druser, CrunchyCol, hppeng and 2 others like this.
  6. NamesAreHard

    NamesAreHard Mage Enthusiast (She/He/They) CHAMPION

    Messages:
    1,379
    Likes Received:
    2,223
    Trophy Points:
    153
    Guild:
    Minecraft:
    So, are there any wynncraft mechanics that aren't needlessly complicated and weird?
     
  7. touhoku

    touhoku heavy spell pioneer VIP+

    Messages:
    519
    Likes Received:
    837
    Trophy Points:
    91
    Guild:
    Minecraft:
    um












    no
     
  8. NagisaStreams

    NagisaStreams Sertified idiot Staff Member Moderator QA HERO

    Messages:
    316
    Likes Received:
    911
    Trophy Points:
    91
    Guild:
    Minecraft:
    cool thread, as usual tune in next week to find out how your hpr is tied to how many emeralds you will get per mob kill
     
    Crystqllized, Verle, nkklk and 15 others like this.
  9. 5hadowflame

    5hadowflame untrained unprofessional idiot VIP+

    Messages:
    168
    Likes Received:
    225
    Trophy Points:
    38
    Minecraft:
    Me when tou takes you seriously and does testing for emerald drop rates per hit with stealing and mob kill loot to calculate your effective hpr with a greed build for every stealing % level




    Unless that was serious and you actually are testing it right now
     
    oinuk and touhoku like this.
  10. touhoku

    touhoku heavy spell pioneer VIP+

    Messages:
    519
    Likes Received:
    837
    Trophy Points:
    91
    Guild:
    Minecraft:
    oh god that's a good idea why must you do this to me
     
    hppeng and oinuk like this.
  11. NagisaStreams

    NagisaStreams Sertified idiot Staff Member Moderator QA HERO

    Messages:
    316
    Likes Received:
    911
    Trophy Points:
    91
    Guild:
    Minecraft:
    Yes there are, how could you say such a thing.
    Determining uhhh
    uhhhhhhhhhhhhhhh
    there has to be something here
    *checks notes*
    Ah here we go!
    Exploding!

    Not even joking if atlas inc finds a way to break exploding I give up.
     
    5hadowflame, fishcute and touhoku like this.
  12. touhoku

    touhoku heavy spell pioneer VIP+

    Messages:
    519
    Likes Received:
    837
    Trophy Points:
    91
    Guild:
    Minecraft:
    bet.
     
    FAZu and NamesAreHard like this.
  13. NamesAreHard

    NamesAreHard Mage Enthusiast (She/He/They) CHAMPION

    Messages:
    1,379
    Likes Received:
    2,223
    Trophy Points:
    153
    Guild:
    Minecraft:
    This is so threatening I love it
     
    touhoku likes this.
  14. iTechnically

    iTechnically don't ask me for warrior builds

    Messages:
    305
    Likes Received:
    391
    Trophy Points:
    85
    Minecraft:
    ha ha ha, totally not me getting credited for calling Col then hopping off to sleep
    upload_2021-6-2_10-39-58.png
     
  15. Saya

    Saya you win at uwynn VIP+

    Messages:
    2,662
    Likes Received:
    5,436
    Trophy Points:
    164
    Guild:
    Minecraft:
    When I joked about it yesterday, I had no idea this would happen anytime in the near future, much less today of all days.

    Maybe it's time to adjust expectations because this speed is consistently bonkers
     
    Last edited: Jun 2, 2021
    touhoku, Druser, CrunchyCol and 2 others like this.
  16. fishcute

    fishcute fish VIP

    Messages:
    676
    Likes Received:
    692
    Trophy Points:
    98
    Minecraft:
    I noticed that this was happening a while ago, and was wondering if a build could be made that would naturally trend towards a specific health. I imagine this could be useful to hero builds that would want hpr but also need to stay under a certain health, so a formula for equilibrium health could be useful.
     
    hppeng and touhoku like this.
  17. Druser

    Druser ele defs don't matter HERO Featured Wynncraftian

    Messages:
    5,732
    Likes Received:
    10,347
    Trophy Points:
    217
    Guild:
    Minecraft:
    Great thread as usual, touhoku and co.

    You can plug your desired hp target into the natural hpr formula and have negative of that in raw hpr for a very close benchmark (excluding true hpr, but it probably is not worth accounting for that since the change is tiny and you'll get hit anyway).

    Note that in this case, you would increase your actual hpr at lower health than your target by running more hpr%.
     
    touhoku and iTechnically like this.
  18. JaydonTheWarrior

    JaydonTheWarrior Jumla Is best dad. HERO

    Messages:
    2,727
    Likes Received:
    5,003
    Trophy Points:
    209
    Guild:
    Minecraft:
    This is something I've noticed, but I've always just thought "werid fucking wynncraft jank" and honestly tried to ignore it.

    The only thing i understood was "ogga booga, lower Hp equals bigger number, ogga booga."
    And frankly, after reading this, that's still all I understand.
     
    touhoku likes this.
  19. touhoku

    touhoku heavy spell pioneer VIP+

    Messages:
    519
    Likes Received:
    837
    Trophy Points:
    91
    Guild:
    Minecraft:
    hppeng and I have actually already been calculating this for rage hero already, it's pretty simple!
     
    fishcute and hppeng like this.
  20. expectocat510

    expectocat510 Travelled Adventurer HERO

    Messages:
    24
    Likes Received:
    40
    Trophy Points:
    19
    Minecraft:
    why is this so complicated it's just hpr
     
    touhoku likes this.
Thread Status:
Not open for further replies.