• 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

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

Thanks!

Yeah, the tables aren't terribly informative in terms of what the data represents. Everything is just a simple data dump then generic transform without much thought to what specific tables may need. For example, on the difficulties page, the wave tab represents avg wave survived. But because everything is just transformed the same, the tables are only 1 step above viewing raw XML.

Oh totally didn't realize those arrows were clickable.

Where do I get the web files?

The web files are located in the dist/http folder. There are css, js, and xsl files you can edit to change the look and feel of the web server.

If you intend to create a fancier web interface, something more than just simple HTML, then you will need to have a proper web server running, for example apache. In that case, the stats web server can instead be queried from a PHP script and the data will be returned in raw XML format instead of being transformed into an HTML page.
 
Last edited:
Upvote 0
It does seem to consume a decent chunk of ram. Mine is using about 270 megs of ram and it's reading an sqlite file that's 483kB.

I run with
Code:
java -Xmx64M -jar dist/KFSXTrackingServer-v1.0.jar -propertyfile server.properties
but that doesn't seem to limit usage.

What do I need to stick into the start line to run this mutator automatically when the server starts?
 
Upvote 0
The server does store all of the player data in memory in addition to information polled from steamcommunity.com like avatar URL, profile name, etc. Well, I'll come up with a better way of managing the data to replace the lazy solution of just storing everything in memory.

Source code is here for anyone interested in the inner workings of the server:
https://github.com/scaryghost/KFSXTrackingServer

What do I need to stick into the start line to run this mutator automatically when the server starts?

?Mutator=KFStatsX.KFSXMutator
 
Upvote 0
Bah, I have profiled the server many times and reviewed the code and I can't find any memory leaks or similar issues. The memory consumption is more of a general Java issue as it does consume more memory than the equivalent C++ program due to how Java creates objects, utilizes the heap, and handles garbage collection. Unfortunately, the data does need to reside in memory because the web interface will be frequently reading the data.

I can release a stripped down version of the tool, where it only reads and stores the data into the db. Because there is no web server, there is no need to keep the data in memory so users will need to have Apache + web scripting to create their own web interface.
 
Last edited:
Upvote 0
Any chance of a future version have an increment for every zed hit attributed to the player.

It's already accumulating damage data, but if there is hit data then we can do Accuracy ratios :)

Maybe even headshotkill/headshot ratios if we accumulate each headshot as well as the headshot kill.

The way I tally damage requires me to create custom pawns. I can't do it through GameRules.NetDamage because KFGameType does not honor the call when non ff damage is dealt. I didn't really care for damage since each player will tally about the same damage anyways on each difficulty. However for accuracy, it won't fly since custom specimens won't be able to tally hits which means accuracy will just plummet when playing with them.


Instead of storing data in the memory, is it not possible to just write everything to a log file for each match/map then let php on the web server pulls that file and parse it. Similar to how utstats does its logging.

If I did it that way, then processing would be slow, even more so once the log files get bigger. The tracking server already stores things into an sqlite database for persistence but like I said earlier, the web server is doing a lot of reading so it makes no sense to read in data multiple times from the same file. Also, since the web server and packet listener are running on the same process, it can just access the stats objects directly, no need to parse text from a log file. That is why I will release a stripped down version that only stores data into the db for those worried about memory.
 
Last edited:
Upvote 0
File size isn't an issue. The log will get deleted once the web server pulls the data into a mysql database. Each session/map a new log file is created with the map data/stats. A script on the web server ftp into the game servers log directory, pulls the logs, then deletes them. Once on the web server, it parases the information into a database then deletes that file and/or stores it for backup. Now the data is stored in a database where it can stay forever.

Then again, im just talking about the web server side of the stats processing. The ingame stats doesn't concern me, so im not worried about them. That's probably where live/instant stats are needed to be stored in memory for quick access.
 
Last edited:
Upvote 0
File size isn't an issue. The log will get deleted once the web server pulls the data into a mysql database. Each session/map a new log file is created with the map data/stats. A script on the web server ftp into the game servers log directory, pulls the logs, then deletes them. Once on the web server, it parases the information into a database then deletes that file and/or stores it for backup. Now the data is stored in a database where it can stay forever.

Then again, im just talking about the web server side of the stats processing. The ingame stats doesn't concern me, so im not worried about them. That's probably where live/instant stats are needed to be stored in memory for quick access.

The Java server basically does that except data is sent via UDP packets. It also handles HTTP requests so end users can have an all-in-one deal that stores data and provides an interface to view them.

If I did it that way, then processing would be slow, even more so once the log files get bigger. The tracking server already stores things into an sqlite database for persistence but like I said earlier, the web server is doing a lot of reading so it makes no sense to read in data multiple times from the same file. Also, since the web server and packet listener are running on the same process, it can just access the stats objects directly, no need to parse text from a log file. That is why I will release a stripped down version that only stores data into the db for those worried about memory.
 
