Following the last post lets get started by setting up the development environment and the tools to make this work.
But before that let me give a little background about how I started my game:
When I began my project a few months ago I want it to be released initially for the android market (since I am more familiar with android development) and also to be able to make it work for iOS and ouya (android based) in the future, my development was be to done in c/c++ to be cross-platform (android, iOS and windows) using open source libraries.
I’m of those who like games to run smooth as silk, every single game from the nes/snes(no sfx chip) era where designed to run at constant 60 fps, why? because those old crt TVs (and current mobile handsets) have a refresh rate of at least 50/60fps, so it makes sense to draw each frame of animation at the speed of the refresh rate providing users a fast responding game. With the advent of 3d games and the processing power of the early 3d consoles it was very difficult to sustain 60fps, for me it was ok if not passable to have games like ocarina of time running at barely 20-25 fps, but right now with current multi core processors, parallel gpus I think there is no excuse for not providing 60fps gaming (http://n4g.com/news/1227581/60-fps-should-be-standard-in-next-gen-consoles I like that post), I’ll stop here since this always causes such a debate :s.
The rendering part of the game has to be really fast, we need to take advantage of hardware acceleration, the good news is that the majority of current handsets support hardware accelerated 3d graphics with opengl es 2.0, my choice for handling the rendering is with the Irrlich engine.
The Irrlicht engine is cross-platform, supports either opengl or direct3d, it is simple and easy to use and can be easily adapted to your own needs.
Since I’m a little impatient I started to look around if someone else has already setup an android project with Irrlicht and for my luck there it was 🙂 http://gitorious.org/irrlichtandroid, these guys already did the task to adapt Irrlicht with an opengl ES 2.0 renderer with a working android demo (yes I know this is cheating, shame on me). This was the starting point of my project.
OK so what we are going to do is a “hello world” game demo : a breakout clone.
– All the graphics are going to be neon like (like those of geometry wars)
– Have a nice 3d model rotating in the background or a fancy background deformation
– We are going to use a particle system for the explosions (when the ball destroys a brick)
– The explosion particles will be done using vertex shaders, so we can have thousands of them
– Box2d wil take care of all the collisions
– Sfx and background music
– Basic score at the top of the screen (courtesy of librocket)
– Run at smooth 60fps
– Running in both Windows and Android
Here are some initial screenshots (video at the end of this post)
Below is a little diagram describing each component (library) for our game.
Ok this is the list of things that you need to get familiar with. there is plenty of information on the net on how to setup your android and windows development environment, etc:
- Android SDK : Be sure to download at least API 13 (To be compatible with Android 3.2 devices and up)
- Android NDK : This is the glue that allows java to integrate with c/c++
- Visual C++2010 Express Edition : Our main development IDE
- Eclipse (Juno optional) : Make sure to download the android development tools
- Cygwin (http://www.cygwin.com) : This is needed to work with ndk in a windows environment, you can follow this guide (http://pielot.org/2010/12/09/using-cygwin-with-the-android-ndk-on-windows/)
- Mali OpenGL ES 2.0 Emulator : For irrlicht to work with opengl es 2.0 on windows (http://malideveloper.arm.com/develop-for-mali/tools/opengl-es-2-0-emulator/)
- Nvidia Performance HUD ES (optional) : This is a great tool if you have a Tegra based device, with this you can monitor the performance of the opengl es code of your game , edit shaders on the fly and monitor the draw calls frame by frame (https://developer.nvidia.com/nvidia-perfhud-es)
To make this as fast as posible in the next post I’ll submit a working demo to a public svn repository (with all the open source libraries included) and from there I’ll explain each part of the code so you can start your own projects.
In the meantime you can look at this video showing up some of the features that our “hello world” game will have (this is running at 50/60fps on my Nexus 7):
Be patient for the next post…