Fall damage

Discussion related to Hexen II mapping. If you are currently working on a new map this is the perfect place to share your progress.
Post Reply
Mathuz
Posts: 68
Joined: Tue Apr 02, 2019 6:40 am

Fall damage

Post by Mathuz »

One thing that always somehow halts my map development is the way fall damage works in Hexen 2. You only take little damage and only when you fall really long distance, which is weird as Hexen 2 maps were always meant to be smaller, but whatever. Thing is, the line where you are supposed to take damage is commented out in client.hc. So is the current fall damage code hardcoded? In my maps, there are often places, which are playable area, but it is supposed to damage/kill you if you fall there.
User avatar
Inky
Posts: 73
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Re: Fall damage

Post by Inky »

That's really a pity that it may halt your map development! :cry:

I am pretty sure there are some workarounds to obtain something suited to the gameplay you imagine: maybe using some trigger_hurt or trigger_deathtouch cleverly positioned? Imagine other dangers to reduce your dependance to fall damage? The better being obviously tweaking the HexenC code, since obviously you found where it's supposed to be dealt with. :D

One of my maps relies heavily on falling damage and it's basically a giant pit as wide and high as the engine limitations allow (hence the problem I had there with fickle brushes! ;)) and the player has to jump from platform to platform or do some tightrope walking to make the danger of falling more likely to happen.
Mathuz
Posts: 68
Joined: Tue Apr 02, 2019 6:40 am

Re: Fall damage

Post by Mathuz »

Yes, well, I use the trigger_hurt in the pits, etc... However, you can't use it in playable area.
Example: I have a castle on the cliff. You start the map under the cliff, so obviously I cannot put the trigger_hurt there. When you fall from the castle or the cliff, you are supposed to kill yourself, but you only take very little damage instead. I can modify the code, so that once you fall certain distance, you will die. But some proportional system, where you gradually take more damage would be better ;)
User avatar
Inky
Posts: 73
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Re: Fall damage

Post by Inky »

About your castle & cliff situation, it reminds me about tibet6 - Temple of Bardo. There is a lethaly deep pit there and they just put a trigger_deathtouch at the bottom of it. You could do so and set up the trigger either of those ways:
1. Put the trigger above the player height (and above the height they can reach by jumping from the ground), so that the death will never happen when wandering around the start area but only when jumping from heights, and actually occur half a second before the impact (but with a bit of luck no one will ever notice).
2. Put the trigger on ground in a deactivated state and activate it later on once the player is up the cliff (and consider a way to deactivate it again if the player goes back down to the starting point via stairs instead of jumping down... or make such a move back impossible by closing the way behind them - but the latter should be avoided I think).

Now those are just tricks, and I totally agree with your last sentence: Nothing will ever be better than a proper fall damage code.
User avatar
Inky
Posts: 73
Joined: Sat Apr 18, 2020 8:05 am
Location: Paris, France
Contact:

Re: Fall damage

Post by Inky »

Just discovered that in HexenC code (misc.hc):


/*QUAKED func_obstacle (0 .5 .8) ?
Does damage on impact based on the speed of the impactee
"dmg" - multiplier on damage (damage is based on speed of impact and mass of impactee)
"level" - velocity threshold to not do damage under (400 is running speed)
*/

void func_obstacle ()
{
....
}

Undocumented in the fgd file but code not commented out, so waiting for someone to try their luck with it...
Might it help?
Post Reply