• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

[Mutator] KFStatsX

scary ghost

Grizzled Veteran
Sep 13, 2010
899
316
California
Download
Version 3.2.1 - NEW!
https://github.com/scaryghost/KFStatsX/releases/download/3.2.1/KFStatsX_v3.2.1.zip

See thread for detailed information on latest release:
http://forums.tripwireinteractive.com/showpost.php?p=1336319&postcount=136

Whitelist Status
Version 3.2.1 is whitelisted

About
This mutator tracks match and player statistics, similar to HLStatX (hence the name). It actually started as an enhancement to GameStatsTab but I didn't like how the stats were fixed and how bulky the mutator was. As a result, I redesigned everything from ground up, adding in code to broadcast the stats to a remote server, allowing the stats list to grow dynamically, and finding better ways to track the different stats. The stats UI in game was also changed to have it's own window and categorized into different groups, rather than be lumped into one list.

When a match ends, the mod broadcast a UDP packet containing information about each match. It will also broadcast UDP packets containing the stats accumulated for each player when they log out from the server. More information can be found on the project's wiki.
Install instructions are in the README and screenshots are available on the steam workshop page.

Compatibility
This mutator will not be compatible with several mods out of box because it uses a custom controller and pawns.
Fortunately, controller compatibility is possible because the mutator dynamically loads the controller class. Simply extending a custom controller and pawn from the KFStatsX versions will suffice. An example of this is the compatibility setup with ServerPerks V6.00. The mutator config menu has a drop down list allowing you to select which controller to use.

Example:
http://i47.tinypic.com/hsl3kh.jpg

Tracking Server
I have written a Java based server to listen for the packets and process the information. You will need JRE 7 to run it. If you have a Linux server, most likely Java is already installed. The latest version of JRE can be found on the Oracle website.

The application also has an embedded web server, to provide easy viewing access to the stats. Click on the below link to download. The "server.properties" file will have a information on the configuration options and the shell scripts can be run to start the server. More information is available on the project's wiki.

Download
https://github.com/scaryghost/KFSXT.../download/4.0/KFSXTrackingServer-4.0.0.tar.gz

An example of the web interface can be viewed below.
http://kfstatsx.serverpit.com:8080/

Source Code
https://github.com/scaryghost/KFSXTrackingServer
 
Last edited:
Nice work and thx for the mutator. ;)

There is no more option to broadcast a random stat through chat? And again, it could be nice to be able to see and to compare stats of other players as i suggested in your game stats tab thread. :p

[url]http://forums.tripwireinteractive.com/showpost.php?p=1004680&postcount=40[/URL]

What about stats in % like accuracy, % of clot/gore/... killed or other? :D
 
Upvote 0
Ok i have seen the web interface, one question: As it is ordered the players in the "Records"?

There is no ordering for records per say. It's all stored internally in a hash map so the order you see is whatever order the map gives when you query for the values.

Nice work and thx for the mutator. ;)

There is no more option to broadcast a random stat through chat? And again, it could be nice to be able to see and to compare stats of other players as i suggested in your game stats tab thread. :p

http://forums.tripwireinteractive.com/showpost.php?p=1004680&postcount=40[url]http://forums.tripwireinteractive.com/showpost.php?p=1004680&postcount=40[/URL]

What about stats in % like accuracy, % of clot/gore/... killed or other? :D

Yeah, didn't keep that feature. As for the stats comparisons, that would be quite a nightmare to try and tabulate every stat for every player, especially for servers that have more than 6 players.

% accuracy...no reason other than I never really bothered for it. Kill breakdown is already implemented

Is there any possibility that u can post the steamid64 patched version? My server (see signature) would greatly benefit from it. Also, are custom perks/stats supported?

Here's the patched version.
[url]https://dl.dropbox.com/u/16251678/KFStatsX_v1.0.1.zip[/URL]

Custom perks are supported. Custom weapons are supported but I cannot test compatibility with every weapon out there so there may be issues with some weapons.
 
Upvote 0
So if you had custom perks etc, how does this work? Is it similar to the ServerPerks where you have to edit and add yourself or is there some sort of extra function you implemented?

The beauty of this implementation (vs. GameStatsTab) is there is no set list of stats to track, the list grows as different events of triggered. This is why the stats menu initially will be all blank (except for time alive). Internally, the stats are stored in a sorted map, with the stats name as the keys. As you trigger more events, the map becomes more populated with values.

In the case of perks, it uses the class name of the selected veterancy as a key. This is the code chunk from KFSXHumanPawn that counts the perk usage.

Code:
function Timer() {
    local int currTime, timeDiff;


    super.Timer();
    currTime= Level.GRI.ElapsedTime;
    timeDiff= currTime - prevTime;
    if (kfsxri != none) {
        kfsxri.player.accum(timeAlive, timeDiff);
        if (KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill != none) {
            [COLOR=DarkOrange]kfsxri.perks.accum(GetItemName(string(KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill)), timeDiff);[/COLOR]
        }
    }
    prevTime= currTime;
}
The "accum" function first checks if the key is present in the stats map. If not, create an entry and initialize it to 0, then add in the difference.
 
