PDA

View Full Version : [L4D] Hunter Pounce formula


n0limit
05-25-2009, 17:24
Hello, I was wondering if anyone knew the hunter pounce formula for L4D given the 2d distance of the pounce?
I'd like to hook the lunge_pounce event, but I believe it only provides the distance in 2d and not the actual damage.
Does anyone know how I would convert that?

I'd like to keep stats on hunter pounce damage, distance, etc for a server.

ProBoomer
05-26-2009, 07:36
Maybe this help you.

I can Jump more High with Hunter and cover major distance and also take max 45 instant damage for high pounce to survivor

//
// HUNTER CVAR
//
sm_cvar z_hunter_limit 3 //1
sm_cvar z_hunter_health 350 //250
sm_cvar z_hunter_speed 550 //300
sm_cvar z_hunter_claw_buildup_growl_percent 0.5 //0.5
sm_cvar hunter_pounce_air_speed 700 //700
sm_cvar hunter_pounce_ready_range 950 //500
sm_cvar hunter_pz_claw_dmg 7 //6
sm_cvar z_pounce_damage 6 //5
sm_cvar z_pounce_door_damage 2000 //500
sm_cvar hunter_leap_away_give_up_range 1500 //1000
sm_cvar hunter_committed_attack_range 150 //75
sm_cvar z_hunter_lunge_distance 850 //750
sm_cvar z_hunter_lunge_pitch 45 //25
sm_cvar z_hunter_max_pounce_bonus_damage 45 //25
sm_cvar z_lunge_distance_damage 1 //0
sm_cvar z_lunge_power 700 //600
sm_cvar z_pounce_damage_range_min 500 //500
sm_cvar z_pounce_damage_range_max 1000 //1000
//sm_cvar z_pounce_shake_amplitude 4 //4
//sm_cvar z_pounce_shake_duration 1.5 //1.5
//sm_cvar z_pounce_shake_radius 250 //250
//sm_cvar z_pounce_stumble_force 5 //5
//sm_cvar z_pounce_stumble_radius 0 //0
sm_cvar z_lunge_release 0 //0
//sm_cvar z_lunge_up 200 //200
sm_cvar z_max_hunter_pounce_stagger_duration 0.4 //0.5
sm_cvar z_pounce_crouch_delay 0.1 //1



P.S: sm_cvar z_lunge_release 0 //0 If you set to 1 you can escape with Hunter after have pounce one survivor, or continue to pounce all survivor, jump and leave, jump and leave, jump and leave.

DrThunder
05-26-2009, 16:19
I have been working on a Mod to change the hunter pounce damage, it will be done in like a week or so. The closest to the equation that calculates the damage is

((Distance*.01)/4)*(((Distance*.01)/2)^2)

The distance that the event gives you is only horizontal distance so you need to work in the vertical distance to.

The problem with sm_cvar z_hunter_max_pounce_bonus_damage 45 //25 is what would be a 25 point pounce is now a 45 instead of extending passed 25.

n0limit
05-27-2009, 12:33
The problem with sm_cvar z_hunter_max_pounce_bonus_damage 45 //25 is what would be a 25 point pounce is now a 45 instead of extending passed 25.

You can change that by modifying z_pounce_damage_range_max with sm_cvar command. For example, I'm currently running

sm_cvar z_pounce_damage_range_max 1700
sm_cvar z_hunter_max_pounce_bonus_damage 49

and it seems to be just about right distance wise (~1000 is a 25)

DrThunder
05-27-2009, 14:57
You can change that by modifying z_pounce_damage_range_max with sm_cvar command. For example, I'm currently running

sm_cvar z_pounce_damage_range_max 1700
sm_cvar z_hunter_max_pounce_bonus_damage 49

and it seems to be just about right distance wise (~1000 is a 25)

I was messing with those commands and it seems to up the damage from short pounces. I got a 20 point pounce on flat ground.

n0limit
05-27-2009, 20:09
sounds like you have a setting wrong then. Check your min, and make sure your max is above 1000. basically, for every dmg point you add, you should be adding at least 28 to max range to scale right. And that changes as you go along.
With 1700 I've got it down to giving the player less than 1 point extra damage than what it should be. I've been running it over a week, and the logs are looking good for it.

Top Pounces
Date and Time Pouncer Pounced Distance Damage Dealt Campaign Name Map Name
7:54:37 PM Chupon Bill 1581 45.8 Dead Air Offices
2:52:20 PM SiLENCE Smygarmicke 1408 39.8 No Mercy Apartment
9:47:09 AM n0limit Zoey 1243 34 No Mercy Apartment
7:27:12 PM UTKA Damu 1126 29.9 Dead Air Greenhouse
7:04:03 PM SiLENCE Cehan 1122 29.8 Blood Harvest Cornfield
7:54:55 AM David Billo007 1086 28.5 Dead Air Offices
9:39:34 AM n0limit kapitan Bomba 1071 28 Blood Harvest Barn
5:03:34 PM SiLENCE g0g3t4 1061 27.6 Death Toll Main Street
1:54:21 PM Chupon PiK 1057 27.5 Death Toll Ranch House
12:21:45 AM Zero trevbot 1056 27.5 Death Toll Ranch House

n0limit
05-28-2009, 10:31
((Distance*.01)/4)*(((Distance*.01)/2)^2)

The distance that the event gives you is only horizontal distance so you need to work in the vertical distance to.

Are you sure?
The server log outputs the following for a pounce:

05/28/2009 - 10:29:35: Pounce by ->YaYYaJ<- dealt 4.9 damage from a 2d distance of 412

2d distance gives me the impression it's taking the vertical into account.

