User avatar
simonlc
Posts: 31
Joined: Wed May 16, 2012 4:11 am
Location: Calgary, AB
Contact: Website

Quake 3 Arena at 60 FPS

Fri May 25, 2012 4:18 am

Ever since I heard this thing would run Quake 3, I've been wanting to get my hands on one. It was reported that they were getting around 20-30fps, and I knew I'd be able to squeeze more fps out with just some simple tweaks.

So when I finally got my R-Pi, that's the first thing I did. With the help of people on IRC, I was able to compile Quake 3 on Raspbian. Initially I thought lowering the resolution would give me a big fps boost, but going from 1920x1200 to 640x480 only gave me a 3-5 fps gain.

The Raspberry Pi seems to force 4x anti-aliasing, and a 60fps cap. I think it's very possible that I could attain a higher fps if these limitations could be removed.

Configuring Raspbian
In the `/boot/config.txt` file, Raspbian comes pre-overclocked. Erase this line if you do not want this. In the `/boot` directory, you'll also want to move `arm192_start.elf` to `start.elf`. This allocates more memory to the GPU, needed for running Quake 3. After updating the OS and following the instructions here, you'll need to install `libsdl1.2-dev` and `build-essential`, which is required to compile Quake 3.

Compiling Quake 3
To get the latest source code run `git clone https://github.com/raspberrypi/quake3.git`.

Edit the build.sh file like this:
change line 8 to this: ARM_LIBS=/opt/vc/lib
change line 16 to this: INCLUDE_DIR="/opt/vc/include"
and comment out line 19: #CROSS_COMPILE=bcm2708-
Run `./build.sh`. Quake 3 will now compile. This takes about 1 hour. Alternatively you can cross-compile the game, instructions on compiling software for Raspbian can be found on its wiki.

Once compiled, move over the files to a clean directory and organize them like this:
quake3arena/ioq3ded.arm
quake3arena/ioquake3.arm
quake3arena/baseq3/cgamearm.so
quake3arena/baseq3/qagamearm.so
quake3arena/baseq3/uiarm.so
quake3arena/lib/libSDL.so
quake3arena/lib/libSDL-1.2.so.0
quake3arena/lib/libSDL-1.2.so.0.11.3
You'll then need the missing paks. These are pak0.pk3, to pak8.pk3 which can be found here, or if you own the game, the full version can be copied over from the install directory. The .pk3 files should be placed in the baseq3 directory.

Assuming you're still root, start the game with `./ioquake3.arm`. Start a game, run around see how it feels. Hopefully it all works, and it created the correct directories for you. Navigate to `/root/.q3a/baseq3` and run `wget https://dl.dropboxusercontent.com/u/435 ... ke3cfg.zip && unzip rpiquake3cfg.zip`

Start the game again, and the autoexec.cfg should execute automatically. If you'd like to try the other configs, drop down the console with the tilde key `~ and type `exec low.cfg` or any of the others.

Extra Stuff
Running as non-root
Last edited by simonlc on Sat Apr 13, 2013 3:52 pm, edited 2 times in total.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Quake 3 Arena at 60 FPS

Fri May 25, 2012 8:45 am

Thanks for posting this. I'll be interested to try out Quake 3 when my new SD cards arrive.

I also found another Quake 3 installation "howto" here
http://myraspberrypiexperience.blogspot ... uake3.html
Alex Eames RasPi.TV, RasP.iO

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Quake 3 Arena at 60 FPS

Fri May 25, 2012 5:28 pm

Quake 3 has a cap on fps. You can find the console commands online. Make sure you run the console at the menu not in game to set. On my PC it was capped at 90 fps. Ran a timedemo at 1.2 seconds and 940fps. Do not have a RasPi yet. Now that I got the OMAP extras up on the Panda Board I want to try Quake3 on it.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Quake 3 Arena at 60 FPS

Fri May 25, 2012 8:03 pm

