Raised This Month: $51 Target: $400
 12% 

Easy way to do fire counting??


Post New Thread Reply   
 
Thread Tools Display Modes
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 02-23-2005 , 08:37  
Reply With Quote #11

Hopefully not hi-jacking the thread but it is related and you may know the answer XAD.....................

I'm about to release a further update to my plugin that shows victim stats at the end of a round or when you die.

As you know this information is already shown in the client console but I'm seeing some strange things with the 'player_hurt' event in terms of the number of events that are fired. These don't always match up with what the built in CSS stats say.

So for instance the client will say in the console that player x took 4 shots from me, but the 'player_hurt' event has fired 6 times (6 seperate shots) for that player.

Anyone else seen this ?

Just a sanity check but the 'health' parameter of the event is the new victim health and not the damage inflicted ? It's a bit of a pain using this as the maximum damage reported can only be 100. Would be nice if they included 'damage' in there.

From 'modevents.res'
Code:
	"player_hurt"
	{
		"userid"	"short"   	// player index who was hurt
		"attacker"	"short"	 	// player index who attacked
		"health"	"byte"		// remaining health points
		"weapon"	"string"	// weapon name attacker used, if not the world
	}
Mani.
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 02-23-2005 , 09:07  
Reply With Quote #12

Quote:
PS! Thanks for trying to help me and give me suggestions. I hope you don't think I'm not thankfull because I already tried most of your suggestions without finding THE solution. I wouldn't have posted the question unless I had tried everything I could think of and which is reasonable to prototype. BUT I also said I could have missed something obvious, which is why I appreciate you effort as it will confirm that I haven't (so far).
Some guys helped me a lot ! i want help because now i can lol

Quote:
Just a sanity check but the 'health' parameter of the event is the new victim health and not the damage inflicted ? It's a bit of a pain using this as the maximum damage reported can only be 100. Would be nice if they included 'damage' in there.
lol right, hitbox too

Yeah i think health return the health of userid after the hurt and not the damage but i think i there a simple way to catch dmg

Quote:
Yepp, that's the one... but you can't just catch +attack2 as it will continue to stab until you release the button
Code:
var isOnAttack2 = Array();
function onFireGameEvent ( event ){
	if (!event.eventname) return;
	if (event.eventname=="player_hurt"){
		if (event.weapon=="knife")
			if (isOnAttack2[event.attacker]) Print("Second Knife Stab");
	}
}
function onCommandArgs ( cl, iArgc, aArgv ){
	if ( aArgv[0].toLowerCase() == "+attack2") isOnAttack2[cl.ID] = 1;
	if ( aArgv[0].toLowerCase() == "-attack2") isOnAttack2[cl.ID] = 0;
	return false;
}
I don' t test this script but just to show you, if at each player_hurt, attacker got the knife and is on +attack2 it should work i think

Quote:
So for instance the client will say in the console that player x took 4 shots from me, but the 'player_hurt' event has fired 6 times (6 seperate shots) for that player.
Anyone else seen this ?
Sorry for my bad english i don' t understand the whole problem
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 02-23-2005 , 10:38  
Reply With Quote #13

[quote="Cr3V3TT3"]
Quote:
Quote:
So for instance the client will say in the console that player x took 4 shots from me, but the 'player_hurt' event has fired 6 times (6 seperate shots) for that player.
Anyone else seen this ?
Sorry for my bad english i don' t understand the whole problem
On Counter-Strike Source when you die or at the end of the round, you can go to your client console and see the damage given and taken to various players. It also shows the number of shots used to do this damage.

My mod is now tracking 'last player health' and using the 'player_hurt' event message to calculate damage statistics per player to show the same in information in game.

The problem is that sometimes the client console 'number of shots' is different from my own calculation using the 'player_hurt' event.
I am ignoring 'world' hurt events, and I am also ignoring any damage deltas of 0 to avoid possible duplicate 'player_hurt' events.

This would suggest that the client side code is not verifying with the server the actual amount of shots registered and therefore the damge amount is also incorrect for its console stats output.

My main problem is that I know I'm going to get 'Mani victim stats is broken !!' posts when people look at the differences between in game stats and console stats

Mani.
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-23-2005 , 10:45  
Reply With Quote #14

Quote:
Originally Posted by Mani
My mod is now tracking 'last player health' and using the 'player_hurt' event message to calculate damage statistics per player to show the same in information in game.

The problem is that sometimes the client console 'number of shots' is different from my own calculation using the 'player_hurt' event.
I am ignoring 'world' hurt events, and I am also ignoring any damage deltas of 0 to avoid possible duplicate 'player_hurt' events.
Don't know as I don't use this event... Also because I want to track both damage made before bodyhit compensation (at the moment 400%, 125%, 100%, 75%) and actual damage done (not health as damage is absorbed by armour)...

Does this happen for all weapon or only some weapons?? Can you recreate the problem (so I can check my results)??

/X

