Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here
NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

You are here: Big Brother Bot ForumAdd-OnsPlugins Discussion (Moderator: MordyT)Teamkill plugin in Urban Terror
Pages: [1]   Go Down
  Print  
Author Topic: Teamkill plugin in Urban Terror  (Read 815 times) Bookmark and Share
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« on: May 26, 2011, 08:32:46 AM »

Hello!

Me and my friend recently discovered on the server, that plugin TK wrongly calculates damage points during the hit/kill.
After any teammate hit in any part of the body, player gets 15 points.
After killing the teammate, player gets 100 points.

Above values are properly multiplied according to the rules set in plugin_tk.xml.

However this plugin should work somehow different from what is written in it's doccumentation.
For example, if killed player had 1% of health points left, and only got hit in arms from pistol by accident, he naturally dies, but the attacker receives 215 points, where
15 points is from the hit
100 points *2 is received from the kill.

Another example:
Player is not killed, but injured. Let's say from AK to torso. The damage is 51%, but the player instead of receiving 51 TK points, gets only 15.

That way, in the result players which killed by accident, are more likely to be kicked/banned from the server for TK, than players which injure severely teammates at the spawn point.

And some parts of the logs are below:
games.log:
Code:
4428:48Hit: 1 0 5 2: player1 hit player2 in the Legs
4428:48Hit: 0 1 3 15: player2 hit player1 in the Kevlar
4428:48Hit: 1 0 3 2: player1 hit player2 in the Kevlar
4428:48Hit: 1 0 4 2: player1 hit player2 in the Arms
4428:48Hit: 0 1 3 15: player2 hit player1 in the Kevlar
4428:48Hit: 1 0 0 2: player1 hit player2 in the Head
4428:48Kill: 0 1 14: player1 killed player2 by UT_MOD_BERETTA
4428:48Kill: 2 2 10: player3 killed player3 by MOD_CHANGE_TEAM

b3.log:
Code:
110503 15:29:18 CONSOLE 9:40 Hit: 3 10 0 15: player1 hit player2 in the Head
110503 15:29:18 VERBOSE Queueing event Client Team Damage (15, '15', '0')
110503 15:29:18 VERBOSE Parsing Event: Client Team Damage: TkPlugin
110503 15:29:18 CONSOLE 9:40 Kill: 10 3 30: player1 killed player2 by UT_MOD_AK103
110503 15:29:18 VERBOSE Queueing event Client Team Kill (100, '30', '0', 'UT_MOD_AK103')
110503 15:29:18 VERBOSE Parsing Event: Client Team Kill: TkPlugin

(Please note, that these parts of logs are not from the same time, I can't obtain logs from the same time at the moment, but I believie, that games.log is not even necessary in this issue. It just points out, that in games log there's information about hitzone and weapon, but not about actual damage. )

Is this issue fixable? I think, it would require some changes in iourt41 parser, so that it would calculate actual damage according to the weapon and hitzone. I can't rewrite it myself, but I could provide list of damages in specific hit zones from specific weapon.

Thanks for help.
Logged


Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #1 on: May 26, 2011, 12:08:07 PM »

Having a table of damage points for each weapons and hitlocation would be obviously more accurate. Note that for the torso, you need to consider damages with and without kevlar

Sent from my HTC Legend using Tapatalk
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #2 on: May 27, 2011, 04:03:10 AM »

Sure, I know that. But it doesn't complicate anythyng, because in the log the kevlar and torso have different IDs.

