|
Project Information
|
This is a port of Quake3 to Android. ProjectWhen I received a Motorola Milestone phone, I wanted to get into Android development. I had seen ports of Quake3 to the iphone and the N900 which have similar specifications (all use a similar CPU and the PowerVR GPU), so I thought why not bring Quake3 to Android. As a start point I used the N900 version of ioquake3. It only took me a day to get the game to compile and to load the Quake3 main-function. After that it took me a few more days to get OpenGL and some input working. In the weeks following the initial port I added touchscreen support, networking and sound. Features
PerformanceNormally when you compile C/C++ code using the Android NDK, the compiler targets a generic ARMv5 CPU which uses software floating-point. Without any optimizations and audio Quake3 runs at 22fps. Since Quake3 uses a lot of floating-point calculations. I tried a better C-compiler (GCC 4.4.0 from Android GIT) which supports modern CPUs and Neon SIMD instructions. Quake3 optimized for Cortex-A8 with Neon is about 15% faster without audio and 35% with audio compared to the generic ARMv5 build. Most likely the performance improvement compared to the ARMv5 build is not that big because the system libraries of the Milestone have been compiled with FPU support, so sin/cos/log/.. take advantage of the FPU. One of my users also tested the game on his G1 but the device doesn't have much RAM and the CPU runs is downclocked to a little more than 300MHz. In the timedemo it scores about 10fps without audio. In game (after some tweaking) it can reach upto 20fps in not so busy areas. Another user managed to run Quake3 on his HTC Hero (see http://code.google.com/p/kwaak3/issues/detail?id=6). Below are benchmark results of Quake3 with and without audio. All benchmarks are run using demo four at the default Quake3 settings: In case of the Milestone the resolution is 854x480 and the hero uses 480x320.
Performance can be improved quite a bit by tweaking Quake3 settings. Setting lighting to Vertex instead of Lightmap improves performs by 20% to more than 30fps in Neon mode without audio. DesignAndroid programs are written in Java and performance critical parts can be implemented in a C library and can then be called using JNI. 99.9% of the code in this project is C and the other part is Java. The small Java part initializes OpenGL, handles input and manages audio. The Kwaak3 Java code communicates with a 'libquake3.so' using a libkwaakjni wrapper. This wrapper loads either a generic ARMv5 'libquake3.so' or a Neon optimized 'libquake3_neon.so' depending on the CPU.
Supported devicesDuring development I have only had access to a Motorola Milestone. This phone has a keyboard and for this reason the game has been optimized for devices with a keyboard, so it won't work on your Nexus One or other phone at this point. One of my testers used a G1 and thanks to his testing there is also some trackball support. If I had my hands on more devices I would add support for those devices. The minimum required Android version at this point is 1.6. Note the G1 doesn't have much RAM and due to this is very sensitive to crashing. The game might be more stable if you disable audio. Future work
Screenshots
Installation
ControlsThe game is controlled using the keyboard, touch screen and trackball (if available). The most important controls are:
FAQ
Kwaak3 only requires access to the sdcard (external storage permission) and internet support for networking. On some Android devices (at least on the HTC Tattoo and HTC Magic which run Android 1.6) also phone state reading is required for some reason. This is not the case on the Droid/Milestone or on the Nexus One.
Version 1.6 of the Android Native Development Kit (NDK) added support for OpenGL ES which is required for 3D rendering. Further I don't think it would make sense to run the game on older Android versions since you need a good CPU (with a FPU) and GPU for running the game. Most Android 1.x devices aren't powerful enough. The game is best served by a Cortex A8 like used in the Droid/Milestone or a Snapdragon as used in the Acer Liquid or Nexus One. Note I don't know how well the game performs on other devices except for the G1, it might be that lets say a HTC Hero runs it a lot better because the CPU isn't downclocked that much and because it has more RAM.
The cd-key menu is part of the original Quake3 game. A valid key is needed for online play but as you notice you can skip it (I think it is because ioquake3 relaxed the check a bit).
For some reason this doesn't work and I'm not sure why. I remember seeing it in normal Quake3 / ioquake3 before as well. You can always run demos from the quake3 console e.g. 'demo four'. If you want to benchmark the game make sure to type 'timedemo 1' before starting the demo. The framerate will appear in the quake3 console once the demo finishes.
There is network support in Quake3 which works properly. I played against my laptop using wifi and it works fine. Online gaming should also work but by default you can only connect to pure servers since I'm using precompiled quake3 libraries instead of the qvm bytecode (you could use the interpreter by playing with q3 console variables if you want but the performance will decrease a lot). Since the quake3 libraries can't be verified (and it can contain cheats) not all servers accept this. There is also no punkbuster support but none of the Quake3 ports have it because the code for that wasn't released.
If you search on Google, you will find 'Auriga3D'. It is a portable game engine written in Java which can load Quake3 maps but it is not a port of Quake3.
The ioquake3 engine supports mods like OpenArena properly. It should be easy to support them in Kwaak3 as well, so that you don't need any original Quake3 data. At this point mods aren't supported because I have added a check to see if pak0-pak8.pk3 are installed. I will add this in a future version.
At some point I might upload it to the Market. I would do it at a point where OpenArena and friends work fine. Further on the market it would just be called Kwaak3 and I would show screenshots of OpenArena and other mods and not of the original game and I also wouldn't use the original name anywhere, since I don't want to get into troubles with ID Software. |