In my opinion getting sound to work is more important than squeezing a few more fps out of the pi.
Or has that been cracked on the quiet ( lol )

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Quake 3 Arena at 60 FPS

Fri May 25, 2012 11:43 pm

texy wrote:In my opinion getting sound to work is more important than squeezing a few more fps out of the pi.
Or has that been cracked on the quiet ( lol )

Texy
That definitely should be a priority. Just not the same when you cannot hear them scream, as you let off a double barrel blast in their left ear. :twisted:
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

User avatar
simonlc
Posts: 31
Joined: Wed May 16, 2012 4:11 am
Location: Calgary, AB
Contact: Website

Re: Quake 3 Arena at 60 FPS

Sat May 26, 2012 12:11 am

Lob0426 wrote:Quake 3 has a cap on fps. You can find the console commands online. Make sure you run the console at the menu not in game to set. On my PC it was capped at 90 fps. Ran a timedemo at 1.2 seconds and 940fps. Do not have a RasPi yet. Now that I got the OMAP extras up on the Panda Board I want to try Quake3 on it.
Yes, but on the raspberry pi, the fps is capped at 60 fps regardless.

bbb
Posts: 55
Joined: Sat Jun 02, 2012 9:52 am

Re: Quake 3 Arena at 60 FPS

Sat Jun 02, 2012 11:54 am

Hi,

Thanks for instructions, I got this working quite nicely.

A few things to add:

1) there is no point coping the SDL pre-built libraries from the ioquake source code for raspbian (there not hardfp libraries) and only will work on the 'squeeze' image.
quake3arena/lib/libSDL.so
quake3arena/lib/libSDL-1.2.so.0
quake3arena/lib/libSDL-1.2.so.0.11.3
2) General warning about your config files in 'rpiquake3cfg.zip' - they modify everything (e.g. key bindings, mouse, network settings etc ...) when they should really just modify graphics settings and anything else performance releated like heap sizes etc ... I might have a play with this later and see what I can come up with, been a while since I had code up a quake configuration :)

3) If running as a non-root user and running from the console (non X11), then quake3 bombs out with an error message like 'SDL_Init()' 'Unable to open mouse'. This will effect other DirectFB applications/games that need a mouse.

Work around either to run with no mouse.

Code: Select all

export SDL_NOMOUSE=1
OR fix the permissions so non-root uses can access /dev/input/mice and /dev/input/mouse0 as follows.
Create new file in "/etc/udev/rules.d/99-input.rules"

Code: Select all

# file /etc/udev/rules.d/99-input.rules
KERNEL=="mice", NAME="input/%k", MODE="664", GROUP="input"
KERNEL=="mouse*", NAME="input/%k", MODE="664", GROUP="input"
Add a new group and add your user(s) to it (my login is just 'pi')

Code: Select all

groupadd input
usermod -a -G input pi
and then reboot and enjoy some frags.


PS. anyone know if the sound issues are fixed yet ? I can take a look :-)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23870
Joined: Sat Jul 30, 2011 7:41 pm

Re: Quake 3 Arena at 60 FPS

Sat Jun 02, 2012 3:33 pm

simonlc wrote:
Lob0426 wrote:Quake 3 has a cap on fps. You can find the console commands online. Make sure you run the console at the menu not in game to set. On my PC it was capped at 90 fps. Ran a timedemo at 1.2 seconds and 940fps. Do not have a RasPi yet. Now that I got the OMAP extras up on the Panda Board I want to try Quake3 on it.
Yes, but on the raspberry pi, the fps is capped at 60 fps regardless.
I think 60fps is the max the HDMI outputs. Just out of interest, what benefits are there running the renderer at a higher FPS than the display?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
usbspyder
Posts: 6
Joined: Wed May 30, 2012 8:45 pm

Re: Quake 3 Arena at 60 FPS

Sat Jun 02, 2012 3:51 pm

