Skip to content

wurstmineberg/wurstminestats

Repository files navigation

wurstminestats

Plotting the Wurstmineberg Minecraft Server

Whitelist growth
Play Time

What this is

Primarily it's me playing around with R.
Besides that, this is an addition to the wurstmineberg player statistics page at our stats page.

The public directory at i.wurstmineberg.de/wurstminestats is the place to go for up to date plots (hopefully). For everything else, I'd like to build a shiny version of wurstminestats, which should serve as a more convenient place to scroll through the data. Also, interactive plot with actual text would be nice, but finding a plotting library for the web that's comparable to ggplot2 is pretty hard. Yes, I know about ggvis. No, there's no feature parity yet.

Deployment

The plots are now generated by executing genAll.Ron wurstmineberg.de via the fcrontab entry

30 0,3,6,9,12,15,18,21 * * * /opt/hub/wurstmineberg/wurstminestats/genAll.R

…which, in theory, should update the plots every 3 hours at 30m past the hour, to reduce load on full hours caused by backup compression and whatnot.

Dependencies

Besides a recent version of R (duh), there are some things you need for this to be portable to any other Minecraft server. Let's go over the foreign data sources in this briefly.

Packages

The biggie: wurstmineR

In an attempt to make this suck less, I moved most of the basic functionality from functions.R, along with the static strings.* data (see below) to it's own R package, primarily because I was curious how that would turn out. As it turns out, it's pretty hard to do it right, but oh well.
See wurstmineR for details. You need to install that via devtools::install_github("jemus42/wurstmineR"), which dataPrep.Rdoes for you on startup. Or at least it should.
Note that wurstmineR has it's own list of dependencies.

Other packages

  • twitteR (Only required if you intend to fill a twitter account with random stats, see @wurstminedata – Used in tweetstats.R)

Data sources

These are Minecraft API endpoints, which expose the actual player statistics we're interested in visualising. If you have this set up for your own server, you're pretty much good to go. Almost.

General information sources

This is our people database, which holds metadata about the people on our server, such as join date, nickname (ID), minecraft username and what have you. This is required to sort and classify the datasets. It is required in many dataset transformations, because I substitute minecraft usernames with their nicknames (IDs), sort them by join dates and group by their join status, so… If you don't want to set up a people.json, you'd need to get rid of these parts manually.

Just some substitution-friendly strings to make achievements more human readable.

Similar to achievements.json, this provides names and classification for player stats, as well as some mob name substitutions.

You guessed it. Contains biome ID, name if necessary and for this project the most relevant: Is the biome relevant to the Adventuring Time achievement or not. Used as a filter for the total amount of visited biomes per player and then put in this.

Like the other files, this is also used to substitute internal IDs with nicer names. More importantly, it contains both numeric and new IDs for each biome, which allows us to merge old, still numerically indexed item stats with current item stats. This will no longer be necessary when all the inactive players have finally logged in for once, but it's nice to be backwards compatible.
Note that these files are already included in dataframe form in wurstmineR.

Contribution

  • If you're familiar with R or ggplot2, I appreciate any hints on how to do something better, cleaner, more efficient or just more visually pleasing.
  • Requests for graphs are appreciated, and if I figure out how to make them happen, I will
  • Visual errors in graphs can be reported via the issue tracker, you know, to keep track
  • Errors with the data itself are more or less out of my reach.

Releases

No releases published

Packages

No packages published

Languages