Pages: [1]
  Print  
Author Topic: Ducking while falling doubles the damages  (Read 8053 times)
GrosBedo
Member


Cakes 20
Posts: 710


« on: May 04, 2013, 04:49:24 PM »

In game/bg_pmove.c you can find this:
Code:
/*
=================
PM_CrashLand

Check for hard landings that generate sound events
=================
*/
static void PM_CrashLand( void ) {

(...)

// ducking while falling doubles damage
if ( pm->ps->pm_flags & PMF_DUCKED ) {
delta *= 2;
}

(...)
}

Quite funny what you can sometimes find in the sourcecode. Never knew nor even heard about this before.
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #1 on: May 05, 2013, 03:11:50 AM »

I've done some in-game tests, with g_debugdamage 1.
It turned out it's a little different than simply doubling the damage (I don't know how to read that code exactly, maybe it makes the game consider you fell from the double of the real height?).
You know usually, depending from the height you fall down (or from the vertical speed at landing?), you get no damage, 5 damage, or 10 damage.
Tried landing ducked, I've seen I have suffered 5 (or 10, if falling from a little higher) damage from "medium" heights where I would have got no damage if landing normally.
I have suffered 10 damage landing ducked in places where I usually would have got 5 damage (double).
I have suffered 10 damage landing ducked in places where I usually would have got 10 damage (probably, the limit that prevents a single fall to cause more than 10 damage even if you fall down from a skyscraper still applies).

Hence, the 10 hp damage is still the upper limit, but it's much easier to get that damage!

UPDATE: Just done DO NOT LINK[/b]) h t t p s : / / openarena . wikia . com/index.php?title=Manual%2FControls&diff=14025&oldid=13729]this update to the wiki, is it ok?
« Last Edit: May 05, 2013, 03:40:23 AM by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #2 on: May 05, 2013, 05:29:33 AM »

The code in question caclulates that "delta" from players velocity, distance traveled and gravity. After that delta is calulcated it gets scaled according to different conditions, like waterlevel or ducking.
Depending on the absolute value of the delta, one of the 3 falling damage events is emitted (or just a regular footstep event). The three falling damage "categories" do not get changed by ducking, but just as you described ducking makes it easier to get into a higher falling damage category due to that *2 scaling of delta.

All that aside I  finally have an excuse as to why I'm dying all the time Cheesy
Logged

This space is for rent.
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #3 on: May 05, 2013, 05:32:57 AM »

The three falling damage "categories"...
Three? 5 damage, 10 damage, and the third category? No damage?
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
GrosBedo
Member


Cakes 20
Posts: 710


« Reply #4 on: May 05, 2013, 01:23:05 PM »

@Gig: I think your edit is ok, thank's for doing it Smiley
Logged
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #5 on: May 06, 2013, 11:47:57 AM »

The three falling damage "categories"...
Three? 5 damage, 10 damage, and the third category? No damage?

Correct.
EV_FALL_FAR (10 damage), EV_FALL_MEDIUM (5 damage), EV_FALL_SHORT (no damage, just landing sound). See ClientEvents() in code/game/g_active.c and CG_EntityEvent() in code/cgame/cg_event.c.
Logged

This space is for rent.
PopeJo
Lesser Nub


Cakes 12
Posts: 105



WWW
« Reply #6 on: May 06, 2013, 11:52:06 PM »

thx for this update and fix.


on some defrag maps this might actually make a difference  Smiley
Logged

GrosBedo
Member


Cakes 20
Posts: 710


« Reply #7 on: June 01, 2013, 10:24:32 AM »

thx for this update and fix.


on some defrag maps this might actually make a difference  Smiley

Yes, and I'm thinking that maybe sometimes crouching may enable a sticky OB where you wouldn't if you didn't crouch (because no damage and no weapon to self inflict damages).

This can also be an idea to make defrag maps.
Logged
Pages: [1]
  Print  
 
Jump to: