MapTractor - GMod Map Stats Tracking Routine
Written by Buzzkill / thehundredacrebloodbath.com
https://github.com/100acrebb/thab_tools/blob/master/lua/autorun/server/maptractor.luaMapTractor generates statistics around server map usage, with a focus on identifying what maps attract or repel players. MapTractor polls the server every minute and updates
the json file "data/maptractor.txt" with statistics for the current map. Here's an example entry:
"deathrun_cb_egypt_v1": <- map name
{
"version": 2, <- statistics version.
"totaltime": 3734, <- total minutes the map has run on the server.
"timempty": 695, <- total minutes the map has been empty.
"playerscore": 27746, <- cumulative total players seen in this map, per minute.
"magnetscore": 11673, <- cumulative total players added to this map since it started, per minute.
"playermetric": 7.4306, <- the map's player score / total time
"magnetmetric": 3.1261 <- the map's magnet score / total time
},
"playermetric" is essentially the average playercount for the map. "magnetmetric" takes it further and considers how many players were on the map when it started versus at the moment,
thereby indicating the relative attractiveness or repulsiveness of a certain map. In other words, do players tend to join or leave the server while this map is running?
A sample ULX implementation is included. The ulx command "ulx mapstats / !mapstats" will generate a list of map statistics sorted by magnetmetric to console.
To Do:
Build out an optional routine to load the most popular map(s) when the server goes empty.
Eliminate the need for ULX for the !mapstats command
Incorporate peak time / off time concepts, so maps don't get penalized for running during off-hours, etc.