User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: Quake 3 Arena at 60 FPS

Mon Jan 14, 2013 5:42 am

First, keep it cival. Don't call people trolls or accuse them of trolling it is a banable offense. It just pisses people off and causes them to go into defensive mode and then there is kind of a self-fufilling prophecy.

Second, back on topic. The processor in the R Pi shares memory bandwidth with the cpu, gpu, and everything else in the SOC. PCs with dedicated graphics do not share bandwith between CPU/memory and GPU/memory they all have their own. There may be a memory bottleneck. If there is in-fact anti-ailising forced by default that will eat up GPU time and it also eats up some memory bandwidth. Which would explain why lowering resolution dosn't buy many extra FPS. So it would seem that unless there is a way to disable FSAA then it may be hard to reach 60 FPS. It may be worth your while to selectivly overclock and benchmark and just see which parts buy you the best performance. My suspect would be the memory, however, in practice I have had the least sucess overclocking the memory. Some of my boards cap at just 15 mhz over default while others will reach 50 mhz over default.

Please, no more fighting or I will lock this and issue warnings.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Quake 3 Arena at 60 FPS

Mon Jan 14, 2013 11:51 am

Interesting. I had thought that someone had aready turned off antialiasing, my error there.

Once Q3A is compiled with AntiAliasing turned off, then yes it would be worth optimizing. While I admit that I have not looked at the Q3A source specifically, I have looked at other simular products source, and there are likely to be a few tight loops, where saving 30 to 50 clock cycles per iteration will make a huge difference.

Though I would ask: On what operating is Q3A being ran? If the OS is preemptive multiasking this will slow it down quite a bit. On a singletasking system, Q3A could easily have he system resources to it self. On a cooperative multitasking system, Q3A could choose to take a full second or more between tasking, and not causing any trouble.

Unfortunately I do not thik that any one has got the GPU accellerator workng on a singletasking, or cooperative multitasking system yet.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: Quake 3 Arena at 60 FPS

Wed Feb 27, 2013 11:31 pm

simonlc wrote:Seems useless to do that. Instead they should allow to turn AA off, and vsync/frame limit. That will easily give a performance boost, bigger than any hand written assembly code will do. Also instead of optimizing q3, I'd like to see a quake world. That game has a great single player, and single player mods.
I created a patch which disables MSAA and enables r_swapInterval setting (set 0 to disable vsync and cap fps with com_maxfps if you will). You can download the patch here - it's only a couple of lines of code.

The perf is okay in 1vs1 levels at 640x480 - the fps can even top 100 momentarily. On bigger / busier levels the average is still quite low even with minimal settings.

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

Thu Feb 28, 2013 12:13 am

That's awesome dude, thanks for the patch!

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 1:20 am

How is it then that a computer like the RPi that is so much more powerfull in terms of CPU, GPU, RAM speed, and RAM size is running the same game so much slower?
In addition to the other reasons stated, the answer is simple: it cheats http://techreport.com/review/3089/how-a ... -quake-iii

Its not uncommon for PC drivers to have optimized "fast-paths" for prominent games.

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 1:43 am

On embedded platforms such as Pi, one of the most dramatic optimizations you can make is to reduce texture size and thus memory bandwidth. So it may be worthwhile to look into ETC1 compressing textures if this is not already done. Additionally, the GPU on Pi operates differently than PC GPU's so any time spent sorting the scene from front to back as is typically done on PC is wasted. The Pi GPU should be a tile based renderer and has hardware that sorts triangles. Finally, you want to ensure you do not exceed the geometry 'bucket' size as this will force the renderer to split the scene.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5372
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 2:15 am

OtherCrashOverride wrote:On embedded platforms such as Pi, one of the most dramatic optimizations you can make is to reduce texture size and thus memory bandwidth. So it may be worthwhile to look into ETC1 compressing textures if this is not already done. Additionally, the GPU on Pi operates differently than PC GPU's so any time spent sorting the scene from front to back as is typically done on PC is wasted. The Pi GPU should be a tile based renderer and has hardware that sorts triangles. Finally, you want to ensure you do not exceed the geometry 'bucket' size as this will force the renderer to split the scene.
I'm pretty sure when playing Quake the ARM is the bottleneck, and the GPU is relatively idle.
To make Quake go faster you want to profile the ARM code and speed up the hot spots.

Disabling sound (e.g. sudo modprobe -R snd_bcm2835) gives a big speedup.

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 5:02 am

I compiled with profiling enabled and obtained the following:

