Author Topic: Question about fall damage  (Read 3557 times)

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Question about fall damage
« on: September 18, 2010, 08:18:00 PM »
specifically on q2rdm7

some times falling from the top level to the bottom level i take no damage, and some times i take a small amount of fall damage

no jumping, just walking right off the edge of places like the yellow armor to fall down to the level bellow

would like to know why some times i do and some times i dont... :/ would be helpful knowledge to have if im risking a fall with 1 health or somethin
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1371
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #1 on: September 18, 2010, 09:14:53 PM »
The defining function is P_FallingDamage in p_view.c and it depends on a value called 'delta' which is derived from the velocity in the Z direction (up/down)when the player hits the ground. The further you fall the bigger the value of delta. But there are some hard-coded thresholds for delta that determine how much damage you're going to get, and there's the uncertainty of the time-quantum of when you launch and when you land. The variable delta is a floating point value but the logic surrounding it is crisp, based on some comparisons with integer constants. If delta <= 30 it's a short fall, no damage, if it's 55 or greater then it's a far fall for sound event purposes but the damage inflicted is directly proportional to (delta - 30)/2 and damage at a minimum will be 1 unit.

Now, because delta is a float and level.time is a float and the initial speed vector is a float and 'damage' is an integer it introduces a kind of randomness to the actual value of damage you will get for any falling instance. Why? Because when comparing floats, there is always a bit of error in the representation and when comparing a float that's 30.00001 to 30 it compares greater so all it takes is a little bit of bias in one value at the initiation of the fall to create a big difference in the result.

Probably TMI but that's what's going on in the game physics. How can you control delta when going into a fall? I have no idea. Just play the game.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #2 on: September 18, 2010, 09:57:40 PM »
The defining function is P_FallingDamage in p_view.c and it depends on a value called 'delta' which is derived from the velocity in the Z direction (up/down)when the player hits the ground. The further you fall the bigger the value of delta. But there are some hard-coded thresholds for delta that determine how much damage you're going to get, and there's the uncertainty of the time-quantum of when you launch and when you land. The variable delta is a floating point value but the logic surrounding it is crisp, based on some comparisons with integer constants. If delta <= 30 it's a short fall, no damage, if it's 55 or greater then it's a far fall for sound event purposes but the damage inflicted is directly proportional to (delta - 30)/2 and damage at a minimum will be 1 unit.

Now, because delta is a float and level.time is a float and the initial speed vector is a float and 'damage' is an integer it introduces a kind of randomness to the actual value of damage you will get for any falling instance. Why? Because when comparing floats, there is always a bit of error in the representation and when comparing a float that's 30.00001 to 30 it compares greater so all it takes is a little bit of bias in one value at the initiation of the fall to create a big difference in the result.

Probably TMI but that's what's going on in the game physics. How can you control delta when going into a fall? I have no idea. Just play the game.

so in other words its gonna be a gamble either way :/ damn mappers couldnt make the fall one unit less... >_> oh well thanks for the info
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Er!c@

  • Swanky Member
  • *****
  • Posts: 627
  • “Hell is empty and all the devils are here.”
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #3 on: September 18, 2010, 11:10:37 PM »
I've noticed in regular quake 2 mods, along with AQ2 were fall damage is something you are really careful about.

That if you hit a slanting ramp just right you wont take any fall damage from any height.

I've done it a few times on the ramp on aerowalk going to mega, if you drop down from rail to it, sometimes you can land it with no damage. Noticed it on accident one day when I had about 2hp and no armor dropped down, saw my health thought i was dead then when i landed i was alive got mega and managed to pull off a win.


never understood why this was.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
"<[2d> i am considering suiciding dont worry" <br><br>

"<@Killo> damn so ericas right
<@Misery> she always is"

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #4 on: September 19, 2010, 12:04:59 AM »
I've noticed in regular quake 2 mods, along with AQ2 were fall damage is something you are really careful about.

That if you hit a slanting ramp just right you wont take any fall damage from any height.

I've done it a few times on the ramp on aerowalk going to mega, if you drop down from rail to it, sometimes you can land it with no damage. Noticed it on accident one day when I had about 2hp and no armor dropped down, saw my health thought i was dead then when i landed i was alive got mega and managed to pull off a win.


never understood why this was.

good for you, there are no ramps within falling distance anywhere on q2rdm7 so you completely missed the question that was already answered, and chose to put up completely irrelevant and totally useless information
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Er!c@

  • Swanky Member
  • *****
  • Posts: 627
  • “Hell is empty and all the devils are here.”
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #5 on: September 19, 2010, 12:20:28 AM »
actually i was just curious cuz qwazywabbit seems to know what he was talking about. and since it was a topic pertaining to fall damage i asked. excuse me.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
"<[2d> i am considering suiciding dont worry" <br><br>

"<@Killo> damn so ericas right
<@Misery> she always is"

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1371
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #6 on: September 19, 2010, 10:59:17 AM »
I didn't see a question in Erica's post so I didn't reply to anything directly. I also thought her comments were a contribution to the discussion about the game physics. Understanding the physics of what you can or can't do in the game is all part of becoming a better player. It's quite possible a ramp is not considered "ground" or floor in a map. I don't know. I just upgraded to a new computer so my debugger isn't working properly right now.

Attacking her personally for just making some comments just proves that you really are a total dick so your reputation is deserved. I think you owe her an apology.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline VaeVictis

  • i was -1 because you fucking suck
  • Brobdingnagian Member
  • *
  • Posts: 4498
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #7 on: September 19, 2010, 11:18:21 AM »
I didn't see a question in Erica's post so I didn't reply to anything directly. I also thought her comments were a contribution to the discussion about the game physics. Understanding the physics of what you can or can't do in the game is all part of becoming a better player. It's quite possible a ramp is not considered "ground" or floor in a map. I don't know. I just upgraded to a new computer so my debugger isn't working properly right now.