madcap
05-28-2009, 12:41
Edit: I was wrong, this isn't true.

Hunter pounce damage is not affected by vertical distance, only horizontal.

santoriin
05-28-2009, 12:44
Hunter pounce damage is not affected by vertical distance, only horizontal.
i am nearly positive it is straightline distance from where you pounce from.

this is why you still get 11 straight down from buildings (with nearly no horizontal movement.

n0limit
05-28-2009, 13:17
This was my understanding of it too.

Basically, if you took a picture with a hunter on a building and a survivor below, and drew a straight line between them, that's the hunter distance.

Fyren
05-28-2009, 14:04
santoriin is correct. The distance it counts is from the start of your pounce to the survivor you hit. Walljumping resets the start to where you walljump from. The damage value is just a linear scale that goes from 1 (or 0?, easily tested) at z_pounce_damage_range_min to the max at z_pounce_damage_range_max.

n0limit
05-28-2009, 19:14
It starts at 1 according to my data:
distance damage
301 1

So I guess the formula would be something like


(((distancePounced - z_pounce_damage_range_min) / (z_pounce_damage_range_max - z_pounce_damage_range_min)) * z_hunter_max_pounce_bonus_damage) + 1


Which looks about right with the test data I have.

Rank Date and Time Pouncer Pounced Distance Damage Dealt Campaign Name Map Name
# 1 5/27/2009 10:23:07 PM SiLENCE Huesos66 1643 48 Dead Air Offices
# 25 5/27/2009 10:01:10 PM Wolfetone DonViecco 1111 29.4 Dead Air Greenhouse

((1643 - 300 / 1700 - 300) * 49) + 1 = 48.005

(1111 - 300 / 1700 - 300) * 49) + 1 = 29.385 (rounded to 29.4)

Think that's it! Thanks a lot guys!

n0limit
05-28-2009, 23:40
DrThunder, I think I see the problem with the mismatch in our data.

It appears SourceMod's lunge_pounce event actually gives a DIFFERENT distance than the 2d distance outputted to console.

Here's an example:
[Console] //Pulled from a program which regexs console output
n0limit pounced SiLENCE giving 25.3 damage over a distance of 995 feet on l4d_vs_hospital03_sewers
mangfa pounced A.C.C. giving 30.0 damage over a distance of 1129 feet on l4d_vs_hospital01_apartment
[SourceModPlugin]
n0limit pounced SiLENCE for 21.125 damage over a distance of 875
mangfa pounced A.C.C. for 22.55999 damage over a distance of 916

I've attached the source to the plugin (which I plan to submit) which calculates the damage amount. The distance is obtained right from the event, so I can't see why that would be wrong.


Fyren, or anyone else have any ideas?

Fyren
05-29-2009, 05:02
Ask Valve. SM does not create events.

n0limit
05-29-2009, 07:34
Ask Valve. SM does not create events.
How would I do that? Is there a way to reach a developer ([email protected])?

I'm guessing the 2d distance value that's put out from the console is computed against some additional values on the server, as well as the base value which is being output by the lunge_pounce event.

The question now would be, what additional variables/computations are needed to go from the raw pounce event to the 2d calculation.

Fyren
05-29-2009, 09:50
I was just being somewhat snarky. I wouldn't expect to get a response, but you could try e-mail Robin Walker. Don't know if e-mailing devs at random will get a response. The linear damage scale from 1 damage at min distance to max damage at max distance as you already described works, so I'm not sure what you're still looking for.

n0limit
05-29-2009, 10:28
I was just being somewhat snarky. I wouldn't expect to get a response, but you could try e-mail Robin Walker. Don't know if e-mailing devs at random will get a response. The linear damage scale from 1 damage at min distance to max damage at max distance as you already described works, so I'm not sure what you're still looking for.

The linear damage scale works with the 2d calculated value from the console output, not sourcemod. I did some dis-assembly today and the formula for the 2d pounce calculation is basically
2d-dist = sqrt(x^2 + y^2 + z^2)

x, y, z derived each by a subtracting two raw values from memory (presumably distances in the world).

The problem is that sourcemod only reports y via lunge_pounce, unless I'm missing something.
because of that, I can't recreate the 2d damage number in the plugin and use the distance formula discussed earlier.

Fyren
05-29-2009, 10:52
Hook ability_use and store the hunter position when he pounces. Get the position of the hunter or suvivor on hunter_pounce. Whatever is in the event is what Valve put there, SM just passes it through.

Actually, I have example code, but it's from December. It was just a quick test when I was looking at the pounce damage.

n0limit
05-29-2009, 13:06
Thanks for the code Fyren! I'll take a look when I get a chance.

n0limit
05-31-2009, 00:49
Fyren, thanks a lot for the help in this thread. I finally was able to get it to work and finish the plugin. For those following the thread, you can get the plugin at http://forums.alliedmods.net/showthread.php?t=93605

DrThunder
06-02-2009, 19:58
i am nearly positive it is straightline distance from where you pounce from.

this is why you still get 11 straight down from buildings (with nearly no horizontal movement.

The distance in the pounce event is only the horizontial distance the final damage is as you say point a to point b but the distance given by the event is not that distance it is just the horizontal. If you use the event to display distance and do a pounce for high above the survivor it will say 0. If you look and the netprops there is a vector "m_pounceStartPosition" that you can use with the distance give by the event to work out the point a to point b distance.

triggerman
07-10-2009, 15:11
pouncing straight down the elevator shaft in NM4 with virtually no horizontal movement and no pounce cap gave me a 165 damage pounce, so it most definitely goes by both vertical and horizontal distance.