Introduction
Hi everybody! Recently I have decided to refresh memories about good old times and play Gravity Defied on my phone. It wasn't really hard to find port of that legendary game from J2ME to modern platforms. It rapidly gained glory among students of past decade. Key points of Gravity Defied success were nice gameplay (biker completing different stages with high cliffs and deep pits), convinient physics (ability to rotate mid-air) and simplicity of modmaking. As for me, it was a bit more than usual game. When I had completed over thousand tracks, I began earning money on helping others to progress. Only later even more difficult games were developed: HOMM 3, Far Cry and Dark Souls...
Predevel story
And now Gravity Defied is on my phone again! Not original, though, but well-made remake for Android. I can totally declare that atmosphere of game was transferred great! And one more time I got sucked into game so badly that I imagined biker each time I had seen polygonal path. One day, when I was waiting for rating recalculation after Codeforces contest and looking at graph on my profile page, I got an idea to use that graph as track. Just wanted to live through all the victories and defeats of past two years of competitive programming again...
Development
When I finally start to think about general concept of program, I realized that I know nothing about neither modding itself nor Gravity Defied track creating. So, Internet has everything, I thought... Firstly, I discovered that track files differ in two Android versions of GD (official from CodeBrew and unofficial from VKontakte developers, which is better in my opinion). And while .gdlvl for official was pretty easy (it's using most appropriate JSON extension), .mrg for unofficial (and for that J2ME game also) was truly comlicated! The thing is that there are very few useful forums (I found only one topic on russian forum and one wiki page which helped me at least in something). I got needed piece of information translated and proceeded with implementation. Python 3 script loads JSON with contests list of certain users and creates array of points using information about rating change and period of time between contests. All libraries used are built-in (os, sys, time, urllib, json). Being executed from console, it can either read handles from file or from command line. Installation guide along with script itself can be found here.
Some screenshots:
Please, notify me about found bugs in script and errors in post by PM.
Good luck and have fun!