Monday, October 4, 2010

Android Development Path

I've spent a lot of time trying to decide how best to approach development on the Android platform.  I tried to implement a bridge between a native rendering engine and the JavaScript engine but it was quickly becoming a real headache.  The direction I've decided to take is to convert the codebase to be a native Android library which will be available for purchase.

I really wanted to be able to keep the engine open, but the amount of time I spend on it does add up.  It'll be an inexpensive game engine for the Android platform, however.  I haven't even thought about price yet, but expect it to be a good value for the included features.  What this means for development is that it will follow behind the browser version of The Render Engine by about 2 months.

It will include all of the features of The Render Engine, and will include the exact same API.  Most of the work to convert a game from the browser based version to an Android version will only require you to rename your ".js" files to ".java" and build an Android project for it.  Some code will require changes, but I hope to create ANT tasks to simplify the majority of these common patterns.

On another note, after considering the results of the poll, The Render Engine will focus its future rendering context work on the Canvas, but will still support the DOM.  Separation of the two contexts will be more clearly defined, in the future, and support will be removed to allow simply switching between the two.  Once you've decided the direction you want to go with your game, it won't be as simple as switching to a new context.

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. How feasible is to run a game using a WebView? Bundling HTML & js and using webkit.loadData(), I mean. Would it perform badly or have unnacetable restrictions?

    It seems that content loaded using that method can't load content from the network, so no XmlHttpRequest's are possible but I'm really not sure. Maybe there's an alternative to use webkit with local data and occasional XmlHttpRequest (to post scores, load user profile) in Android. Possibly not.

    Btw, one of the native, non-js Androis game engines you should take a look is Rokon: http://www.rokonandroid.com/

    ReplyDelete
  3. There's just too much to expect from using the browser, or the WebView, when running on Android. I suppose it's because the engine is running in a JavaScript interpreter, running in a browser, which is running on the Dalvik VM, which is running on the hardware. At least by making it native, I remove two of those layers and run against the VM itself. I may still be able to allow JS versions of a game to run against the native engine (in fact, that gives me an idea to test out).

    ReplyDelete