Creating Gravity Defied tracks using Codeforces rating graph

Revision en5, by awoo, 2015-06-26 08:52:35

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!

Tags gravity defied, codeforces, python

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English awoo 2015-06-26 08:52:35 41
ru5 Russian awoo 2015-06-25 22:51:01 0 (опубликовано)
en4 English awoo 2015-06-25 22:47:19 68
ru4 Russian awoo 2015-06-25 22:46:50 10
en3 English awoo 2015-06-25 22:42:40 197 Tiny change: 'ain...\n\nDevelo' -
en2 English awoo 2015-06-25 21:35:34 2608 Tiny change: '24422694/36ac0/8jKq7pMzPOc70dd/wU1hi' -
ru3 Russian awoo 2015-06-24 22:41:34 2804 Мелкая правка: 'e=
ru2 Russian awoo 2015-06-22 21:41:55 511 Мелкая правка: 'github).\n![ ](htt' -
en1 English awoo 2015-06-22 19:41:19 1976 Initial revision for English translation
ru1 Russian awoo 2015-06-22 19:35:53 2100 Первая редакция (сохранено в черновиках)