Author Topic: MapTractor  (Read 3970 times)

0 Members and 1 Guest are viewing this topic.

Offline Buzzkill

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 176
  • Karma: 59
    • The Hundred Acre Bloodbath
MapTractor
« on: April 21, 2016, 06:21:43 AM »
MapTractor  - GMod Map Stats Tracking Routine
Written by Buzzkill / thehundredacrebloodbath.com
https://github.com/100acrebb/thab_tools/blob/master/lua/autorun/server/maptractor.lua


MapTractor 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:

Code: [Select]
"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.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: MapTractor
« Reply #1 on: April 21, 2016, 09:46:16 AM »
That looks pretty sweet for larger servers and communities! Nice job!  ;D
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6