Quake 3 For Android 137
An anonymous reader writes "Over the last two months I ported Quake 3 to Android as a hobby project. It only took a few days to get the game working. More time was spent on tweaking the game experience. Right now the game runs at 25fps on a Motorola Milestone/Droid. 'Normally 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 Quake 3 runs at 22fps. Since Quake 3 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. Quake 3 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.''
Hmmm. (Score:5, Informative)
Dunno why TFA didn't include it, but there is video [youtube.com].
Re:Where's my flying car?! (Score:4, Informative)
Re:Running Demos (Score:3, Informative)
demos recorded on any 1.32 should work with ioquake3, you may need to run them with the demo command manually. I can't verify that they'll work or not with this android fork.
Just another note: (Score:1, Informative)
In the story it doesn't say that it runs the best on the Phone it's developed: The Milestone/Droid.
Also it doesn't say that it does not run on android 1.5 and that it again runs the best on android 2.0 and upwards.
Re:Not impressed (Score:4, Informative)
If that is "Unreal 3", then it's a very, very stripped down version. It doesn't even look like it has pixel shaders, which removes all benefit to using it over the Quake III engine.
By the way, the Quake III engine is capable of handling visuals that look better than the screenshots you linked to. Here are a few examples of what the Quake III engine can do.
http://www.szico-vii.com/uploads/photos/16.jpg [szico-vii.com]
http://www.szico-vii.com/uploads/photos/17.jpg [szico-vii.com]
http://www.szico-vii.com/uploads/photos/31.jpg [szico-vii.com]
http://www.szico-vii.com/uploads/photos/42.jpg [szico-vii.com]
Re:What about the N900? (Score:5, Informative)
Re:What about the N900? (Score:3, Informative)
And here's the Symbian s60 port [mbnet.fi], released in November 2008. And a video showing accelerometer support [youtube.com].
Re:Hmmm. (Score:4, Informative)
doesnt work on Nexus One
Re:Good job (Score:3, Informative)
The Milestone's based on an ARM Cortex A8 running at 600 MHz. It's probably the slowest-clocked of the "new" superphones. (For Americans, it's a Motorola Droid for Europe and Canada with some small software and SKU differences).
The Dingoo A320, according to the font of all wisdom, Wikipedia, is underclocked to 336MHz.
Last I looked, ARM seemed to have a definite edge in memory bandwidth, and had instructions aimed at handling media-rich applications much better than MIPS. I could, of course, be out of date on that.
So at an educated guess, I wouldn't expect your Dingoo to be able to touch a modern superphone. (Maybe at best a quarter of the processing power assuming Neon optimizations?) Of course if the Dingoo's screen is low enough resolution, then that may not matter as much.
Re:Just another note: (Score:3, Informative)
Re:Wow great job (Score:2, Informative)
Re:Running Demos (Score:4, Informative)
Re:How about integers instead of floating point? (Score:4, Informative)
I don't know anything about the code either, but I can take a stab.
The angles aren't actually the problem, the real problem is points on a Cartesian plane (x and y coordinates)... but angles suffer from the same thing that is the real problem. I'll explain as simply as I can (even for experienced programmers and mathematicians, I have found simple to be better, so don't take that the wrong way).
The exact location of every 3D object in a game is represented by X, Y and Z coordinates. These are currently stored in floating point, so that something can be at x=.5 and be comprehensible to the engine. This means that the object can be almost anywhere without rounding to an integer.
Your idea is that basically with small enough points, the player would be unable to tell the difference. While it's true that with tiny enough points this may be true, one of the big issues is movement within a 3D world. Essentially, the movement is something like this:
Your current position is (0,0) facing 0 degrees. You are getting 60 FPS. You press the forward key, moving north.
New X Coordinate = old_X + time * Sin(angle) = 0 + .3 + 1 microsecond * 0 = 0 .3 + 1 microsecond * 1 = 1
New Y Coordinate = old_Y + time * Cos(angle) = 0 +
You are now at (0,1), which is as you'd expect. Let's mess things up a bit.
Your current position is (3, 6) facing 146 degrees. You are getting 34 FPS. You push the forward key, moving at the angle 146.
New X Coordinate = old_X + time * Sin(angle) = 3 + 0.566666667 * .75011107 = 3.42506294
New Y Coordinate = old_Y + time * Cos(angle) = 6 + 0.566666667 * 0.661311865 = 5.62525661
See what's starting to happen here? Floating point representations of coordinates are vital to preserving the object's exact coordinates. If you used ints for these values, you'd be forced to round and lose a lot of precision. That adds up, especially when these calculations are being performed every 34 seconds. The model would 'jitter' and seem to be very slightly spasming, which would look terrible. Unfortunately floating point numbers are required here.
Re:Kudos! (Score:4, Informative)
Actually, with Xcode and iPhone OS you do not have to jump through all the hoops this guy did. GCC in Xcode generates ARM6 or ARM7, Thumb or non-Thumb code - no futzing with compilers, tools or worrying about taking advantage of the hardware FPU. You can also mix Objective C, C, C++ code and libraries with very little effort - no Java to NDK-level and back calling BS. Stuff like this is easier, NOT harder, on iPhone OS.
Re:How about integers instead of floating point? (Score:1, Informative)
http://en.wikipedia.org/wiki/Fixed-point_arithmetic
Floating point is most certainly not required. Choose a suitable coordinate system scale relative to the minimum necessary movement scale to eliminate jitter. Bonus points if you choose a power of 2 scale factor: now some divisions can be replaced with bit shift operations.
Re:How about integers instead of floating point? (Score:3, Informative)
You can still use integer math to represent fractional values. For example, using the upper 16 bits as the integer part, and the lower sixteen as the fractional part.
Something like this only implemented with inline assembly:
Int32 fMult( Int32 a, Int32 b)
{
return (Int32) (((Int64) a * (Int64) b)>>32);
}
You don't have nearly the dynamic range of floating point, but you *can* implement rotation matrices, vectors, time and distance and physics calculations. You just have to be careful to keep the values in range.
Re:How about integers instead of floating point? (Score:3, Informative)
You don't know about fixed point math I take it?
Re:How about integers instead of floating point? (Score:3, Informative)
3d games before Quake 1 used integer, fixed-point math and worked just fine (e.g., Doom). The trig was all done using look-up tables. Fixed-point allows you to retain enough of the precision for everything to work smoothly.
Quake 1 used floating point because they (id) found that with the introduction of the Pentium that floating-point was actually faster for the Quake 1 game engine.
For modern-day portable devices I wonder if this is still true. I also wonder how well trying to mix fixed-point math and 3d hardware APIs would work. Switching to integers could be done, but it would complicate the code and would likely be slower.