Monday, January 18, 2010

ioquake3 on the N900


Apparently my little after work project was cool enough to make the news page over at ioquake3.org. :-) I just thought I'd mention here that you can read some more about it in my earlier (first actually) blog post, and there are more pictures over here.

Thanks again to id Software and ioquake3 for a great code base! And to the people at Nokia and Maemo Summit for support and encouragement.

Btw, if you do own an N900 and have played with the ioquake3 port, please leave your comments and suggestions for improvements in case I feel the urge for another weekend hacking session. (I am aware there have been problems installing the package in the past, but they should now be fixed.)

27 comments:

  1. I'm eager to try it out but the game keeps crashing when I open it. When I open it from the programs menu it open a windows, waits for a second and closes itself. It doesn't show errors or anything.

    ReplyDelete
  2. Hi Im working on the pandora project and im wondering if your ioquake source is somewhere?
    Also I see your tinkering with xreal, I attempted to get that running on the pandora hardware, but never got something to work, but im also not experienced enough with opengl.
    Are you sending changes back to the projects? I really like to see your work run on the pandora. Which it should since the hw is the same as the nokia.

    ReplyDelete
  3. Soft, most likely this is because you've forgotten to install the data files. You need to copy all of the *.pk3 files from your Quake 3 CD into /home/user/baseq3 on the N900. It should launch successfully then.

    Also note there are a couple of bugs with the UI (requiring double tapping buttons) which I haven't had a chance to debug yet, but all in all, it works reasonably well. :-)

    ReplyDelete
  4. Scott, the source is available through the maemo.org repositories. Here is the link to the source package page: http://maemo.org/packages/source/view/fremantle_extras-devel_free_source/ioquake3/1558-maemo5/

    As for getting XreaL running on the N900 and similar hardware, yes, this should be possible... It would be easiest with SDL 1.3 as I believe they have added GLES2 support to that version.

    I have talked on #ioquake3 about the possibility of pushing the GLES1 support upstream. They are open to the idea, at least for the generic parts: the renderer, math code, etc. The input code (accelerometer, proximity sensor, touchscreen) would likely stay as a separate patch, though.

    ReplyDelete
  5. Regarding Open Pandora, the hardware looks quite similar; although obviously designed around gaming, rather than being a phone...

    It certainly looks interesting, and I'd be happy to hack on one, but for the moment I'm satisfied with the N900. :-)

    ReplyDelete
  6. yeah we have had quake3 running for a while, i had a version running based on a opengles wrapper. Another dev has a iphone version running too.
    One big question i have for you is what interface you used on the SGX driver. To my understanding theres 2 methods raw framebuffer and a X window interface. We are seeing a large performance hit with X, RAW is much better. Which are you using?

    ReplyDelete
  7. I am using the X11/EGL interface, since we're using X.org on the N900...

    I'm not sure, maybe you could get more performance from accessing the FB directly, but then you're basically going to have to write something like X anyway for your user interface.

    It might not be too bad if you're going for a console-style/single-application interface, but the N900 requires the ability to run multiple graphical applications simultaneously, so we use X.org.

    ReplyDelete
  8. Got it running on the pandora :-)
    Had to change the cfg_attribs though...
    Although its having the same performance issues as all the sgx stuff we are doing through X. Is there anything you can say that maemo might have done with X to get the performance you are getting?
    We are using angstrom if that helps any.

    ReplyDelete
  9. Scott, I can't remember anything specific off-hand, however there are inefficiencies in the PVR kernel code (which is open source.)

    Nokia will of course make the kernel tree available publically (if it is not already) so perhaps you can check there for any improvements.

    ReplyDelete
  10. Hey, I finally gave it a go, damn cool :D

    I think I'd find the accelerometer more intuitive if tilt forward/backward were look up/down.

    Just hold forward arrow to move, and ctrl to shoot (or maybe hijack the camera button). I tried pressing the camera button, it didn't end well.

    ReplyDelete
  11. Hey, I just ran it on my n900.

    It would be nice if I could put the data files onto the big /home/user/MyDocs section of memory, and then use symbolic links to make it all work. It didn't seem to find them when I did it this way.

    I didn't realise that it was accelerometer controlled, which kind of stuffed me up for a while once I got it actually running :). But once I figured that out... I really enjoyed it.

    ReplyDelete
  12. Oliver, you may also be interested in this work:
    http://koti.mbnet.fi/hinkka/
    It worked for q1/2/3 on the pandora and another device.

    ReplyDelete
  13. Neat!

    So, does this mean stuff that uses the engine, like Urban Terror or Tremulous, would work out-of-the-box, long as we get the ioQuake3 ARM patches first?

    I plan to demo the Beagleboard later this month at SCALE 8x, and it'd be awesome if I could show off working 3D games. Stuff that uses the 3D engine, or the DSPs, etc.

    ARM for the win!

    ReplyDelete
  14. Yeah, perhaps I should move the location of the data flies into /home/user/MyDocs/baseq3 so it's easier to install the files via mounting the device over USB...

    DerSaidin, yeah, I agree the input is not perfect. I was trying for a touchscreen/accelerometer only solution (so the device can be used closed) but obviously this sacrifices a lot of the buttons that would otherwise be available on the keyboard.

    One idea I've been considering is using some kind of external controller (e.g. PS3 bluetooth controller.)

    Scott, thanks for the link. I'll check it out when I have a bit more free time. :-)

    nightmorph, as for getting other games running, as long as you've got the source code, then yes, it's possible. I know Tremulous has source code available, but I'm not sure about Urban Terror.

    The reason the source is required is because I hook into the cgame code for the touchscreen and accelerometer input. In theory you could do a bit of hacking and write to the memory locations for the appropriate variables directly but that is ugly beyond belief, so I won't go there...

    P.S. Sorry everyone for the slow response time; it's currently a busy time at work.

    ReplyDelete
  15. Hey, really nice work!

    Got it up and running on my n900 with the openarena content. I was trying to join a network game a friend started on his laptop - but could not connect. It says we are using different protocol versions (68 on my n900, 71 on the laptop). We are both using the newest version of openarena, so i guess it has something to do with the ioquake3 program.

    Do you have any suggestions how to fix this or will there eventually be an update to ioqake3 so it will use the newer protocol?

    It took me some time to get used to the input method, maybe DerSaidin was right with the up/down look idea.

    Once again, thanks for this really cool application, this is what the n900 needs!

    ReplyDelete
  16. Hi there, I was wondering if you could helop me out ? I have created baseq3 folder in my root directory and transfered pak0 til pak 8 into it. Nothing happened when I clicked on the icon. I then typed ls/ home/user/.q3a/baseq3/ on x-terminal but it tells me file not found. Could you tell me what I'm doing wrong ?

    ReplyDelete
  17. Hi Jim, the files should be going into /home/user/baseq3 (you've got an extra .q3a there.) Most probably the game fails to launch because it's not finding the game data, and thus exiting.

    I've been meaning to add some nicer debug warnings for such situations, and perhaps move the data directory to /home/user/MyDocs/baseq3 so it's easier to transfer via USB.

    For now, though, the above should help you.

    ReplyDelete
  18. Ok, I retyped ls /home/user/baseq3/ and its showing these files - autoexec.cfg, bots.cfg, cgamearm.so, demoloop.cfg, q3.sh, q3config.cfg, qagamearm.so and uiarm.so. But still nothing happens when I click on quake icon. Am I missing something ?

    ReplyDelete
  19. I believe many other games such as American McGee's Alice run on the QIII engine, would it be possible to modify the engine to run games such as Alice? Great work!

    ReplyDelete
  20. Tony, see my latest post. It should now work. :-J

    To everyone else having problems, I will try to sort them out and add better debugging/error messages after I arrive in NZ.

    ReplyDelete
  21. Hey Oliver, cheers to you! Now I have one of my all-time favorite games on my N900! Amazing work, man. N900 best mobile device ever!!!

    ReplyDelete
  22. Hi Mazilu,

    Thanks for the kind words. :-) I'm glad you're enjoying your N900.

    I can't promise anything right now, but I'll try and make some time to further improve the ioquake3 port in the future.

    ReplyDelete
  23. Hey Oliver, certainly an awesome port... still no plans on this? I'd be really keen for a fix up for it to properly work for PR1.2 and for different controls/mouse support (to work with ps3 controller and other peripherals?

    ReplyDelete
  24. Hi IzzehO,

    I do have some plans for it, and hope to get the input fixed soon but right now it's pretty busy at work and unfortunately I'm finding myself with a lot less free-time available.

    Regarding the PS3 controller support... Well, this would be very cool. I'm tempted to buy a controller next time I'm at Verkkokauppa and see whether it works with the N900 bluetooth stack.

    ReplyDelete
  25. Thats a bit of a shame, I'm certainly in no rush for it though and its good to hear you haven't deserted it :D

    I can say the PS3 controllers work perfectly fine thanks to Smoku's work. As is, he has the left stick emulating the mouse and the right a scroll wheel.

    ReplyDelete
  26. Hello how to install Urban Teroor, Tremolus or another game on my N900? ..
    And.. my second problem is: I dont have ioquake3 in ma extra-devel repository.. what i am must doing?

    ReplyDelete