0 of 0

File information

Last updated

Original upload

Created by

anarkopsykotik

Uploaded by

CrazyJunky

Virus scan

Safe to use

19 comments

  1. maxnaldogmail
    maxnaldogmail
    • member
    • 0 kudos
    this mod break the eitr bar in the mistlands update.
  2. nukeajs
    nukeajs
    • member
    • 1 kudos
    https://valheim.thunderstore.io/package/Horem/LessFoodDegradation/

    ^^^ Updated for H&H

    Haven't tried it yet but all his other stuff works just fine.
  3. ShootOut37
    ShootOut37
    • member
    • 0 kudos
    Can you please make a version with no food degradation at all?
  4. elendar37
    elendar37
    • member
    • 0 kudos
    Is this ever going to get an update?   I hate the food degradation.
  5. TLofZelda
    TLofZelda
    • member
    • 1 kudos
    I really hope this will get an update for Hearth & Home because this is one of my staple mods that I just do not want to play without.
    1. Dragoonza91
      Dragoonza91
      • member
      • 0 kudos
      I just remembered this mod when reinstalling for the new update. Is it not working with hearth and home then?
    2. TLofZelda
      TLofZelda
      • member
      • 1 kudos
      Food in general got a huge update with H&H and this mod hasn't been working for me at all since the update unfortunately. :(
    3. Dragoonza91
      Dragoonza91
      • member
      • 0 kudos
      Aw damn, yeah so far I like the updated food but am missing the changed degradation of this mod.  
      Similarly a a mod used to change stealth to not cost stamina seems to have been deleted =|
    4. TLofZelda
      TLofZelda
      • member
      • 1 kudos
      Aw man that stinks.
    5. Thorantor
      Thorantor
      • member
      • 0 kudos
      If you want to use a similar mod in the meantime, google for a mod called "PreWorkout" (the author seems to have deleted the mod here). The mod is less elegant and disables the degradation alltogether. But its still better than nothing.
    6. Horemvore
      Horemvore
      • member
      • 6 kudos
  6. Gotyam
    Gotyam
    • premium
    • 0 kudos
    This is something I've been wanting, and some crazy junky went and uploaded it. If possible, a version where the degration is more of a curve (decreases slightly at first, and when it starts flashing is the turning point) then that would be better for me, but I do love me this version as well. The formula would fit a curve of 2x-x^2.

    Will use this as is for now though, much better than the mod that has it be 100% efficient until the food runs out, or vanilla's linear degregation!
    1. smokesgabbiani
      smokesgabbiani
      • supporter
      • 0 kudos
      Yeah I feel you on having a preferred curve.  I want it so you initially only get 50% of the food benefit, and over the first 1/4 of it's total duration, it linearly scales up to 100% benefit.  Remain at 100% benefit for 1/2 of the total duration, then scale down to 0% benefit over the last 1/4 total duration.  Then, if you consume new food while it's still over 50%, the curve of the new food starts where the old food left off.  Bonus points if the static linear curve would still apply, so any extra time spent gets added to the 50% total duration of 100% effectiveness.

      But more then anything, can we get a mod that adds timers next to the food already? lol I swear this game is going to get me into modding before the year is over.
    2. CrazyJunky
      CrazyJunky
      • member
      • 0 kudos
      Hey mate, if you can translate your formula into code, I'd be glad to upload a version with it, but I will admit being a bit too lazy to figure it out myself given my version was exactly what I wanted.
      Here's the original function that get called each tick to update you health/stamina

          private void GetTotalFoodValue(out float hp, out float stamina)
          {
              hp = 25f;
              stamina = 75f;
              foreach (Player.Food mFood in this.m_foods)
              {
                  hp = hp + mFood.m_health;
                  stamina = stamina + mFood.m_stamina;
              }
          }

      each food (mFood.m_health) at this point already have the decayed health amount stored, because it gets updated each tick in another function
      here's the part that update each food health amount each tick Player.Food mHealth = mFood;
      mHealth.m_health = mHealth.m_health - mFood.m_item.m_shared.m_food / mFood.m_item.m_shared.m_foodBurnTime;

      And here's my updated GetTotalFoodValuefunction

      hp = 25f;
      stamina = 75f;
      foreach (Player.Food mFood in ___m_foods) // for each food consumed by the player
      {
      //Debug.Log("food:" + mFood.m_name);
      //Debug.Log("hp before:" + hp);

      float foodMaxHealth = mFood.m_item.m_shared.m_food;
      float foodPercentageLeft = mFood.m_health / foodMaxHealth;
      float foodOldDecayedHealth = foodMaxHealth - mFood.m_health;
      float foodDecayedHealth = (foodOldDecayedHealth - (foodMaxHealth / 2)) * 2; //decay twice as fast, but only starting from half time.
      //Debug.Log("foodMaxHealth:" + foodMaxHealth);

      if (foodPercentageLeft >= 0.5f) // if less than half of the food time has been spent
      {
      hp = hp + foodMaxHealth; // give the max health of the food
      }
      else
      {
      hp = hp + (foodMaxHealth - foodDecayedHealth); //else give the calculated decayed amount
      }
      //Debug.Log("hp after:" + hp);
      // same for stamina
    3. RAkos974
      RAkos974
      • member
      • 0 kudos
      smokesgabbiani i would love to see that happens ! 
    4. DeusExanimis
      DeusExanimis
      • member
      • 0 kudos
      I think you would need to change the line after the else to

      hp = hp + foodMaxHealth * ( 4 * foodPercentageLeft - 4 * foodPercentageLeft * foodPercentageLeft );

      This way you have:
      1. Health degrades in a quadratic curve (after foodPercentageLeft falls below 1/2).
      2. Health is hp+foodMaxHealth if foodPercentageLeft is 1/2.
      3. Health is hp if foodPercentageLeft is 0.
      4. Health is a smooth function (differentiable even at foodPercentageLeft=1/2).
      You dont need foodDecayedHealth and foodOldDecayedHealth anymore, if you use this line.

      Btw: thank you CrazyJunky for modding and posting your work here :-)
  7. missingmyname
    missingmyname
    • premium
    • 0 kudos
    This mod seems to conflict with Cooking Skill. The issue is that the bonus food/stamina from that mod isn't applied with this mod active.

    I believe the issue is with this mod, but I have posted there as well. I suspect this from examining the code you gave below.
  8. Stoan
    Stoan
    • supporter
    • 0 kudos
    Is this client side only single player. Client side only Multiplayer. Server/Client required for multiplayer? Does everyone have to have the mod, or only those with the client version on a server with it enabled will this work?
    1. CrazyJunky
      CrazyJunky
      • member
      • 0 kudos
      Hey, didn't test it out multi yet, but given how much is handled client side, I'd expect this to work for every clients that installed it without affecting others / needing server.
      If someone could confirm that'd be great.

      EDIT : played with some friend on their server, worked fine for me, didnt affect them