Monday 30 December 2013

Neo Kong the Movie

Firstly I wanted to know how far off the mark I was with getting the tilemap rendered every frame. So I started rendering only part of the screen and it turns out it was only missing the mark by a few lines of tiles. In fact, if I had reduced the width from 32 to the visible 28, it would have scraped in. But I wanted more headroom than that; separating the rotated and non-rotated rendering routines was the obvious start. There were also a few other very simple, very obvious optimisations.

I've no easy way to profile the rendering code that I'm running, so the next best thing is to count instructions. The original, unoptimised tilemap render routine took 20,818 instructions per frame. After the above-mentioned simple optimisations, that's now down to 11,571, an almost 50% reduction. More than enough to continue with development without further ado.

After fixing one last bug - the sprite colour for an animated Mario - I've captured a small video of the Neo Geo boot-up and straight into the game-play, with Mario running back-and-forth along the bottom girder. Even the sprite priorities are correct, as you see him run behind the oil barrel.


And so from here-on in, I'll be adding code to allow Mario to traverse the entire girder level - including jumping of course - until he can reach Pauline waiting at the top. And although I've already encountered code specifically for the girder level, I suspect when it's all said and done, I'll be able to manoeuvre Mario around all of the 4 different levels.

No comments:

Post a Comment