Flat profile:

Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
19.76 12.51 12.51 3825 0.00 0.00 VM_CallInterpreted
4.96 15.65 3.14 9411860 0.00 0.00 Q_isnan
4.74 18.65 3.00 115256 0.00 0.00 RB_StageIteratorGeneric
3.95 21.15 2.50 3108 0.00 0.00 unzReadCurrentFile
3.93 23.63 2.49 2107960 0.00 0.00 increment
3.27 25.70 2.07 1629 0.00 0.00 etc1_compress_tex_image
2.64 27.37 1.67 25400 0.00 0.00 RB_SurfaceMesh
2.50 28.95 1.58 1332 0.00 0.00 R_RecursiveWorldNode
2.32 30.42 1.47 4215 0.00 0.00 S_PaintChannelFrom16_scalar
2.26 31.85 1.43 345952 0.00 0.00 RB_SurfaceFace
2.10 33.18 1.33 15272 0.00 0.00 RB_SurfaceTriangles
1.66 34.23 1.05 41188 0.00 0.00 RB_SurfaceGrid
1.42 35.13 0.90 5241 0.00 0.00 S_WriteLinearBlastStereo16
1.06 35.80 0.67 1018940 0.00 0.00 R_CullSurface
1.03 36.45 0.65 25670 0.00 0.00 CM_TraceThroughTree
0.93 37.04 0.59 1335 0.00 0.00 S_Base_ClearLoopingSounds

This is a partial listing and I should point out that I do not seem to have sound.

Is there a pre-recorded demo that is being used to benchmark against?

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 5:29 am

Additionally top displays the following:

6210 pi 20 0 265m 65m 4456 R 70.5 17.6 7:23.89 ioquake3.arm
6149 pi 9 -11 151m 5088 3844 S 24.7 1.3 3:14.92 pulseaudio

Even though I do not get sound out of HDMI or audio jack.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5372
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 11:49 am

OtherCrashOverride wrote:Additionally top displays the following:

6210 pi 20 0 265m 65m 4456 R 70.5 17.6 7:23.89 ioquake3.arm
6149 pi 9 -11 151m 5088 3844 S 24.7 1.3 3:14.92 pulseaudio

Even though I do not get sound out of HDMI or audio jack.
Try removing sound module:
sudo modprobe -R snd_bcm2835
and check if the audio disappears from profile.

To enable audio try the amixer cset call from here:
http://elinux.org/R-Pi_Troubleshooting# ... MI_monitor

also removing pulseaudio is probably a good idea.

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 6:04 pm

Here is the compiled quake3 with the changes from marqs:
https://mega.co.nz/#!Mko2ATbB!GGXCQUcDg ... 8ftHIKXzfc

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

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 6:37 pm

kalehrl wrote:Here is the compiled quake3 with the changes from marqs:
https://mega.co.nz/#!Mko2ATbB!GGXCQUcDg ... 8ftHIKXzfc
Thanks! I'll also create a pull request to the original git repo soon.

One thing I noticed is that there seems to be some buffering / syncing taking place in the videocore driver - there should be some tearing when vsync is off but I can't see any.

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: Quake 3 Arena at 60 FPS

Thu Feb 28, 2013 7:14 pm

I just played a couple of rounds with the default

Code: Select all

seta r_swapInterval "0"
and didn't notice anything unusual.

Takenover83
Posts: 166
Joined: Mon Sep 02, 2013 5:39 am

Re: Quake 3 Arena at 60 FPS

Thu Sep 12, 2013 10:39 am

I compiled q3a on Rasbian with the patch above applied.
Download here. Upload/Unpack the files to your pi anywhich way you prefer. I used SCP. Make sure to add your own pak files to the baseq3 directory.

Set Permissions on ioquake3.arm/ioq3ded.arm

Code: Select all

chmod +x Q3A/ioquake3.arm
chmod +x Q3A/ioq3ded.arm
Add user to video group

Code: Select all

sudo usermod -a -G video [your_username]
Launch Quake 3 Arena

Code: Select all

./Q3A/ioquake3.arm
Using config autoexec downloaded from another user (autoexec, high, low, fps config pack) I am getting ~47fps or so on timedemo four. Very playable. We need more games of this quality for our Pi's :D

Bluelightcrew
Posts: 8
Joined: Fri Feb 28, 2014 2:01 pm

Re: Quake 3 Arena at 60 FPS

Sun Mar 23, 2014 10:41 am

I have installed Quake 3 on my Retropie and using it without Keyboard.
But i need the Escape button to exit the game.
Any ideas how i can map the Escape button to the gamepad?

Return to “General discussion”