Running Debian squeeze, debian6-19-04-2012.

Needed to do a bit more to get it all compiled up, history follows. Just the getting of git was missing on squeeze.

Did take about an hour to compile. I did all this as the pi user, including running it at the end. Was only getting about 20fps. I couldn't use the given cfg files, pi complained with out of memory.

Guess i should of spotted the Running as non-root was a hyper-link !

history :

Code: Select all

  311  sudo apt-get install git
  312  sudo apt-get update
  313  sudo apt-get install git
  314  git clone https://github.com/raspberrypi/quake3.git

zomzilla
Posts: 42
Joined: Wed Nov 16, 2011 3:04 pm

Re: Quake 3 Arena at 60 FPS

Sun Jun 03, 2012 6:10 pm

just to confirm: the extra FPS is just for Benchmark purposes?

because on any system, the fps is optimal when it matches the rate the monitor is refreshing (often 60Hz)
so you wont gain anything from the extra FPS

User avatar
simonlc
Posts: 31
Joined: Wed May 16, 2012 4:11 am
Location: Calgary, AB
Contact: Website

Re: Quake 3 Arena at 60 FPS

Sun Jun 03, 2012 10:27 pm

jamesh wrote:
simonlc wrote:
Lob0426 wrote:Quake 3 has a cap on fps. You can find the console commands online. Make sure you run the console at the menu not in game to set. On my PC it was capped at 90 fps. Ran a timedemo at 1.2 seconds and 940fps. Do not have a RasPi yet. Now that I got the OMAP extras up on the Panda Board I want to try Quake3 on it.
Yes, but on the raspberry pi, the fps is capped at 60 fps regardless.
I think 60fps is the max the HDMI outputs. Just out of interest, what benefits are there running the renderer at a higher FPS than the display?
HDMI doesn't have a 60fps limit. Also, many displays are capable of more than 60hz. As for the other benefits? You jump higher. Basically higher fps = smoother gameplay.
zomzilla wrote:just to confirm: the extra FPS is just for Benchmark purposes?

because on any system, the fps is optimal when it matches the rate the monitor is refreshing (often 60Hz)
so you wont gain anything from the extra FPS
Well right now the game just doesn't feel smooth, The fps does drop, it's not stable at 60fps. I'm more interested in getting higher fps out of the raspi, though it would be mad if the game didn't drop below 60fps.

Also w/e you said afterwards couldn't be more false. When you watch a video on your PC, it's more than likely going to be at 25 or 30fps, and it doesn't look any worse than if you ran the video at 60fps on a 60hz monitor. The only negative thing that can happen is if your frame rate is higher than the displays refresh rate. This might cause 'screen tearing' which might be noticeable to some or not. This is why vsync exists, though it just so happens to be the worst thing to have on when playing competitively. I explained above why you might want to have a higher fps, you might think this only applies to older games, but many new ones have this limitation as well.

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: Quake 3 Arena at 60 FPS

Sun Jun 03, 2012 11:16 pm

The extra FPS just gives you an Idea of the ability of the video to maintain the desired FPS which in my opinion should not be set exceed the maximum refresh rate of your monitor.(and should not be a problem for any of the current X86 machines but may be a concern on the Raspi)

To be quite truthful the Raspi is running quake 3 better than some of the X86 machines did when quake 3 originally came out. LOL very sad but very true.

My current system (which came from Lob0426 LOL) can attain 800 plus FPS in Quake3 but my current game monitor (again Lobo) is maxed at 75 @1440X900 so I vsync and let it manage the frame rate and not worry about the max capable. (in this case I would be rendering 11+ FPS for every frame that actually was viewable to the monitor) and even at that the FPS monitor in the corner still reaches 90 FPS most of the time.

I can remember the time when I begged for 30FPS and was doing good to get 20 on games like Doom2, Wolfenstein, Etc.(128K or 512K of video memory then was a lot with a 33mhz CPU)

