Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A shell script to improve Quake3 performance Apps
I just updated my copy of Quake III to go with Mac OS X on my TiBook (odd that it was installed for six months but not for OS X...), and I wanted to get better performance out of it. So I made the following shell script. i used this tip to make it launchable under the finder and this tip to make it renice without prompting for a password. Lastly, to put finishing touches on it, I put the Quake III icon on to my shell script, called "run Quake III.command�
cd /path/to/
ps -ax | grep Quake3 | grep -v grep
sudo renice -20 -p `ps -ax | grep Quake3 | grep -v grep | cut -c1-5`
Read the rest of the article for a sample Quake3 config file that may help further increase your framerates...

The last thing I did was to create an autoexec.cfg in my baseq3 folder and add the following commands:
seta r_picmip "2" // default:1 // Mipmap level of game textures, the higher the number, the blurrier things get, the faster the FPS
s_chunksize 2048
seta com_hunkMegs "180" // default:56 // 56 is if you only have 64 MB, more needs extra memory!
seta com_soundMegs "18" // default:8 // see above with sound
seta com_blood "0" // default:1 // Show blood, when 0 no blood, better performance
seta cg_gibs "0" // default:1 // Renders gibs (heads, arms, legs...), when 0 no gibs, better performance

// because i run off a TiBook, i want Quake III to fill the screen!

seta cg_fov "110" // default:90 // Regular field of vision (not zoomed in)
set r_customaspect "1"
set r_customwidth "720" // default:? // or you can use 896, or 1152
set r_customheight "480" // default:? // or you can use 600, or 768
set r_fullscreen "1"
set r_mode "-1" // Default: 3 // Resolution, -1 means use settings above
Using these settings, I get much better performance in Quake III on my TiBook than I would otherwise, although since I'm running on a Rage 128, performance still sucks! And yes I know that I can put all the autoexec parameters onto the ./quake3 line of the shell script, but I like things to be modular. In reality, I have an autoexec.cfg that executes five OTHER .cfg files! :D

BTW, The shell script is also customizable so that you can go straight into your mods! I don't recall how that is done though.
  • Currently 3.00 / 5
  You rated: 1 / 5 (4 votes cast)

A shell script to improve Quake3 performance | 11 comments | Create New Account
Click here to return to the 'A shell script to improve Quake3 performance' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
more info on customization?
Authored by: epowell on Jan 18, '02 01:04:37AM

oh man, the thing that really peaked my interest here is the possiblilty of launching a q3 mod through the script!

hes hints "BTW, The shell script is also customizable so that you can go straight into your mods! I don't recall how that is done though."

anyone know about this? i would love to be able to do it!!!!!!!!


