Minetest statistics

Reedych
Member
 
Posts: 58
Joined: Wed Aug 03, 2016 08:09
GitHub: SlackCoyote
In-game: SlackCoyote

Minetest statistics

by Reedych » Sat May 12, 2018 04:35

Hello, I've made a MT statistic graph for 10 hours:

Image

As you see, online varies between 275 and 500 players. It's good online for open source game.

This statistic is made using php and gnuplot:
Code: Select all
#!/usr/bin/php7.0
<?php
const OUTPUT = 'data.dat';
const WAIT_TIME = 3600; // 3600
const SERVERLIST = 'http://servers.minetest.net/list';
const DEBUG = true;
const REWRITE = true;

if (!file_exists(OUTPUT))
        $ob_write_header = true;
else
        $ob_write_header = false;

if (REWRITE)
        $ob_write_header = true;

if (REWRITE)
        $fp = fopen(OUTPUT, 'w');
else
        $fp = fopen(OUTPUT, 'a');
if ($fp == FALSE)
        die("Can not open .dat file");
if ($ob_write_header)
        fwrite($fp, "##time clients servers\n");

if (DEBUG)
        echo "Cycle started\n";

date_default_timezone_set("UTC");

while (true) {
        $raw = file_get_contents('https://servers.minetest.net/list');
        if ($raw == FALSE)
                die("Serverlist is not available");
        $raw = json_decode($raw);
        if ($raw == NULL)
                die("Incorrect data");

        $time = time();
        $clients = $raw->total->clients;
        $servers = $raw->total->servers;
        $ready = "{$time} {$clients} {$servers}\n";
        fwrite($fp, $ready);

        if (DEBUG)
                print("Wrote: {$ready}");

        sleep(WAIT_TIME);
}
?>


Code: Select all
#!/usr/bin/gnuplot
reset
set terminal png
set style data linespoints
time = time(0);

plot "data.dat" using (($1-time)/3600):2 title "Minetest Clients"

Slackware64 14.2, MT 0.4.16. My best mod.
 

User avatar
Krock
Developer
 
Posts: 4144
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Minetest statistics

by Krock » Sat May 12, 2018 13:06

I also did some fetching of the server list. Here's the popularity of mods used on the announced servers, whereas the player count for each mod is the sum of online players on a server with this particular mod installed.
Data sorted using the formula: 2 * [players on server with mod] + [servers using the mod]

Image
Attachments
test2.png
(116.51 KiB) Not downloaded yet
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
domtron vox
Member
 
Posts: 110
Joined: Thu Feb 20, 2014 21:07
GitHub: DomtronVox
IRC: Domtron
In-game: Domtron

Re: Minetest statistics

by domtron vox » Tue May 15, 2018 12:53

@Krock is your list all mods that are used on all (announced) servers or is there some sort of threshold for either number of servers using a mod or number of clients on a server? I.E is the above list all mods used on servers or just the most used mods on the most popular servers.

Also I noticed default wasn't on the list. I would assume it would be at the top. Did you just remove it or is something else going on?

Just curious. Interesting stuff there.

Thanks!
 

User avatar
Krock
Developer
 
Posts: 4144
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Minetest statistics

by Krock » Tue May 15, 2018 19:06

domtron vox wrote:is there some sort of threshold for either number of servers using a mod or number of clients on a server?

All mods which had their value (2 * [players on server with mod] + [servers using the mod]) less than 20 were sorted out. That's a magic number but I had to set a lower limit to not end up with an extra tall list.

domtron vox wrote:Also I noticed default wasn't on the list. I would assume it would be at the top. Did you just remove it or is something else going on?

Almost all minetest_game mods would be on top of the list, so I blacklisted them to show the interesting/relevant mods here.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 


Return to General Discussion



Who is online

Users browsing this forum: No registered users and 3 guests