I wish I was more competent to solve the sound issue as I think that is probably more of a deal breaker at this point than it rendering 100 FPS (OHH AHH)

With that said the smoother it runs the nicer it will be to play so I still thank those of you that are working this arena(pun intended) of the performance issues.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

bbb
Posts: 55
Joined: Sat Jun 02, 2012 9:52 am

Re: Quake 3 Arena at 60 FPS

Mon Jun 04, 2012 11:28 am

OK after some playing about I found a tweeked version of 'high speed' config from http://www.planetquake3.net/tweak/tweaked_configs.html to be best compromise between FPS and quality, Single player Q3 demo gets between 30-60fps on all the maps.

The only changes I have made is to turn on simple items (cg_simpleItems "1") which adds ~10 fps.

I found the 'max speed' configuration with the HUD enabled (cg_draw2D "1") not be any faster, but is attached if you want to try it :) it looks pretty ugly.

Some of the settings are only applied when you restart quake3, so you need to do 'exec highspeed.cfg', restart quake and do exec 'highspeed.cfg' again and make sure the 'autoexec.cfg' is empty so doesn't undo some of the config tweeks.
Attachments
q3gfx_config.zip
High and Max speed Q3 configs
(1.66 KiB) Downloaded 507 times

User avatar
simonlc
Posts: 31
Joined: Wed May 16, 2012 4:11 am
Location: Calgary, AB
Contact: Website

Re: Quake 3 Arena at 60 FPS

Mon Jun 04, 2012 6:43 pm

You don't need to restart quake, you can just type 'vid_restart'.

Hoax
Posts: 10
Joined: Sat Jun 02, 2012 9:30 am
Location: Germany

Re: Quake 3 Arena at 60 FPS

Mon Jun 04, 2012 7:34 pm

When I try to join a game I get an error message:

user interface is version 3, expected 6

Copied the .pak files 1-8 from my local Quake 3 dir (pr 1.32 already installed), so I'm not using any demo files etc.

The compilation was successful without any error.

Any ideas?

User avatar
simonlc
Posts: 31
Joined: Wed May 16, 2012 4:11 am
Location: Calgary, AB
Contact: Website

Re: Quake 3 Arena at 60 FPS

Mon Jun 04, 2012 7:58 pm

Hoax wrote:When I try to join a game I get an error message:

user interface is version 3, expected 6

Copied the .pak files 1-8 from my local Quake 3 dir (pr 1.32 already installed), so I'm not using any demo files etc.

The compilation was successful without any error.

Any ideas?
1-8? You also need pak0.pk3

Hoax
Posts: 10
Joined: Sat Jun 02, 2012 9:30 am
Location: Germany

Re: Quake 3 Arena at 60 FPS

Mon Jun 04, 2012 8:01 pm

Sorry, typo :D I meant 0-8

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Quake 3 Arena at 60 FPS

Tue Jun 05, 2012 3:57 am

jamesh wrote:
simonlc wrote:
Lob0426 wrote:Quake 3 has a cap on fps. You can find the console commands online. Make sure you run the console at the menu not in game to set. On my PC it was capped at 90 fps. Ran a timedemo at 1.2 seconds and 940fps. Do not have a RasPi yet. Now that I got the OMAP extras up on the Panda Board I want to try Quake3 on it.
Yes, but on the raspberry pi, the fps is capped at 60 fps regardless.
I think 60fps is the max the HDMI outputs. Just out of interest, what benefits are there running the renderer at a higher FPS than the display?
Really nothing gained above 30 FPS. it is good for optimizing the performance on a computer of Quake3. My current system runs it at 940 fps but it starts hitching for an unknown reason. Have reduced the resolution and changed other things still same problem. Should not be happening on an i7-2600 with a 1GB video card.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

User avatar
simonlc
Posts: 31
Joined: Wed May 16, 2012 4:11 am
Location: Calgary, AB
Contact: Website

