Hacker News new | ask | show | jobs
by MichaelHoste 3707 days ago
There were 3 difficult parts:

* The most difficult one was recreating the physics with a modern physics engine (box2D) to make them feel like the original ones. The smallest difference was making some levels impossible. It's not perfect but I tried to tweak them the best I could. And I created a debug mode to help me (and others) achieve this: http://js.xmoto.io/?level=1010&debug=true (I had way too much fun with this mode!)

* Levels: the level format was documented but not everything was "well"-documented. So I had sometimes to reverse engineer things. Like you could see, there are thousands of levels and they added layers of logics with time. So the first levels are usually compatible, but not the latests. And when I tried to add some logics (parallax, checkpoints, etc.), sometimes, the first levels broke (it's difficult to write tests for this). I wrote a blog post about it here: http://xmoto.io/2013/08/20/level-parsing.html

* Replays: I tried to find the smallest possible format to save all player's replays on a database. The original purpose was to create a kind of online community where people could challenge themselves and replay size matters. I first tried to save the replays as "keyboard inputs" but it wasn't reproductible as physics engine are not deterministic between browsers (I learned it the hard way). So I had to save both keyboard inputs and physics "checkpoints" (every x seconds) to adjust the replays. I'm quite happy with the results because it's about 20ko for 1 minute of replay. Here is a big monologue about my reasoning: https://github.com/MichaelHoste/xmoto.js/issues/8

It was fun because I'm a full-time Ruby on Rails developer and I was way out of my confort zone :-)