×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Quake 3 For Android

Soulskill posted more than 4 years ago | from the can-i-get-a-hell-yeah dept.

First Person Shooters (Games) 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.''

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

137 comments

DUDE You're incredible (5, Funny)

linhares (1241614) | more than 4 years ago | (#31269572)

Team fortress by any chance? Steal the code, kill people, I can help with whatever task is needed.

Re:DUDE You're incredible (1)

BlueTrin (683373) | more than 4 years ago | (#31270052)

... Steal the code, kill people ...

I thought you were talking about the action in Team Fortress ...

Re:DUDE You're incredible (1)

TheRaven64 (641858) | more than 4 years ago | (#31270674)

Team Fortress has been running on handhelds for ages, and the source code was open for all except the last few versions, although it didn't need to be because Quake ran it in a bytecode interpreter so it was cross-platform. If you mean TFC or TF2 then you should specify.

Where's my flying car?! (2, Insightful)

TeamMCS (1398305) | more than 4 years ago | (#31269582)

I thought by the time we would have Quake 3 on a phone I'd be flying to work in my hover car. Imagine taking a trip back in time a few years and telling your younger self that Quake 3 would be [almost] playable on a cell phone - hopefully you wouldn't reply with a "whats a cell phone?"

Re:Where's my flying car?! (3, Informative)

pipatron (966506) | more than 4 years ago | (#31269624)

Hm? Quake 3 has been available for my Nokia since 2007 or 2008 or something.

Great job. (2, Insightful)

ipquickly (1562169) | more than 4 years ago | (#31269590)

Q3 is still one of my favorite games. The first thought that came to my mind when I read this was

"Do we have to hear about every case of someone porting something like this(doom,quake, etc)to a new device"

But considering all the effort that you put into doing this, I must say that I admire your dedication and attention to detail.

Great job.

Proves it equal to a Dreamcast (1)

tepples (727027) | more than 4 years ago | (#31270802)

The first thought that came to my mind when I read this was

"Do we have to hear about every case of someone porting something like this(doom,quake, etc)to a new device"

Proving that a device is "Quake 3 complete" allows the major labels to gauge what kind of game can be sold to owners of this device. For example, a device that can run Quake 3 can in theory run other games that use id Tech 3. It can also run games ported from console platforms comparable to platforms on which Quake 3 was released, such as Dreamcast games and early PS2 games.

Wow great job (-1, Troll)

Anonymous Coward | more than 4 years ago | (#31269596)

Now how about porting to a phone people actually buy (read: iPhone)?

Re:Wow great job (1)

Holmwood (899130) | more than 4 years ago | (#31270046)

I agree the parent is a troll, but not a very good one. From the very second sentence of the linked post:

I had seen ports of Quake3 to the iphone and the N900 which have similar specifications

When you troll without even bothering to read two sentences of what's linked that's just... sad.

Moreover, the iPhone falls significantly short in one area: the N900 runs at 800x480, and the Milestone/Droid at 854x480. The iPhone is presumably pushing ~37% of the number of pixels. (Assuming the game is running at native resolution on all 3 platforms). If so, fairly impressive pixel-pushing for the other two platforms.

Re:Wow great job (2, Informative)

Thunderbird2k (1753946) | more than 4 years ago | (#31270538)

The iphone 3gs has one other advantage it uses the PowerVR SGX 535 instead of the 530 which is used in the Milestone and N900. The 535 is about twice as fast.

Hmmm. (5, Informative)

Anonymous Coward | more than 4 years ago | (#31269600)

Dunno why TFA didn't include it, but there is video [youtube.com].

Caution: Rickroll (-1, Troll)

Anonymous Coward | more than 4 years ago | (#31270258)

Parent link is a Rickroll.

Re:Hmmm. (0)

Anonymous Coward | more than 4 years ago | (#31270266)

Maybe the video wasn't included because it is gawdawful? 85% of screen real estate occupied by background and two hands; long, long wait before game-play starts, no closeup of control inputs.

Running Demos (1)

get quad (917331) | more than 4 years ago | (#31269628)

I've been unable to get any demos to work which were recorded on the 1.32c exe, obviously because this is based off ioq3. If anyone cares to record or get vanilla demos for showcase purposes I'm all ears. OSP/mods appears to run, but being able to play match demos to show off gameplay would be the BOMB. Also, id software should REALLY take notice here and release a spectator-only client for QuakeLive which runs on Adroid ;-)

Re:Running Demos (2, Informative)

Time Doctor (79352) | more than 4 years ago | (#31269690)

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.

Re:Running Demos (1)

get quad (917331) | more than 4 years ago | (#31270090)

I've tried OSP with no luck (author already stated no mod support just yet), but am having a hard time finding any vanilla 1.32c demos thus far. If anyone finds them I'll certainly test and report back!

Re:Running Demos (4, Informative)

Thunderbird2k (1753946) | more than 4 years ago | (#31270586)

Demos should run well but from the main menu they don't work for some reason. During development I always ran them from the quake3 console (so 'demo four') and that works fine.

Re:Running Demos (0)

Anonymous Coward | more than 4 years ago | (#31270006)

1.32c is NOT based off of IOQ3. It was a security fix released a couple years ago by Id.

Good job (0)

Anonymous Coward | more than 4 years ago | (#31269642)

This is actually great news. I have been developing a game based on ioquake3 for a couple of years now. Each time someone ports the Q3 engine to a new platform, it opens up a whole new platform that I can target. Good job.

This does bring up another question. What are the features of the target ARM CPU and what clockspeed does it run at? I have a Dingoo A320 (MIPS32 based CPU with a native clockspeed of 400MHz) that seems to barely run Quake 1. If Q3 can run on an ARM powered phone, it should be able to run at similar speed on the Dingoo.

Re:Good job (1)

Time Doctor (79352) | more than 4 years ago | (#31269708)

Thanks for using ioquake3 :)

Re:Good job (0)

Anonymous Coward | more than 4 years ago | (#31270294)

And thank you for cleaning up many of the longstanding bugs in the Q3 engine. I've run through a whole laundry list of Quake based engines before settling on ioquake3. It may not have the graphical niceties of something like Xreal or Darkplaces, but it's a lot more stable and will run in many places that the others won't. Even so, I swear that every time I start writing Q3 shaders, I am able to come up with pretty close approximations of almost any effect used in more modern engines. Many people don't realize just how powerful the Q3 engine is.

In response to Holmwood, yes, the Dingoo's CPU is underclocked to 336MHz. Most of the Dingoo owners I've spoken to generally run everything at 400MHz without issue, since that is the speed that the CPU is rated for. Battery life doesn't seem to be affected much by the speed bump either. If the ARM has access to a FPU or GPU of some kind, I could understand how it is able to pull it off (the Dingoo has neither, as far as I know). It is odd that I can run Quake 2 under psx4all (Playstation emulator) and it doesn't seem that much slower than a ported game like Quake 1. Oh well, I guess there isn't much point to running Q3 on a handheld that doesn't even have network connectivity. Thanks for the info.

Re:Good job (2, Informative)

Holmwood (899130) | more than 4 years ago | (#31270186)

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:Good job (1)

TheRaven64 (641858) | more than 4 years ago | (#31270750)

There are two big differences between the MIPS32 you'll find in the A320 and, basically, any recent ARM SoC. One is that the last two or three generations of ARM chips have hardware FPUs, while the A320's CPU does not. If you're running Debian, then the A320 will be painfully slow, because the default Debian install for it was configured for hard float, meaning that every floating point instruction (including loads and stores to the FPU registers) raises an invalid instruction interrupt. This is then caught by the kernel, which inspects the old program counter, decodes the instruction (in software) and emulates it. This means FPU-intensive code runs at about 1% of the speed of a hardware implementation. Recompiling with softfloat support (which changes the calling conventions, so you need to recompile everything from libc up) makes it a lot faster.

The other big difference is that recent ARM SoCs all come with a GPU. The latest generation all support OpenGL ES 2.0, so you get a fully programmable pipeline (shaders and so forth), while the older ones have ES 1, which supports only the fixed-function pipeline. Even the old ES 1 GPUs are faster and more capable than anything on the market when Q3 was released.

In short, the A320 is a pretty useless machine. It's massively underpowered even by handheld standards (the Nokia 770 will be faster in most uses). The newer cheap MIPS-based use the Loongson 2F, which is a 64-bit superscalar MIPS III implementation (still little endian), and two FPUs, but a lot of them still don't come with a GPU, so you're looking at software rendering only. They're more than powerful enough for Quake 2, but Quake 3 required OpenGL hardware, so they'll probably struggle a lot.

Not impressed (1, Troll)

PommeFritz (70221) | more than 4 years ago | (#31269648)

I'm not impressed. Epic had Unreal Engine 3 running on the iPhone back in december last year: http://www.anandtech.com/gadgets/showdoc.aspx?i=3695 [anandtech.com] Granted, it's a modified version and I don't think there's a working game available yet that uses it, but the engine is several generations newer than the Quake 3 one... Still, nice job. It's weird to see 'big' games appearing on tiny devices. Didn't think the mobile technology would be this advanced so soon, tbh.

Re:Not impressed (-1, Flamebait)

Anonymous Coward | more than 4 years ago | (#31269714)

But, you forget - nokia had quake 3 before the jesus phone even existed. Where's your god now?

Re:Not impressed (4, Insightful)

Beelzebud (1361137) | more than 4 years ago | (#31269758)

Yeah and that is Epic Software doing that. They aren't exactly a hobbyist working without pay...

Re:Not impressed (0)

Anonymous Coward | more than 4 years ago | (#31270086)

So what you are saying is that a open source coder could never compete with a commercial one?

Re:Not impressed (0)

Anonymous Coward | more than 4 years ago | (#31270286)

One open source hobbyist coder can seldom compete with a team of paid full-time employees at a multi-million dollar company.

Re:Not impressed (1)

TheRaven64 (641858) | more than 4 years ago | (#31270762)

Being three months later isn't exactly not competing. I'd say it's pretty good for a single freelancer competing with a massive corporation. Mind you, Quake 3 was running on S60 mobile phones back in 2008, so that makes Epic's port 18 months late, which means, by your logic, that a multimillion dollar corporate development team can't compete with a few open source coders.

Re:Not impressed (1)

Abstrackt (609015) | more than 4 years ago | (#31271058)

So what you are saying is that a open source coder could never compete with a commercial one?

I think he's saying that comparing a team of coders to one guy doing this in his spare time isn't the greatest comparison. What I took away from that post is that this is a pretty impressive achievement.

Re:Not impressed (1)

Grey Ninja (739021) | more than 4 years ago | (#31269778)

I highly doubt that Unreal 3 would run better than the Quake 3 engine. Modern does not equal better. Most of the things that newer engines do better are somewhat worthless on a cell phone. You want simplicity and speed on a cell phone, not abstraction and flexibility. I would think that the Quake 3 engine would knock the pants off of Unreal 3.

Re:Not impressed (1)

Narishma (822073) | more than 4 years ago | (#31270102)

On the other hand, the GPUs you find in these phones have more in common with the current generation of PC GPUs than with those that were available when Quake 3 launched. UE3 is optimized for modern GPUs, but Quake 3 is not.

Re:Not impressed (2, Insightful)

TrancePhreak (576593) | more than 4 years ago | (#31270376)

GPUs in these phones are more common with what was around during the Q3 times. They support OpenGL ES 1.0.

Re:Not impressed (1)

TheRaven64 (641858) | more than 4 years ago | (#31270770)

The recent ones support OpenGL Es 2.0 (the first generation iPhones used an old, cheap, GPU to keep costs down and profits up). They're slower, but most of these devices only have an 800x480 device, so you don't need as much raw power as a desktop because you have a quarter of the number of pixels to draw (or fewer), which also means you can get away with less complex geometry and so on.

Re:Not impressed (4, Informative)

Anonymous Coward | more than 4 years ago | (#31269900)

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:Not impressed (1, Insightful)

tepples (727027) | more than 4 years ago | (#31270812)

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.

Other than that you don't have to GPL your game, which you do if you use an ioquake3-based engine. And it's likely that Epic will make Mobile Unreal available at a lower price to current Unreal engine licensees.

Re:Not impressed (0)

Anonymous Coward | more than 4 years ago | (#31271098)

You don't have to open source your entire game if you use an engine covered under the GPL. A number of projects like World of Padman and Warsow have closed art assets. Space Trader is even a fully commercial game based on the GPL id Tech 3 source.

Personally, I have been working on a game based on id Tech 3 and do not intend to open source my resources. I will probably distribute the game for free, but I am retaining full copyright to all art, music and sound assets. My only requirement is that I don't misrepresent the license for the engine and that I provide a link to the id Tech 3 source code. I'll also probably include the names of the people who worked on the engine in the in game credits.

Tons of closed source and/or commercial products use open source software without issue. It's a pro, not a con.

Copylefted engine with non-free assets (1)

tepples (727027) | more than 4 years ago | (#31271256)

I see three drawbacks of the approach of using a copylefted engine with non-free assets:
  1. It's easier to crack the encryption protecting your GPL game's assets from being copied than the encryption protecting a fully proprietary game's assets from being copied.
  2. In online multiplayer games or in single-player games with online score rankings, it's far easier to cheat in a GPL game.
  3. The gatekeepers of some platforms, such as Sony and Nintendo game consoles and Sony and Nintendo handhelds, prohibit all copylefted code. This came up when the developers of the Wii version of Pajama Sam started from ScummVM, a copylefted clone of the game engine that powered the original PC version, and Nintendo objected to the release of the source code of the Wii version. This will only become more widespread as projects under GPL version 2 or later shift to GPL version 3 or later, whose "Installation Information" requirement appears to conflict with the developer agreements for even semi-open platforms like the iPhone.

Re:Not impressed (0)

Anonymous Coward | more than 4 years ago | (#31271448)

From what I've read the unreal 3 port used the pixel shaders, since it would only run on the opengl ES 2 devices, and not on the original and 3g iphones.

Re:Not impressed (1)

LingNoi (1066278) | more than 4 years ago | (#31270500)

So lets sum up here.

This kwaak3, something that runs on most android phones, works, is a game, something you can download right now...

That's less impressive then a youtube video of a game that, doesn't work on the iPhone 2G, 3G or ipod touches, doesn't have networking, etc ...

Why do I get the feeling you're shitting on this simply because it's not related to the iPhone?

Re:Not impressed (1)

fuzzix (700457) | more than 4 years ago | (#31270700)

I'm not impressed. Epic had Unreal Engine 3 running on the iPhone back in december last year...

But they have yet to ship a Linux binary. BAH!

Kudos! (1)

viraltus (1102365) | more than 4 years ago | (#31269654)

Really! This is one of the main reasons I love open source, things like this and others would be imposible/difficult with the iPhone OS.

Re:Kudos! (3, Informative)

jo42 (227475) | more than 4 years ago | (#31270848)

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.

licka my (-1, Troll)

Anonymous Coward | more than 4 years ago | (#31269686)

sucka my stroka my COCK!

I wonder how fast... (5, Funny)

dvh.tosomja (1235032) | more than 4 years ago | (#31269696)

> Quake 3 optimized for Cortex-A8 with Neon is about 15% faster without audio

I wonder how much faster it will be without video

Re:I wonder how fast... (0)

Anonymous Coward | more than 4 years ago | (#31271050)

Slow audio is due to Java interface, is there anything the Java is good for ?

Mouse (1)

mxh83 (1607017) | more than 4 years ago | (#31269716)

The problem is that FPS like Q3 needs a proper mouse. Otherwise its no fun.

Re:Mouse (1)

Unending (1164935) | more than 4 years ago | (#31269772)

I wonder if a bluetooth mouse could be used, maybe some sort of 10 key for the left hand and you would be set.

Re:Mouse (1)

bemymonkey (1244086) | more than 4 years ago | (#31270074)

Android doesn't even have support for Bluetooth HID keyboards, and SPP is only supported halfway via a buggy app that refuses to stay connected for longer than 10 minutes at a time... :(

Re:Mouse (0)

Anonymous Coward | more than 4 years ago | (#31269794)

Not true. Perfect Dark was a wonderful game. But I have to agree that the controls as is are sucky. Most people are used to movement on their left hand, and looking around with the touch screen doesn't really seem to work right now. Either the acceleration curve needs to be tweaked so you can keep your finger in one spot in the corner without having to swipe it all over the place, or looking around needs to be moved to the direction pad, possibly with some aiming assistance like most console fps games have.

Re:Mouse (1)

golden age villain (1607173) | more than 4 years ago | (#31269810)

There are some FPS on the iPhone were you move using a virtual joystick in the lower left corner and look around using the rest of the screen. It's not perfect but it's ok to play casually on a small mobile device.

Re:Mouse (0)

Anonymous Coward | more than 4 years ago | (#31270318)

I don't own a touch-based smartphone, but aiming with a touch screen on FPS games for the DS works quite well. Local multiplayer in Metroid Prime Hunters is a blast. Of course, with the android you're limiting by only having one screen, but perhaps a section of the screen could be designated as a "mousepad".

What about the N900? (4, Interesting)

anomnomnomymous (1321267) | more than 4 years ago | (#31269784)

The N900 has also recently received a port of IOQuake3: Have a look at their site [ioquake3.org] for more details.

If you're looking for a very nice (open) phone, I'd go with the N900. No, I'm not from Nokia, just a -very- satisfied customer.

Re:What about the N900? (1)

WML MUNSON (895262) | more than 4 years ago | (#31269952)

Right on. Where was the Slashdot post when that came out?

There's a map for that (1)

tepples (727027) | more than 4 years ago | (#31270862)

If you're looking for a very nice (open) phone, I'd go with the N900.

The advantage of the port to Motorola Droid is that Verizon Wireless carries Motorola Droid. In the United States, the big three wireless carriers don't give a discount for bringing your own phone, so most people who want coverage choose a carrier first and then choose one of the phones that the carrier subsidizes. And as I understand it, Nokia has had trouble getting its Symbian-based and Maemo-based phones into Verizon, Sprint, and AT&T. So which U.S. wireless carrier do you recommend for use with the N900?

Re:There's a map for that (0)

Anonymous Coward | more than 4 years ago | (#31271476)

There's really only one US wireless carrier to use the N900 with. That's T-Mobile.

The phone will work with any US GSM carrier just fine, but it only supports the AWS 3G frequencies of T-Mobile in the USA.

I get about 800kbps down and 300-400kbps up around Washington DC on my N900.

Re:There's a map for that (1)

anomnomnomymous (1321267) | more than 4 years ago | (#31271818)

Sorry, I'm from the UK here :)
T-mobile and Vodafone both carry this phone (with excellent packages I might add: I'm currently on a 2 year contract, 20 pounds per months for 300 texts, 300 callminutes and 'unlimited' internet)

But as said: If you have the chance, certainly have a look at this phone.
I decided to not go with the iPhone (though I love its intuitive interface), as I don't like their restrictions with regards to getting your own software/third party software on there. I think this motivation was a blessing in disguise as the N900 is the same, if not better than the iPhone with regards to interface. With its 4 desktops, plenty of customization possibilities, this is every tinkerer's dream-phone.
Damn, reading back this post, I -should- get paid by Nokia: I look like a damn ad! ;-)

Just another note: (1, Informative)

Anonymous Coward | more than 4 years ago | (#31269808)

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:Just another note: (3, Informative)

Thunderbird2k (1753946) | more than 4 years ago | (#31270308)

On my project page I mention that Android 1.6 is required since I used the Android 1.6 NDK (previous versions didn't support OpenGL).

Are libraries even involved (1)

shutdown -p now (807394) | more than 4 years ago | (#31269950)

I'm not familiar with ARM architecture, but this bit still sounds suspicious to me:

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.''"

On x86 at least, no C compiler worth its salt would even generate a call to a library function for something like sin or cos - why bother with all the overhead of a call, if ultimately it's a single instruction in the FPU?

Now, one trick there is that it actually depends on compiler settings - whether you specify "precise" floating-point mode (which is fully standard conformant), or "fast" mode. Only the latter seem to produce an inlined implementation of sin & cos. Are you sure you're compiling with -ffast-math?

Re:Are libraries even involved (0)

Anonymous Coward | more than 4 years ago | (#31269978)

Yes I'm compiling kwaak3 using -ffast-math but in all cases it uses libm. It is only a hypothesis on why perhaps a generic soft-float build is not that much slower than a floating-point optimized build. You would expect that a soft-float version is a lot slower because quake3 uses floats for most of its math.

Re:Are libraries even involved (1)

Tapewolf (1639955) | more than 4 years ago | (#31270132)

AFAIK, most ARM processors do not currently have an FPU. Maybe as FPUs become more common support for using the FPU directly will be added. Just a guess.

Re:Are libraries even involved (1)

quadrox (1174915) | more than 4 years ago | (#31270242)

I believe most (older?) versions of ARM come without a FPU. Presumably the ARM processor on the Droid/Milestone is one of those that do have a FPU and thus can take advantage of it.

That's what I've been told, not sure whether it's correct.

Re:Are libraries even involved (1)

Thunderbird2k (1753946) | more than 4 years ago | (#31270350)

Yes I'm compiling kwaak3 using -ffast-math but in all cases it uses libm. It is only a hypothesis on why perhaps a generic soft-float build is not that much slower than a floating-point optimized build. You would expect that a soft-float version is a lot slower because quake3 uses floats for most of its math.

mo3 0p (-1, Flamebait)

Anonymous Coward | more than 4 years ago | (#31269968)

things I still elected, we took dim. IfQ *BSD is

How about integers instead of floating point? (1)

G3ckoG33k (647276) | more than 4 years ago | (#31270008)

How about integers instead of floating point? Without knowing anything about the code, how would integers perform here? Couldn't a static table with, eg 3600 precalculated angles simulate what you want? .

Re:How about integers instead of floating point? (3, Informative)

Sasayaki (1096761) | more than 4 years ago | (#31270824)

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
New Y Coordinate = old_Y + time * Cos(angle) = 0 + .3 + 1 microsecond * 1 = 1

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:How about integers instead of floating point? (0)

Anonymous Coward | more than 4 years ago | (#31270984)

Very, very new at 3D programming, but aren't those equations calculated 34 times per second, and not every 34 seconds? Asking for my own edification.

Re:How about integers instead of floating point? (1)

olsmeister (1488789) | more than 4 years ago | (#31271202)

You need to scale your values of X, Y, and time so that the time component is larger relative to X and Y.

Re:How about integers instead of floating point? (1, Informative)

Anonymous Coward | more than 4 years ago | (#31271348)

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? (3, Informative)

Jenny Z (1028212) | more than 4 years ago | (#31272016)

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.

Look carefully now slashdot... This is news! (0)

Anonymous Coward | more than 4 years ago | (#31270158)

for a change

Accelerometers (0)

Anonymous Coward | more than 4 years ago | (#31270164)

Wow I can't believe there is so much trouble over the controls, just use the accelerometer to control panning then you can play with just one hand on the dpad for movement and shooting. That would be amazing.

What about the classics? (1)

jonr (1130) | more than 4 years ago | (#31270648)

To heck with Quake. How about all those old 16 bit strategy games that are like made for cellphones? CIV series? MOO? StarCraft? MoM? Where are they?

Re:What about the classics? (2, Insightful)

Sir_Lewk (967686) | more than 4 years ago | (#31270768)

Those games (at least starcraft, I've never heard of the others) are not open source. The Quake 3 engine is. That is one of the benifits to open sourcing your old engines like iD does, your games will get ported to every platform in existance that can even remotely handle them.

Bad ass (1)

SphericalCrusher (739397) | more than 4 years ago | (#31270944)

I just purchased a droid and I am looking into all of the things I can do -- the free apps, playing with the SDK, running a web & ftp server on the phone, etc. This project is by far one of the best projects I've seen and I can't wait until you have it available so I can put it on my phone. I'm a huge idSoftware and Quake 3 fan. Great work!

modg up (-1, Offtopic)

Anonymous Coward | more than 4 years ago | (#31271218)

eto be about doing
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...