Title: Ducking while falling doubles the damages Post by: GrosBedo on May 04, 2013, 04:49:24 PM In game/bg_pmove.c you can find this:
Code: /* Quite funny what you can sometimes find in the sourcecode. Never knew nor even heard about this before. Title: Re: Ducking while falling doubles the damages Post by: Gig 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 (http://([b) to the wiki, is it ok? Title: Re: Ducking while falling doubles the damages Post by: grey matter on May 05, 2013, 05:29:33 AM The code in question (https://github.com/ioquake/ioq3/blob/master/code/game/bg_pmove.c#L923) 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 :D Title: Re: Ducking while falling doubles the damages Post by: Gig on May 05, 2013, 05:32:57 AM The three falling damage "categories"... Three? 5 damage, 10 damage, and the third category? No damage?Title: Re: Ducking while falling doubles the damages Post by: GrosBedo on May 05, 2013, 01:23:05 PM @Gig: I think your edit is ok, thank's for doing it :)
Title: Re: Ducking while falling doubles the damages Post by: grey matter 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. Title: Re: Ducking while falling doubles the damages Post by: PopeJo on May 06, 2013, 11:52:06 PM thx for this update and fix.
on some defrag maps this might actually make a difference :) Title: Re: Ducking while falling doubles the damages Post by: GrosBedo on June 01, 2013, 10:24:32 AM thx for this update and fix. on some defrag maps this might actually make a difference :) 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. |