Stamina

Stamina is a personal resource in Valheim represented as a yellow bar. Characters have a base 50 stamina, with each bar representing 25 stamina.
Stamina is drained by any actions you perform outside of walking and interacting with objects. These actions include using tools/weapons, and movement that is not walking among others.
Stamina is generated after a few moments of not performing stamina draining tasks or by using Stamina Meads, and can be generated faster with the Resting and Rested Effects, Tasty Mead, and Lingering Stamina Mead.
Stamina will be generated slower while under the Cold, Freezing, and Wet Effects.
== Regeneration ==
Stamina starts regenerating after stamina has not been used for 1 second. Stamina regeneration depends on the amount of remaining stamina and modifiers.
baseRegen = 6 + 6 \cdot \Bigl( 1 - \frac{remainingStamina}{maxStamina} \Bigr) 
regen = baseRegen \cdot modifier_1 \cdot modifier_2 \cdot \ldots \cdot modifier_n 
==== Base regen ====
Maximum base regen of 12 is at zero stamina. Minimum base regen of 6 is that maximum stamina. Average base regen depends how much stamina is regenerated:
* From 0% to 100%: 8.656 per second
* From 0% to 50%: 10.43 per second
* From 0% to 33%: 10.97 per second
* From 0% to 25%: 11.23 per second
* From 50% to 100%: 7.40 per second
* From 33% to 100%: 7.83 per second
* From 25% to 100%: 8.04 per second
With the regeneration delay, the optimal way is to regenerate up to ~50%. With Cold or other negative effects, the optimal limit is ~33%.
==== Modifiers ====
Some actions reduce stamina regeneration and are applied separately from status effects.
* Falling: 0x
* Swimming: 0x
* Blocking: 0.8x
Positive status effects are added additively while negative status effects use multiplication. This means the order of effects matters when there are both positive and negative effects. However Rested and Resting can't be acquired while having any of the negative status effects.
*Freezing: 0.4x
*Cold: 0.75x
*Wet: 0.85x
*Rested: +100%
*Resting: +300%
*Tasty mead: +100%
*Lingering Stamina mead: +25%
For example being Rested, Resting and having Tasty Mead would increase regeneration to +500% which equals 6x regeneration. Being Cold would multiply this by 0.75x and reduce it to 4.5x.
For example being Rested, Resting and Cold equals 3.75x regeneration. Drinking Tasty Mead would increase it to 4.75x.
== Drainage ==
Stamina drainage is dependent on the action of the player.
=== Attacking ===
When the player does an Attack action (left mouse click) the game will calculate the stamina usage with the following formula: 
attackStamina = baseCost \cdot \Bigl(1-\frac{skillLevel}{300} \Bigr) 
with baseCost depending on the weapon and the type of attack. For example baseCost = 30 for the Battleaxe, scaling linearly down to 20 stamina per swing upon reaching level 100 of the Axe skill.
=== Blocking ===
Blocking uses stamina based on how much block power was required to block the damage.
blockStamina = 30 \cdot \frac{usedBlockPower}{maximumBlockPower} 
=== Dodging ===
Dodging uses stamina based on the speed penalty from equipment.
dodgeStamina = 15 \cdot (1 + equipmentSpeedPenalty) 
For example the player has 20% speed penalty with armor, sword and shield. This increases dodging cost from 15 to 18.
=== Jumping ===
Jumping uses stamina based on the speed penalty from equipment.
jumpStamina = 10 \cdot (1 + equipmentSpeedPenalty) 
=== Running ===
Stamina is drained 8 per second (-0.5% per skill level, up to -50%).
=== Swimming ===
Stamina is drained 6 per second (-0.5% per skill level, up to -50%).
=== Sneaking ===
Stamina is drained 5 per second (on average -0.75% per skill level, up to -75%).
===Encumbered===
Stamina is drained 5 per second while moving. 
See: https://en.wikipedia.org/wiki/Linear_interpolation
Category:Gameplay
zh-tw:體力