天鳳記録 ‐ Tenhou ranking tool


about

This tool — known colloquially as ranking.pl — has quite some history, and I have received a ton of help during its many phases of development. This page should shed some light on this.

credits

Special thanks also go to: osamu, xkime, TRA, Senechal, fso, yazphier, UmaiKeiki, and all the other guys on #mahjong and #osamuko on Rizon. Without them I wouldn't have been able to understand all this Japanese stuff and mahjong terminology, as well as some other technicalities. They have also been the primary testers, and the source of many feature ideas and improvements!

history

ranking.pl has had roughly three versions, each better than the last. Let's go through them.

version 1 (2009-04-10 ~ 2009-07-17)

The first incarnation is characterised most of all by its backend. Game records were stored in a flatfile database, which originally consisted of only games played in L7447, L5676. It was a rushed project and had a lot of bugs, the most memorable of which is one that prevented the script from calculating the lowest points scored out of all the games.

Although subsequent revisions improved upon this version in almost every way, one rather pleasant feature was necessarily lost: Because the database of games was so small, it was also possible to search for the statistics of NoName. The script wasn't really designed to expect this as an input, so the output was (predictably) quite strange when computing statistics for games involving the same player multiple times.

Later, L0000 houou (which I called "gigadan" back then) became available through the service. It should be noted that all three different lobbies had their own backend script and input form. This was soon to change, though.

archived version 1 main page and input forms

version 2 (2009-07-16 ~ 2013-01-25)

This was the most revolutionary version, implementing (in theory) the ability to search every single game ever played within a matter of seconds. Rather than using a flatfile database, I inserted everything into a MySQL table and did some optimisation to make it fast enough.

The main problem here was that the entire insertion process, from harvesting of game records to the MySQL operations (handled by mysqlimport), was very complicated and very fault-tolerant. Astonishingly, this survived for about 3.5 years with only one major hiccup: At one point, the Tenhou game records published changed their format, adding 1 decimal place precision to all points (even though it was, and still is, just .0 always). By the time I had noticed a fault, a few days were lost and some data had been inserted multiple times.

The nature of the MySQL table design and the lack of error reporting combined made it almost impossible to fix these corruptions of data. I let this slide (I think it was some time in 2010), and since then the service could never claim to be 100% accurate.

Still, the same scripts soldiered on almost unhindered for some years until one day I got an email from my host complaining about the MySQL database. By this point it was about 10GB in size and was taking about 2 hours to insert all the day's new records (shared server). Long story short, they forced me to pull the plug on the database, and with it, the ranking.pl service. Shit.

At this point I immediately began looking at alternative hosting options. Being quite busy with school and some other things made this quite a slow process, but the results have so far been good, as we shall next see.

archived version 2 main page/input form

version 3 (2013-06-18 ~ present)

This is not quite history. I will quote part of the introductory message that I posted on the main page/input form:

Welcome to the new ranking.pl! This is the third big revision to the ranking service, with the following new features so far:

Let's see how this one goes!

active version 3 main page/input form


— bps 2013-06-30 (last updated: 2015-01-25)