That's not a problem of creating such table, it's a problem of implementing this into parser or TKplugin (I don't really know which one).
The only weapon which could be a problem is SPAS shotgun, because it shots shrapnels, not single bullets, so you can be hit by one shrapnel or all of them, and damage vary. But in this case, some average values could be implemented.
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #3 on: May 27, 2011, 04:13:27 AM »

if you come up with the table we'll put it into the iourt41 parser
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #4 on: May 28, 2011, 06:11:54 AM »

Here you go. I hope that there are no mistakes, however my friend checked me. We assumed that for the kill you get 100 points, because we can't tell how many HP points the victim had before, unfortunately...

Code:
                            Head(0) Helmet(1)     Torso(2)     Kevlar(3)     Arms(4)    Legs(5)    Body(6)    Killed
MOD_TELEFRAG='5'             0        0             0             0             0         0         0         0
UT_MOD_KNIFE='12'           100      60            44            35            20        20        44        100
UT_MOD_KNIFE_THROWN='13'    100      60            44            35            20        20        44        100
UT_MOD_BERETTA='14'         100      34            30            20            11        11        30        100
UT_MOD_DEAGLE='15'          100      66            57            38            22        22        57        100
UT_MOD_SPAS='16'            25       25            25            25            25        25        25        100
UT_MOD_UMP45='17'           100      51            44            29            17        17        44        100
UT_MOD_MP5K='18'            50       34            30            20            11        11        30        100
UT_MOD_LR300='19'           100      51            44            29            17        17        44        100
UT_MOD_G36='20'             100      51            44            29            17        17        44        100
UT_MOD_PSG1='21'            100      63            97            63            36        36        97        100
UT_MOD_HK69='22'            50       50            50            50            50        50        50        100
UT_MOD_BLED='23'            15       15            15            15            15        15        15        15
UT_MOD_KICKED='24'          20       20            20            20            20        20        20        100
UT_MOD_HEGRENADE='25'       50       50            50            50            50        50        50        100
UT_MOD_SR8='28'             100      100           100           100           50        50        100       100
UT_MOD_AK103='30'           100      58            51            34            19        19        51        100
UT_MOD_NEGEV='35'           50       34            30            20            11        11        30        100
UT_MOD_HK69_HIT='37'        20       20            20            20            20        20        20        100
UT_MOD_M4='38'              100      51            44            29            17        17        44        100
UT_MOD_GOOMBA='40'          100      100           100           100           100       100       100       100
Logged

Newbie
*
OS: Windows
Type: Home user
Posts: 5
Offline Offline
« Reply #5 on: May 31, 2011, 05:51:13 AM »

One hint for people who don't get hit points, only the kills: you must enable

Code:
set g_loghits "1" //log every single hit. Creates very big logs

in your UrT Server configuration. Just saying, because it isn't enabled by default.

Quote
For example, if killed player had 1% of health points left, and only got hit in arms from pistol by accident, he naturally dies, but the attacker receives 215 points, where
15 points is from the hit 100 points *2 is received from the kill.

100% agree with this.
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #6 on: May 31, 2011, 08:29:01 AM »

replace b3/parsers/iourt41.py with that one and you should have real damage values.

Weapon code have changed for Damage event (so they are the same one as for Kill events), then, there might be things to also change on the xlrstats side.
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #7 on: June 01, 2011, 09:36:32 AM »

Thank you for that changes, I'm glad you looked over this problem. However there's still a problem with it, I've tested it on server on my computer, and it still counts every hit as 15 tk points and every kill as 100 tk points.

From the b3.log:

Code:
For hit:
110601 19:20:03 CONSOLE 18:28 Hit: 0 1 4 3: Player2 hit Garreth in the Arms
110601 19:20:03 DEBUG _getDamagePoints(15, 4) -> 22
110601 19:20:03 VERBOSE Queueing event Client Team Damage (15, '3', '4')
110601 19:20:03 VERBOSE Parsing Event: Client Team Damage: TkPlugin

For kill:
110601 19:19:36 CONSOLE 18:02 Kill: 1 0 22: Player2 killed Garreth by UT_MOD_HK69
110601 19:19:36 DEBUG OnKill: 22 (Player2 killed Garreth by UT_MOD_HK69)
110601 19:19:36 VERBOSE Queueing event Client Team Kill (100, '22', '0', 'UT_MOD_HK69')
110601 19:19:36 VERBOSE Parsing Event: Client Team Kill: TkPlugin

As you can see, only the DEBUG _getDamagePoints line is added, however the TK plugin seems to ignore that event...

Maybe if somebody else could test this corrected parser, to confirm the issue it would be useful, because I'm not sure about my private tests:)
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #8 on: June 01, 2011, 09:52:09 AM »

doh! my last minute change failed ^^

Damage point should be fine in iourt41.py v1.8.1 (use same link as above to download)

About points on Kill events... why don't you want that to be 100 ?
EDIT : v1.8.2 will make Kill event damage points equal to the last Hit registered
« Last Edit: June 01, 2011, 10:56:00 AM by Courgette » Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #9 on: June 02, 2011, 07:16:39 AM »

Ok, first of all it seems to work almost perfectly fine:) I agree with you, that for the kill, the player should get the amount of points equal to the damage of last registered hit, however I've noticed, that sometimes it fails.
(BTW for all tests, I have wounding multiplayer set to 1, and killing multiplier set to 2. )

We noticed, that for single shot kills player gets points from wounding and from killing (100 for wounding, and 100*2 for killing = 300). Log for Desert Eagle and SR8:

