1. For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
    Dismiss Notice

Fall damage taken is based on distance, not velocity

Discussion in 'PC Bug Reports' started by bugsandwhatnot, Jul 10, 2019.

  1. bugsandwhatnot

    bugsandwhatnot Terrarian

    (I have searched for similar threads, but keep getting the security error even after reloading.)

    1. Fall so far that landing would kill the character.
    2. Get hit by an enemy from below so that your character's vertical speed is greatly lowered.
    3. Land after the hit and die from fall damage.


    This looks really weird to me. I'd accept it if landing on the enemy would first inflict fall damage, then enemy damage.

    Fall damage should be based on the character's vertical speed at the moment of landing, not how far it has fallen.
  2. Laluzi

    Laluzi Skeletron

    This isn't a bug - it's just how the game is designed. Proposing a change to it probably belongs in suggestions, not bug reports.

    I do note that setting it to velocity would make the slime mount insanely dangerous.
    TheWorfer27 likes this.
  3. bugsandwhatnot

    bugsandwhatnot Terrarian

    Yeah, that's another thing: my stopwatch shows 51 mph when falling with or without that mount.. and the mount is clearly faster. :confused:

    Besides, how do you know it's designed that way? To me (programmer), this look like a shortcut.
  4. Laluzi

    Laluzi Skeletron

    Huh. In that case, it actually wouldn't affect fall damage with that mount - but, as you say, it would still be erroneous. My guess is that the slime mount applies the x2 speedmult to vertical motion in some additive fashion to the game's actual physics engine, so the numeric values are either drawn from the wrong place or the game actually does think you're falling at 51mph, just with some weird effect in play.

    Know? I mean, I don't. Any of the devs could come in here and prove me wrong, but I (also programmer) came to this conclusion for two major reasons.

    1. The player reaches terminal velocity very quickly. Velocity-based fall damage means that past a certain point, the distance of falls doesn't matter, but for Terraria's range of motion, that point is reached fast. Consider a player jumping from a sky island down an unbroken hellevator, and also a character jumping off a steep naturally-generated hill on the surface. Either they're both instakilled or they can both survive.
    2. It would have been very easy for them to build a velocity-based damage system - arguably, it would actually be slightly easier, because the game wouldn't have to store any values or mark fall-breakers like double jumps or cobwebs, just reference the player's current velocity when they hit a valid surface. So to me, it's sort of tautological - it is what it is because if it was intended to be something else, it would be something else.

    Also, that's literally how fall damage is coded.

    damage = MAX(1, 10([fall height in blocks] - [25, 40 if Frog Leg equipped]) - ROUND_UP([armor rating]/2))

    Annotations mine.

    Terraria's not super beholden to realism and going velocity-based with the game's current terminal velocity would negatively impact gameplay, so I'm fine with the way it is.

    The visible disparity of getting hit by an enemy and still receiving full fall damage could be corrected within the current system, counting enemy contact as a height reset unless the player is immune to knockback.
    bugsandwhatnot likes this.
  5. bugsandwhatnot

    bugsandwhatnot Terrarian

    Cool. Yeah, you're right.. the quick max speed makes this approach necessary, but also that "counting enemy contact as a height reset" might be a solution.

    On the third hand, the mechanical cart goes faster than 100 mph (game supports fast movement), so perhaps increasing the max falling speed would work in combination with checking the velocity when landing.. but I haven't thought this through.
    Last edited: Jul 12, 2019
    Laluzi likes this.