Attacking her personally for just making some comments just proves that you really are a total dick so your reputation is deserved. I think you owe her an apology.

she should know better than to comment on a thread made by me, i will never apologize to the likes of her :)
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF] Reflex

  • Loquaciously Multiloquent Member
  • ****
  • Posts: 5324
  • !
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #8 on: September 19, 2010, 02:38:52 PM »
she should know better than to comment on a thread made by me,i will never apologize to the likes ofher :)

Close as we are going to get.   

Don't be a douche.
« Last Edit: September 19, 2010, 02:41:13 PM by [BTF] Reflex »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Sometimes I think it’s a sin when I feel like I’m winnin’ when I’m losin’ again

Offline haunted

  • Irrepressibly Profuse Member
  • *
  • Posts: 10149
  • I am hollywood.
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #9 on: September 19, 2010, 04:07:28 PM »
Assuming that delta is the rate of change, in regard to speed, in the Z direction........ If vae's problem is constant, my first thought is that the distance you travel in the air, NOT air time, is a factor in fall damage's equation. Airtime should of course remain constant. Due to q2's physics, the amount you strafe or circle off the edge, your 'air distance' will be unique every time being that there's another rate of change in the mix.

I would like to see the exact equation written out.. I assume qwazy has and he's right, the above would be my first thought ignorant to the equation though.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline QwazyWabbit

  • Carpal Tunnel Member
  • ******
  • Posts: 1371
    • View Profile
  • Rated:
Re: Question about fall damage
« Reply #10 on: September 19, 2010, 05:30:50 PM »
I took Vae at his word that he's stepping straight off the edge, no strafing.

The code deals with two issues interlaced, the amount of damage inflicted and the class of the fall involved. The latter is used to determine the sounds generated on the landing in the sound event.

I will copy-paste the relevant, damage inflicting, code here; you can look up the entire function if you like.

After determining the entitity is a player and he's in the game, this computes delta based on the condition that Z velocity is negative and increasing (due to gravity) and the entity has not "landed".

   if ((ent->client->oldvelocity[2] < 0) && (ent->velocity[2] > ent->client->oldvelocity[2]) && (!ent->groundentity))
   {
      delta = ent->client->oldvelocity[2];
   }
   else
   {
      if (!ent->groundentity)
         return;
      delta = ent->velocity[2] - ent->client->oldvelocity[2];
   }



Once he lands we compute:

   delta = delta*delta * 0.0001;

Delta is now delta^2/10000.

and ...
   ent->client->fall_value = delta*0.5;
   if (ent->client->fall_value > 40)
      ent->client->fall_value = 40;
   ent->client->fall_time = level.time + FALL_TIME;


(fall_value and fall_time are used in SV_CalcViewOffset to compute the view and pitch angles in the view on landing)

Then we compute the damage and decide whether to apply it to the player:

      damage = (delta-30)/2;
      if (damage < 1)
         damage = 1;
      VectorSet (dir, 0, 0, 1);
      
      if (!deathmatch->value || !((int)dmflags->value & DF_NO_FALLING) )
         T_Damage (ent, world, world, dir, ent->s.origin, vec3_origin, damage, 0, 0, MOD_FALLING);



The velocity in the Z direction is always going to be proportional to the air time and on a step-off the initial value should be zero. What I see happening is the initial  Z velocity can be "approximately" zero and the time of the fall can be "approximately" equal and the delta at impact can be "approximately" the same but when it gets converted from the floating point value to the integer damage value it can vary by at least 1 damage quantum for the same "initial conditions". If you step up close to the edge and step off, it can affect the flight time, the distance can vary, affecting the horizontal velocity and changing the flight time. IMO, this just adds a bit of randomness to the physics so you don't have a cut and dried formula for always succeeding.

As for Erica's ramp jumps, I wonder if the ramp angle allows the delta to be computed "softly" due to bouncing down the ramp. It would be interesting to test this. Jumping straight down stairs from the top to the bottom might soften the damage also. One of my favorite shots when I can pull it off is the suicidal jump off a ledge taking the shot on an opponent from mid-air. Lots more fun than getting fragged in flight for some reason. :)

One of the more fun aspects of Quake 2 is it's NON-REAL physics. Getting away with stuff matrix-like rather than total reality head-shot-never-saw-it-coming stuff in the newer games. I only wish the game physics allowed you to flip as you jumped, now that would be cool.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]Defiant!

  • Carpal Tunnel Member
  • ******
  • Posts: 1502
    • View Profile
    • Quake 2 LAN party July-August 2007
  • Rated:
Re: Question about fall damage
« Reply #11 on: September 19, 2010, 06:29:35 PM »

Early Q2 code allowed landing on a slanted surface to remove falling damage, which was key on city1 matches way back when.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Next Event: http://www.quakecon.org/  Fall 2014
You missed the Quake 2 LAN party at http://athenslanparty.pbwiki.com/

 

El Box de Shoutamente

Last 10 Shouts:

 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
 

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM
 

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.
 

Costigan_Q2

October 09, 2024, 01:35:05 PM
Et tu rikwad?

Please don't feed the degenerate lies of a sexually-perverted devil-worshipping barking dog like Focalor.

Show 50 latest
Welcome, Guest. Please login or register.
November 10, 2024, 12:44:44 PM

Login with username, password and session length