Upvote 0
Sweet, so with the latest changes to the KF code, listed here, I can now compute accuracy, damage, backstabs, and decapitations w/o customizing every specimen. Also, I've improved the structure of the sqlite db tables and have started working on a less memory consuming version of the tracking server.

Really appreciate your work on this and very much enjoy running the mutator.

With the Halloween update, did your 1.0.1 version get white listed?

Also, would you be able to add a feature to the stats server to show all players rather than just incremental allotments of players?

I've kept my KF servers hammering my server running the stats DB, if there's any data I can provide please let me know and I'd be happy to.

Crossed 3000 players today: http://stats.braindrained.net/

Thanks again for the work and releasing it for us to use, I always wanted this kind of tracking and then all of a sudden..here it is! :D
 
Upvote 0
Really appreciate your work on this and very much enjoy running the mutator.

With the Halloween update, did your 1.0.1 version get white listed?

Also, would you be able to add a feature to the stats server to show all players rather than just incremental allotments of players?

I've kept my KF servers hammering my server running the stats DB, if there's any data I can provide please let me know and I'd be happy to.

Crossed 3000 players today: [url]http://stats.braindrained.net/[/URL]

Thanks again for the work and releasing it for us to use, I always wanted this kind of tracking and then all of a sudden..here it is! :D

Sadly 1.0.1 is not whitelisted yet. I am updating the mod to take advantage of the code changes and will submit that version (2.0) to be whitelisted when the event is over.

I'm curious, how much memory does the Java exec consume? I figure it must be fairly high because everything is stored in memory. Also, if you wouldn't mind, would it be ok for me to get a copy of the sqlite file? Having 3000 unique players would be a good way to benchmark the changes I am working on.
 
Upvote 0
Sadly 1.0.1 is not whitelisted yet. I am updating the mod to take advantage of the code changes and will submit that version (2.0) to be whitelisted when the event is over.

I'm curious, how much memory does the Java exec consume? I figure it must be fairly high because everything is stored in memory. Also, if you wouldn't mind, would it be ok for me to get a copy of the sqlite file? Having 3000 unique players would be a good way to benchmark the changes I am working on.

Looking forward to the updated version! I'll provide the db file the next time I stop the server, I'm assuming that's when it get written from memory? I only ask because mine has a last modified date from August and is fairly small at 820kB.

I'll verify when I have a chance to stop the server and provide the file. As far as memory at this moment it's consuming 281872 kB and honestly it has stayed rather consistent (don't recall it going over 300megs thus far). I am executing it with
Code:
-Xmx64M
however. Thanks again!
 
Upvote 0
Looking forward to the updated version! I'll provide the db file the next time I stop the server, I'm assuming that's when it get written from memory? I only ask because mine has a last modified date from August and is fairly small at 820kB.

I'll verify when I have a chance to stop the server and provide the file. As far as memory at this moment it's consuming 281872 kB and honestly it has stayed rather consistent (don't recall it going over 300megs thus far). I am executing it with
Code:
-Xmx64M
however. Thanks again!

Thanks for the info! You can check when the db was last written to by searching for this line in the log file:

Committing changes to database
By default, it should commit every 30 minutes. Alternatively, you could open up the db with an sqlite browser and take a peak inside to see that you have 3000+ entries in the records table.
 
Upvote 0
Thanks for the info! You can check when the db was last written to by searching for this line in the log file:

By default, it should commit every 30 minutes. Alternatively, you could open up the db with an sqlite browser and take a peak inside to see that you have 3000+ entries in the records table.


Ahh thanks, according to the log it last committed the changes on September 18th (actually misread the date on the last modified date) so that matches up with when the file was last modified. Also peaking at the tables I only have 951 records in there despite having 3,000+ on the server right now.

I can provide you that file and the log if you'd like. Although now I'm very curious as to how the server is even updating, there's 85 new records since yesterday so it's certainly working -- would it be holding everything in memory at this point?

Thanks again for your time and efforts!
 
Upvote 0
^ Awesome! Thanks for the usage info!

--------------------

Version 2.0 is now released. The mutator has been reworked so that it doesn't need its own specimens, allowing it to be compatible with custom specimens, e.g. brute, super zombies, etc. I will be submitting this version to the whiltelist, which will replace version 1.0. When it is on the whitelist, I will update the workshop page.

Changes

  • Updated code to utilize NetDamage to track stats, allowing it to be compatible with more mutators
  • Added "Blades Retrieved" stat for Buzz Saw weapon
  • Removed "Explosives Disintegrated"
    • Unfortunately this stat cannot be tracked without a custom siren or until TWI fixes a bug in calling NetDamage
  • Damage stat will show during trader time

Downloads
https://github.com/downloads/scaryghost/KFStatsX/KFStatsX_v2.0.zip
https://github.com/downloads/scaryghost/KFStatsX_ServerPerks/KFStatsX_ServerPerks_v1.0.1.zip
 
Upvote 0