Varying damage numbers?

Jostabeere

Terrarian
I never really asked this myself, but after years I just noticed. why does the game have varying damage numbers, and how are they calculated?
So my weapon has one single damahe number.
Let's say it is 100. My accessories give me a flat bonus. 15% or 10% or whatnot. It is always the same bonus.
Enemies always have the same defense rating.
Crits are coded to do double damage. So in theory I should always do the very same amount of damage to a mob. But we all know it is always varying. And I wonder why? I couldn't find a damage formula and what factor randomizes it.
 
I never really asked this myself, but after years I just noticed. why does the game have varying damage numbers, and how are they calculated?
So my weapon has one single damahe number.
Let's say it is 100. My accessories give me a flat bonus. 15% or 10% or whatnot. It is always the same bonus.
Enemies always have the same defense rating.
Crits are coded to do double damage. So in theory I should always do the very same amount of damage to a mob. But we all know it is always varying. And I wonder why? I couldn't find a damage formula and what factor randomizes it.
It’s varying because you can’t always do the same number, you can’t do the same number always just because that wouldn’t make any sense(although I’m confused why)
 
There's an RNG element to damage. As of 1.4, it's influenced by luck.

Damage calculations in many situations are influenced by luck; positive luck will be favorable to the player. Projectiles are influenced by luck, as is enemy melee damage (i.e. touching a Zombie). Player weapons also take luck into account. Thorns Potions do not appear to use luck.
  • The following steps are taken to incorporate luck into a player's damage:[4]
    • The initial damage value is generated.
    • The game checks if the player has > 0 luck, and if so, generates a random number from 0.0 to 1.0. If the random number is less than the player's luck, a second damage value is generated, and the higher of the two numbers is dealt.
    • If the player has < 0 luck, a random number is generated from 0.0 to 1.0. If the random number is less than the absolute value of the player's luck, a second damage value is generated, and the lower of the two numbers is dealt.
  • This is up to a 5% increase/decrease in average damage before defense.
  • Luck affects PvP the same way it affects regular enemies.
See: Luck
 
Back
Top Bottom