PS! Validate the stats is a bugger... running with bots for hours and then run tools to check the logs for the result...
XAD is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 02-23-2005 , 11:10  
Reply With Quote #15

Quote:
Originally Posted by XAD
Quote:
Originally Posted by Mani
My mod is now tracking 'last player health' and using the 'player_hurt' event message to calculate damage statistics per player to show the same in information in game.

The problem is that sometimes the client console 'number of shots' is different from my own calculation using the 'player_hurt' event.
I am ignoring 'world' hurt events, and I am also ignoring any damage deltas of 0 to avoid possible duplicate 'player_hurt' events.
Don't know as I don't use this event... Also because I want to track both damage made before bodyhit compensation (at the moment 400%, 125%, 100%, 75%) and actual damage done (not health as damage is absorbed by armour)...

Does this happen for all weapon or only some weapons?? Can you recreate the problem (so I can check my results)??

/X

PS! Validate the stats is a bugger... running with bots for hours and then run tools to check the logs for the result...
That's a good point about the armor..... Are you using hooks to get at the pre-compensated damage ?

I only tested with the pistol and colt but it was pretty easy to cause a difference between client and server 'number of shots' results if you aim at their feet

Mani.
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-23-2005 , 11:50  
Reply With Quote #16

Quote:
Originally Posted by Mani
That's a good point about the armor..... Are you using hooks to get at the pre-compensated damage ?

I only tested with the pistol and colt but it was pretty easy to cause a difference between client and server 'number of shots' results if you aim at their feet

Mani.
Yes, I install hooks on the players CBaseEntity's vtable (all players use the same)...

"client and server 'number of shots' result"??? There are only server values... the values in the console are sent from the server (as I wrote in another thread, with that title)...

OK, soo you say "feet" fire is not included in the client console numbers??

/X
XAD is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 02-23-2005 , 12:00  
Reply With Quote #17

Quote:
Originally Posted by XAD
OK, soo you say "feet" fire is not included in the client console numbers??

/X
lol. no what I mean is don't aim at the head or they will be dead in one shot. Aiming at anything but the head gives less damage but more shots required to kill them. I can't be sure if it's hit box specific but it definately looks like the 'player_hurt' event is generating more 'shots' than what the client side calculation reports in the console.

If you are hooking into the CBasePlayer::OnTakeDamage_Alive () that fires the 'player_hurt' event in the first place, this could affect you.

For reference I am using the new IGameEventManager2 interface released recently, rather than the older one.

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 02-23-2005 , 13:49  
Reply With Quote #18

Ok I've got my damage's working out to be the same as the client side version using CBasePlayer->GetHealth() instead of using the health value from the 'player_hurt' event.

The damage amounts add up correctly to be the same as the client but I've still got this number of shots issue. Most of the time it's correct but occasionally my tracking says there have been more shots fired than the client reports even though the damage totals are the same.

Easy to test.

Make server, add 11 bots including yourself, sv_cheats 1, bot_stop 1, buy para, run or teleport to opposition site and blitz them. Check client side console values against what you register yourself server side.

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
XAD
Senior Member
Join Date: Mar 2004
Location: Sweden
Old 02-23-2005 , 14:20  
Reply With Quote #19

Quote:
Originally Posted by Mani
Ok I've got my damage's working out to be the same as the client side version using CBasePlayer->GetHealth() instead of using the health value from the 'player_hurt' event.
?? How can you get more than 100 damage if you use GetHealth?? Isn't health always between zero to 100 (except for VIPs)?? I know that you often get above 100 in damage in the console...

Quote:
Originally Posted by Mani
... but I've still got this number of shots issue. Most of the time it's correct but occasionally my tracking says there have been more shots fired than the client reports even though the damage totals are the same.
OK, I got hit difference by running a couple of bots... so I'm not sure what the console stats are logging...

/X
XAD is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 02-23-2005 , 14:54  
Reply With Quote #20

Quote:
Originally Posted by XAD
Quote:
Originally Posted by Mani
Ok I've got my damage's working out to be the same as the client side version using CBasePlayer->GetHealth() instead of using the health value from the 'player_hurt' event.
?? How can you get more than 100 damage if you use GetHealth?? Isn't health always between zero to 100 (except for VIPs)?? I know that you often get above 100 in damage in the console...
The CBasePlayer->GetHealth() can have a negative value which is why if you kill someone the total damage can exceed 100, where as the one passed by 'player_hurt' is clamped to 0 as a minimum.

Quote:
Originally Posted by XAD
Quote:
Originally Posted by Mani
... but I've still got this number of shots issue. Most of the time it's correct but occasionally my tracking says there have been more shots fired than the client reports even though the damage totals are the same.
OK, I got hit difference by running a couple of bots... so I'm not sure what the console stats are logging...
/X
I've posted in the HlCoders list to see if I get an official reply. Without the CS Source client source code it's pretty hard to understand what is going on.
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode