PyvesB / advanced-achievements

:fireworks: Popular plugin that adds unique and challenging achievements to Minecraft servers.
https://www.spigotmc.org/resources/83466
GNU General Public License v3.0
199 stars 215 forks source link

Idea: Store vanilla stats and vanilla achievements #36

Closed JohOply closed 8 years ago

JohOply commented 8 years ago

Hello everyone!

I have another idea to improve this plugin : currently plugin stores datas that it uses to give achievements. On my server, i want to give to players a lot of datas and statistics. There are many plugin to track players and give these informations, but there isn't (or at least i didn't find) any simple plugin which only store vanilla's datas in mysql.

The goal is to store all stats (and maybe achievements) from minecraft (stats you can find in escap > statistics/achievements). It allows to display them on a website for instance.

English isn't my native language, so if you don't understand something please tell me :) Thanks for reading!

PyvesB commented 8 years ago

Hello,

If I've understood correctly, you want me to transfer the statistics from the escap > statistics/achievements into the plugin's own database?

JohOply commented 8 years ago

Somehow, yes. It allows to use/handle these datas

PyvesB commented 8 years ago

If I'm not mistaken, these statistics are local to the player's computer (or at least is was the case at one point). So for instance if the player also plays on a different computer or reinstalls the game, it will reset the statistics in escap > statistics/achievements. Therefore, if I'm not mistaken about this, I'm afraid that can't really be used. ;-)

JohOply commented 8 years ago

If i'm not wrong, it was the case at the begining. But now all these datas are stored in "world > stats > uuid.json" on the server (since 1.6, 1.7 or maybe 1.8, i don't remember exactly). Here an extract of these files : http://pastebin.com/uDcc1Xhw

PyvesB commented 8 years ago

Oh, interesting, I didn't know such statistics existed!

Nevertheless, it wouldn't be that simple to import all these raw files into a database by filtering only the interesting statistics in terms of programming. It would also likely be a very long operation (for instance on my server there are about 75000 such files). Finally once the import is done, what do I do ? Again there is no simple way to keep the two statistics systems synced, and Advanced Achievements would have to update the values in parallel using listeners, if they are available for all those statistics. At some point the two systems would no longer have similar values and would not be synced anymore, simply due to software bugs, server crashes, etc...

Overall this seems really complicated to do, and will not be optimal at all for the users. ;-)

JohOply commented 8 years ago

Oh yeah, i understand :p

In my head, i wanted to display statistics on my website : datas in database are only a "copy" of vanilla's datas. All datas can be updated every x minutes when player is online and only if there is a difference between database and minecraft stats.

JohOply commented 8 years ago

I didn't try it, but it seems something like: https://www.spigotmc.org/resources/minecraft-statistics-mysql.25609/

PyvesB commented 8 years ago

Hello,

Having a way to sync stats is great, but really far from enough. Already implementing this syncing would be a huge pain in terms of coding and server performance (here a guy has done it only for MySQL, and not for SQLite and PostgreSQL, and furthermore in a ill designed one giant table way).

Then, how do I monitor achievements? I can't, if the statistics are 5 minutes old, I have an inconsistency and can't correctly award achievements based on thresholds.

What if a player has been playing for 5 years on the server, but the admin only adds the plugin now? If the player has mined 100 million cobbles and the server admin adds achievements for 10, 1000 and 100000 cobbles mines, the player will never get any of the achievements listed, simply because he will never reach the precise threshold. I can simply no import statistics that are years old in a plugin that is just installed, it would not make sense.

What do I do for statistics that are not in vanilla stats? Well I would have to add two different systems, so again, not convenient.

So overall I think vanilla stats are really inconvenient and not a good idea for any plugin. Probably will never implement anything related to them. Thanks for the suggestion though. ;-)

Cheers,

Pyves