Sunday, April 4, 2010

Under the Hood

Its not a stretch to say that Virtual Table Tennis 3D was somewhat of a test case for the engine I've been developing since last fall. When the game shipped, the engine was missing many features (required for more sophisticated games) but I was quite satisfied with it from the architectural standpoint.

It took me about two two and a half months to write the engine. The feature I'm most happy about is the cross-platform architecture. This allowed me to develop most of the game code in Windows (in Visual Studio) and only test on the Android platform from time to time, which was HUGE time saver especially since there isn't any official debugger support for the NDK yet.

Still, there are many features missing from the engine and tons of TODOs littered throughout the source. I plan to address these short comings in the upcoming months.

Here are some additional details about the engine (as it was when Virtual Table Tennis 3D shipped):
  • Game and rendering backends are written entirely in C and interface with a thin Java client via JNI
  • Multithreaded engine (Main/input thread, rendering thread, game logic thread)
  • Cross-platform architecture:
    • All platform specific code (threading primitives, logging, writing to persistent state, etc) is abstracted out to a separate module.
    • Developed custom asset tool that automatically exports all assets to each platform and generates a .h header file containing the asset ids.
    • Developed Windows version of the game (using an OpenGL ES emulator) along side the Android version for easy debugging
  • Uses fixed point math since many current Android handsets don't support hardware floating point
  • Asset Formats
    • MD2 file format used for models
    • OGG format used for sound effects
    • PNG format used for textures
  • Tools used:
    • Visual C++ 2008 Express - C source development
    • Eclipse Galileo - Java development
    • Blender 2.49b - modelling
    • LithUnwrap - UV unwrapping for models
    • git - version control

No comments:

Post a Comment