Upvote 0
Thanks for posting the patched version. Is it possible that I can just use this to link the stats from ServerPerkStats, since i already set up the stats page myself.

What do you mean by "link the stats from ServerPerkStats"? If you mean use this to store the perk information than no. ServerPerks has its own protocol for sending and receiving perks.
 
Upvote 0
What do you mean by "link the stats from ServerPerkStats"? If you mean use this to store the perk information than no. ServerPerks has its own protocol for sending and receiving perks.

No, I meant something else. It's because I already set up the custom stats in ServerPerks, but what I want intend to use StatsX is to use it to show the player rankings based on the XP in each of the stats.
 
Upvote 0
No, I meant something else. It's because I already set up the custom stats in ServerPerks, but what I want intend to use StatsX is to use it to show the player rankings based on the XP in each of the stats.

Hrm...no it won't work. All the tracking server does is listen for the UDP packets from the mod, pull out stats and values, and accumulate them. The problem is it always accumulates, so whatever values are passed in just get lumped into the final tally.
 
Upvote 0
Very impressive, will have to give this a try -- thanks for the effort!

Running this for about a day now, loving it so far and can't wait for 1.0.1 to get white listed.

On the server records section where it lists all of the weapons, are the numbers on the right side shots fired or shots connected? And for the melee weapons in this sections is that tracking all swings or just connected ones?

Also I noticed an oddity or so it would seem. On the deaths tabulation for my servers I have a "Self" count of 211 but on the Kills tabulation it lists "Self" as having 215. I haven't really compared anything else but this just stood out to me, I'm using the white listed version if that would be the reason.

Again, thanks so much for the work on making this, this is exactly what I've been wanting for a while!
 
Last edited:
Upvote 0
Where is the "data" for the web stats stored exactly?

Haven't installed it yet, just looking over the information.

Really wanting to get this loaded onto my server and my web site for "local" stats tracking on my clan server similar to how I run stats for my L4D server. http://www.tdnclan.com/l4dstats/

I'm assuming this mutator will do the same.
 
Last edited:
Upvote 0
Very impressive, will have to give this a try -- thanks for the effort!

Running this for about a day now, loving it so far and can't wait for 1.0.1 to get white listed.

On the server records section where it lists all of the weapons, are the numbers on the right side shots fired or shots connected? And for the melee weapons in this sections is that tracking all swings or just connected ones?

Also I noticed an oddity or so it would seem. On the deaths tabulation for my servers I have a "Self" count of 211 but on the Kills tabulation it lists "Self" as having 215. I haven't really compared anything else but this just stood out to me, I'm using the white listed version if that would be the reason.

Again, thanks so much for the work on making this, this is exactly what I've been wanting for a while!

Thanks for the kind words :).

For weapons, those are the number of shots fired, or for melee weapons, number of swings. Basically they are tracking weapon usage through out a game so it does include things like randomly firing shots during trader time.

Hrm...that is odd....I haven't seen anything get desynced yet on my personal server. Then again, I don't have a self kill tally of 200+ ;). I'll look into it but I do not know what could be causing this difference.

Where is the "data" for the web stats stored exactly?

Haven't installed it yet, just looking over the information.

Really wanting to get this loaded onto my server and my web site for "local" stats tracking on my clan server similar to how I run stats for my L4D server. http://www.tdnclan.com/l4dstats/

I'm assuming this mutator will do the same.

The mutator by itself doesn't store anything, as soon as a game ends, the stats are lost.

If you're asking about the Java server, then everything is stored in memory, with periodic writes to an sqlite database for persistence. Queries are done through the web server, which returns data back in XML.
 
Last edited:
Upvote 0
The mutator by itself doesn't store anything, as soon as a game ends, the stats are lost.

If you're asking about the Java server, then everything is stored in memory, with periodic writes to an sqlite database for persistence. Queries are done through the web server, which returns data back in XML.

Thanks for the information.

Exactly what does the mutator log as far as stats? From what I could tell from the demo web link, it only records number of Wins, Loses and Disconnects? Yet in game it records much more? :confused:

Does the Java script/program run on the game server end or the web server end? Also where do I get the "template" files so they can be fetched from a web server? (IE: When a player connects to the web server, the files that show the information they see)
 
Last edited:
Upvote 0
It records a lot more to the webserver. If you go to records and then click on a player and use the upper right and left hand navigation arrows you'll see...zeds killed and how much of each time, what weapons used and how much ammo/swings of each type, damage done/received, points welded, heals received/given, and more that I'm too lazy to try to write up... it's a heckuva lot though! :)

Regarding where the web server runs, it runs wherever you execute the startserver.sh from. I run it on a separate server from my game servers but you could probably run it on the same server as well if you wanted to.

I have about 2-3 days of stats collected thus far if you want a more detailed example to look at:
http://198.154.101.250:8080/index.xml
 
Upvote 0
I too have been seeing alot of Self kills. Over 4 servers with almost 8 days worth of accumulated playtime, Self kills are the highest on 537, followed by Gorefast on 435 & Crawler on 335.

For the tracking server, in a future update is it possible to get a short description with each page, IE that weapons in Shots fired/Swings.

Excellent mut btw, will be excellent when the updated version is whitelisted
 
Upvote 0