Code:
110602 16:48:19 CONSOLE 6:35 Hit: 0 1 0 3: Player2 hit Garreth in the Head
110602 16:48:19 DEBUG _getDamagePoints(15, 0) -> 100
110602 16:48:19 VERBOSE Queueing event Client Team Damage (100, '15', '0')
110602 16:48:19 VERBOSE Parsing Event: Client Team Damage: TkPlugin
110602 16:48:19 CONSOLE 6:35 Kill: 1 0 15: Player2 killed Garreth by UT_MOD_DEAGLE
110602 16:48:19 DEBUG OnKill: 15 (Player2 killed Garreth by UT_MOD_DEAGLE)
110602 16:48:19 VERBOSE Queueing event Client Team Kill (100, '15', '0', 'UT_MOD_DEAGLE')
110602 16:48:19 VERBOSE Parsing Event: Client Team Kill: TkPlugin

110602 16:45:00 CONSOLE 3:16 Hit: 1 0 1 14: Garreth hit Player2 in the Helmet
110602 16:45:00 DEBUG _getDamagePoints(28, 1) -> 100
110602 16:45:00 VERBOSE Queueing event Client Team Damage (100, '28', '1')
110602 16:45:00 VERBOSE Parsing Event: Client Team Damage: TkPlugin
110602 16:45:00 CONSOLE 3:16 Kill: 0 1 28: Garreth killed Player2 by UT_MOD_SR8
110602 16:45:00 DEBUG OnKill: 28 (Garreth killed Player2 by UT_MOD_SR8)
110602 16:45:00 VERBOSE Queueing event Client Team Kill (100, '28', '1', 'UT_MOD_SR8')
110602 16:45:00 VERBOSE Parsing Event: Client Team Kill: TkPlugin

HOWEVER, for the HE grenade kill with assumed damage=50, player gets only 50 points for wounding (or maybe 25*multiplier=50 for killing?), not 50*multiplayer=100 for killing.

Code:
110602 16:50:32 CONSOLE 8:49 Kill: 0 1 25: Garreth killed Player2 by UT_MOD_HEGRENADE
110602 16:50:32 DEBUG OnKill: 25 (Garreth killed Player2 by UT_MOD_HEGRENADE)
110602 16:50:32 VERBOSE Queueing event Client Team Kill (25, '25', '6', 'UT_MOD_HEGRENADE')
110602 16:50:32 VERBOSE Parsing Event: Client Team Kill: TkPlugin


And one small issue, that happened only once, and we didn't manage to repeat the issue - after two hits for 35 points (without killing), 140 points accumulated, but log looks good:
Code:
110602 16:43:19 CONSOLE 1:35 Hit: 1 0 3 1: Garreth hit Player2 in the Kevlar
110602 16:43:19 DEBUG _getDamagePoints(12, 3) -> 35
110602 16:43:19 VERBOSE Queueing event Client Team Damage (35, '12', '3')
110602 16:43:19 VERBOSE Parsing Event: Client Team Damage: TkPlugin
110602 16:43:20 CONSOLE 1:36 Hit: 1 0 3 1: Garreth hit Player2 in the Kevlar
110602 16:43:20 DEBUG _getDamagePoints(12, 3) -> 35
110602 16:43:20 VERBOSE Queueing event Client Team Damage (35, '12', '3')
110602 16:43:20 VERBOSE Parsing Event: Client Team Damage: TkPlugin

Thank you for this great job:) If this parser is in the official version of BBB, I believe that many people will find it useful:)
« Last Edit: June 02, 2011, 07:18:30 AM by Garreth » Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #10 on: June 02, 2011, 07:43:17 AM »

1) the issue here is that damage points are already read from the last Damage event (which resulted in the kill) and the Kill event that follows just repeat the last damage points received by the victim (even if weapons registered on last damage and kill events are different)
So (except when you disable hit log all together) the points on the kill events will alway be points already received by previous damage event excepted for the following weapons :
  • HE
  • HK
  • SPAS
  • any other means of kill that does not produce hit log

Maybe I could detect that the points were already provided in the damage event and set them to 0 for the kill event in such case (but what about kill multiplier, etc ?)

2) for the HE Kill : should not the correct damage points be 100 for HE whatever the case ?

3) 140 points accumulated : happens when a teammate heals you.
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #11 on: June 02, 2011, 11:19:49 AM »

1. Maybe introduce a small delay, like 2 seconds? If two events (hurt and kill) of dmg 100 comes at the same time, cancel first one (or just subtract these points). I got this for weapons that did 100% of damage in one shot only.

2. I killed the guy with HE and received 50 points only. But I should receive 50*kill_multiplier, so 100.

3. Hm.. I don't think we healed each other just before or just after these two shots... And how could healing (which is not in logs) affect TK points?
Logged

Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal