Monday, June 27, 2011

NDK Profiler Improvements

I've uploaded a new version of my Android NDK profiler library. The major change in this version is much better timing accuracy through the use of ptrace. This requires Android 2.3 aka Gingerbread to work properly, so if like me you're sporting Froyo it's time to upgrade (if you can...)

If you do use Froyo or earlier then you will get timing information, but it will not be precise. In particular it will give too much time to functions called from other functions, time that is not attributed to the calling function. The actual call counts are still accurate, and it can still give you an idea of bottlenecks.

I've also added a new minimal example that is included in the source release. It's a silly example with 3 buttons and is pretty fragile, but should give you an idea of what you need to do to add profiling. There's also a new snippet of Make code that you can include to avoid copy-pasting all those TARGET_thumb_release_CFLAGS lines.

Sunday, June 26, 2011

The Lords of Midnight remake for Android

I've released another Android game, this time The Lords of Midnight gets the remake treatment. [edit - in the end, this has been removed at the request of Mike Singleton] Once more it's a port from a Nintendo platform, this time the GBA as I never got round to updating it for the DS. It's so close to the Spectrum original that you can almost smell the rubber keyboard. Check out that colour clash.

I've called the remake "The War of the Solstice", as it looks like Mike Singleton together with Chris Wild may be making an official game for iPod and possibly Android at some point. Rumours have been going on for several months now with nothing actually released, so it may come to nothing. They are concentrating on the iPlatforms first too, so hopefully my remake will not have any impact on their sales. I can't blame them for doing iPhone first; if you were to charge people for games on Android it'd be a support nightmare. There are too many devices with too many random reasons to crash or otherwise go wrong.

That's why this is yet another freemake. Hurrah! No adverts either (I'd edit /etc/hosts to block the advert networks myself if I actually used my Android phone for anything). I bet the first comment on the Market for this is going to be "this crashes on my HTC Desire".

Anyway, this remake fixes at least 1 major bug in the AI that was in my original remake (but not in the original game, oh man!), as well as adding touch controls throughout. I've learned my lesson from Elite: people want touch controls. The only exceptions here are back (for obvious back-like things) and the menu button, which is need to save the game. Everything else is fat finger friendly.

Monday, June 13, 2011

3D Space Game Source Code Release

I've received a few emails recently asking about the source code for the ahem Elite port that's in the Android Market [edit - no longer on the Android Market]. The TL;DR summary: the source is now available [edit - no longer available due to copyright concerns] and it includes updates to the DS and GBA versions with all core bug fixes that have gone into the Android version too.

The game began life on the Game Boy Advance and the source was always available in tar-ball form from my now-defunct Geocities remakes site (later moved to a new home). From there I ported the same code to the DS, though I didn't really make the most of the platform. There was no touch input and no use of the 2nd screen at all. The source was in a svn repository now though, on Google Code.

When I ported to the DS I did it the wrong way really: I ripped out the GBA parts and added in the DS bits instead. This meant that the Android port had to at least rip out the DS bits. I knew I didn't want to abandon the DS and GBA just yet, so as well as taking out the platform-specific code in the core part of the game, I added in hooks that each platform would have to implement in its own way. At first I only did the Android, Linux/SDL and DS parts of these hooks, but in the end I've re-done the GBA part too.

There's not a lot of documentation on building the source yet, I'll update that later this week if I get time. If you're interested in compiling all this, you'll need the Android development kits as well as devkitARM. The devkitARM dependency is for grit, so if you get that some other way and don't want to build the DS/GBA versions then you can do that too. Run "scons --help-variables" from the top level directory to see what things you can alter about the build. Or you can just browse the source code and marvel at the hideousness of it all.

As I've pretty much moved on from DS and GBA coding these versions are probably not as well tested as they ought to be. Let me know of any problems you encounter and I'll see what I can do. Patches are welcome :-) Also: saves are, sadly, not backwards compatible with previous releases. This is due to the addition of a new flag that stores the type of game - "Classic" or "Elite-A" mode. Elite-A is also know as "difficultly turned up to 11 mode".