[ Reply to This | # ]
q3a scripts
Authored by: brett_ on Jan 18, '02 12:38:23PM
finally, something i can help on. re: launching qe3 straight into a mod. this applescript launches me straight into urban terror:
tell application "Terminal" do script with command "'/Applications/Games/Quake3/ /MacOS/Quake3' +set fs_game q3ut2" end tell
obviously, if you want to launch into a different mod, change "q3ut2" to the acronym for your mod. i dunno where to find a web list of mod acronyms offhand. but it *might* just be the name of the mod's directory. or you can look at the acronyms used by only mortal -- the best osx q3a server browser to date. finally, here's an example of launching a command line dedicated server:
tell application "Terminal" do script with command "/Applications/Games/Quake3/Q3DedicatedServer -RetailInstallationPath /Applications/Games/Quake3 +cvar_restart +set com_hunkmegs 30 +set net_port 29099 +set vm_game 2 +set dedicated 2 +set g_gametype 3 +set gamename Q3UT2 +set fs_game q3ut2 +map ut_sliema +exec utserver.cfg" end tell
this is an example that works -- but may not be the best for your setup. research the variables for your own needs. good luck. N.B.: all code broken for ubb purposes. everything between the "tell" and "end" lines should be one contiguous line. brett.

[ Reply to This | # ]
forgot to add . . .
Authored by: brett_ on Jan 18, '02 12:45:58PM

that these examples are for applescripts -- i'm trying to merge the principles of the shell script here with my applescript. perhaps hes nikke will beat me to it.


[ Reply to This | # ]
i think this should do
Authored by: brett_ on Jan 18, '02 02:38:12PM
again, i used applescript -- and no need to use sudo visudo.
tell application "Terminal" do script with command "'/Applications/Games/Quake3/ /MacOS/Quake3' +set fs_game q3ut2" do shell script "ps -ax | grep Quake3 | grep -v grep" do shell script "renice -20 -p `ps -ax | grep Quake3 | grep -v grep | cut -c1-5`" password "youradminpassword" with administrator privileges end tell
(the lines "tell" "do" & "end" are single lines, all others have been broken.) to get this script to work, just plug in your adminpassword, your path to q3a, & set your desired mod acronym. save as run-only to protect your password from prying eyes. this may not be the cleanest script, but it works. please suggest improvements. brett.

[ Reply to This | # ]
grab a copy of the script here
Authored by: brett_ on Jan 18, '02 03:18:51PM

[ Reply to This | # ]
Better way to do the crucial line
Authored by: Anonymous on Jan 18, '02 08:14:32PM

Here's a better way to do the key line of the shell script:

sudo renice -19 -p `ps -ax | grep Quake3 | awk '{print $1}'

Using grep twice is a crime. Using cut to display only one field of a line is a minor offense.

BTW, I have a command (pid) which is basically ps -auxc | grep $1 | awk as above - great for backquoting into kills and such.

In fact I just realized I should just do sudo renice -19 `pid Quake3`.

Oh, and setting a process to -20 is a REALLY bad idea - it means the entire system is locked up while the front app runs. Yes, you say, but that's what we want, just like on OS 9. Wrong - this is Unix. Background stuff happens that NEEDS to happen by itself. Interfering with that is asking for trouble. Just go with -19.

[ Reply to This | # ]
done and done
Authored by: brett_ on Jan 19, '02 01:57:59AM

thanks alot for the grep tip. i incorporated it. also, i used "property" lines so people can insert their own preferences easily -- path, mod, pwd, cfg & renice value. again, the script is on my homepage:


[ Reply to This | # ]
Better way to do the crucial line
Authored by: iv on Jan 19, '02 02:59:48AM

Yes, and remember that AWK is just a glorified version of grep, so we can save a process by using pattern matching in AWK:

sudo renice -19 -p `ps -ax | awk '/Quake3/ {print $1}' `

These unix-oneliners give Applescript just the power it used to lack in Mac OS 9; thanks for brett_ et al. for showing me the way to go!

BTW, for more on 'using grep twice is a crime' see, e.g.,


[ Reply to This | # ]
Better then Better way to do the crucial line
Authored by: sing on Aug 27, '04 10:15:15AM
Why you use grep?

sudo renice -19 -p `ps -ax | grep Quake3 | awk '{print $1}'

Why not use command like this:
sudo renice -19 -p `ps -axw | awk 'match($5,"Quake3") {print $1}'

sumimasen. anatano Lisa... japanese is not supported :-(

[ Reply to This | # ]
Authored by: Algorythmn on Jan 23, '02 12:36:24AM

This not only sped Quake up, but it also solved my intermittent lock-up (the dreaded "Awaiting Snapshot..."-hang)!!!

And I only used a modest -15 ...

[ Reply to This | # ]
renice -10
Authored by: Hes Nikke on Jan 25, '02 11:45:21PM
after some more testing, i've found that renice -10 gets even better results then -20! the mouse is more responsive, and the frame rates are a little higher still. a friend of mine also recommended that i set my com_maxfps to something just below my average FPS, and that smoothes things out more. my TiBook is now set to 25 FPS as a max (rather then the 180) as usual, a little experimentation helps.

[ Reply to This | # ]