Re: Quake 3 Arena at 60 FPS

Tue Jun 05, 2012 4:03 am

Lob0426 wrote:
jamesh wrote: I think 60fps is the max the HDMI outputs. Just out of interest, what benefits are there running the renderer at a higher FPS than the display?
Really nothing gained above 30 FPS. it is good for optimizing the performance on a computer of Quake3. My current system runs it at 940 fps but it starts hitching for an unknown reason. Have reduced the resolution and changed other things still same problem. Should not be happening on an i7-2600 with a 1GB video card.
Have you tried playing at 30fps vs 120fps on a 120hz monitor? lol

User avatar
Robert_M
Posts: 211
Joined: Fri Nov 25, 2011 12:50 am

Re: Quake 3 Arena at 60 FPS

Thu Jun 07, 2012 9:14 am

simonlc wrote:... The only negative thing that can happen is if your frame rate is higher than the displays refresh rate. This might cause 'screen tearing' which might be noticeable to some or not. ...

O.T. I never knew this phenomenon had a name. I noticed it, yes, but thought it was just something you had to put up with. After reading your comment, I re-set the screen refresh rate on my old monitor and... no more "tearing." Thanks!
I sometimes ride my Pi to the Forum.

rmm200
Posts: 259
Joined: Sat Mar 03, 2012 10:25 pm

Re: Quake 3 Arena at 60 FPS

Fri Jun 08, 2012 11:50 pm

I have a compile problem that I am surprised no one has reported.
After many compiles, it turns up a missing header file:
/opt/vc/include/interface/vcos/vcos_types.h:28:33: Error: vcos_platform_types.h: No such file or directory

I have tried git cloning to a different directory; same error occurs so I think my download is good.
This is the most recent debian squeeze(well April), followed by rpi_update and upgrade.

Any ideas?

rmm200
Posts: 259
Joined: Sat Mar 03, 2012 10:25 pm

Re: Quake 3 Arena at 60 FPS

Sat Jun 09, 2012 12:29 am

Can't edit my last post - but I should mention vc is video core - Broadcom interface files. Guessing the most recent iteration of the private glob (blob?) changed things.

marqs
Posts: 212
Joined: Sat Jun 09, 2012 11:34 am

Re: Quake 3 Arena at 60 FPS

Sat Jun 09, 2012 11:38 am

by rmm200 » Sat Jun 09, 2012 2:50 am
I have a compile problem that I am surprised no one has reported.
After many compiles, it turns up a missing header file:
/opt/vc/include/interface/vcos/vcos_types.h:28:33: Error: vcos_platform_types.h: No such file or directory
Add "-I../firmware/opt/vc/include/interface/vcos/pthreads" (without quotes and with correct path) to build.sh after -I$INCLUDE_DIR to fix that.

rmm200
Posts: 259
Joined: Sat Mar 03, 2012 10:25 pm

Re: Quake 3 Arena at 60 FPS

Sat Jun 09, 2012 2:33 pm

marqs wrote: » Sat Jun 09, 2012 2:50 am

Add "-I../firmware/opt/vc/include/interface/vcos/pthreads" (without quotes and with correct path) to build.sh after -I$INCLUDE_DIR to fix that.
[/quote]

Thanks! That got me going. For the base Debian squeeze the path is -I/opt/vc/include/interface/vcos/pthreads.

Copying files to a quake3arena, I found I did not need to set up a lib directory. Quake found sdl OK on its own.

Looks great - very playable. Now I really want sound... I know sound is not supported yet, but we are also missing all the .wav files. Where can those be found?

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Quake 3 Arena at 60 FPS

Sun Jun 10, 2012 4:31 pm

Hi,
I seem to get errors (or warnings) all the way through the build. Not sure what to expect or exactly which files are meant to be in each directory.
Anyway it stops part way through with a fatal error - GLES/gl.h: no such file or directory compilation terminated.

?????
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Return to “General discussion”