Prey Tweak Guide

[Page 8] Advanced Tweaking



Prey is based on the highly advanced Doom 3 engine. Therefore it has a very solid and reliable engine with plenty of tweaking potential. The last section was all about how to change the easily-accessible in-game settings; this section is all about getting into advanced tweaking. Note that much of this section is derived from the Advanced Tweaking sections of my Doom 3 Tweak Guide and Quake 4 Tweak Guide, since most of the commands are exactly the same in Prey. However I have removed Doom 3 commands which do not work in Prey, and have added several commands which are unique to Prey.


Click to enlarge

Using the Advanced Tweaks


The most common mistake made in tweaking Prey is to quickly apply a range of tweaks without knowing what exactly they do, so if you're new to tweaking the Doom 3 engine, read this section carefully and pay close attention to the descriptions of how tweaks are applied and what they do. Please do not contact me asking for additional help in applying these tweaks as I simply don't have the time to provide personal tweaking or tech support - everything you need to know to make the tweaking of Prey work is right here. If you've already done some tweaking for Doom 3/Quake 4, then the methods used are exactly the same, so you can pretty much skim through this information.


There are two main ways in which you can access and alter command variables in Prey - through the Console and through .cfg (Config) files. To save time in this guide, I detail all the major commands one by one in the next section, and you can then decide the method to use to implement particular ones. The methods are essentially interchangeable, meaning changing the variable using one method has the same impact as doing it another way - the only difference is which is more convenient for you. Once you're familiar with the various methods, see the 'Which Way is Best' section at the bottom of this page for my opinions of how best to apply tweaks.


The Prey Console


The console is the closest you can get to having direct real-time access to the Doom 3 engine powering Prey. Through the console you can enter commands to change engine variables during the game. To open the console, start Prey and then press the CTRL, ALT and ~ keys together. You will see the console come down, and you can enter text at the command prompt. A list of commands you can enter are covered in the next section. To make regular access to the console easier, enter the following line into the console:


seta com_allowconsole 1


This means that you can now open and close the console by simply pressing the '~' key (the key above TAB), and not three keys at once. Note that the best way to make this and many other settings "stick", i.e. remain enabled even after quitting and restarting Prey, you will need to insert it into a Config file, or in the game icon's Target line, both of which are covered below.


Prey Config Files


Although you can alter many variables by entering them into the console, most command variables need to be set each and every time you start Prey. This is because the game engine resets these variables to their default state as the engine initializes at startup. By default, when the game engine starts, it automatically detects the presence of, and runs the command variables from two specific files: Preyconfig.cfg and Autoexec.cfg. Preyconfig.cfg already exists in your \Program Files\Human Head Studios\Prey\base directory, and you can edit it using a text editor like Windows WordPad or Notepad. However changing some of the settings in Preyconfig.cfg will see them reset to default values again the next time you restart Prey. So the best thing to do is create a new text file, rename it to Autoexec.cfg (not Autoexec.cfg.txt) and place it in your \Program Files\Human Head Studios\Prey\base directory. You can now enter all your custom tweaks and settings into this file, and they will come into effect automatically each and every time you start Prey. This makes it easier to keep track of what you have tweaked, and if at any time you want to remove all your tweaks, you can simply delete this Autoexec.cfg file, or see which commands need to have their values manually reset to the default.


Note that there is another way of executing a config file, and that is to firstly create a config file with any name you wish, e.g. MyTweaks.cfg, place it in the \Program Files\Human Head Studios\Prey\base directory, and then in the Prey console at any time type:


exec MyTweaks.cfg


This will run all the command variables in your new .cfg file, however unless you actually execute this file it will not be automatically run at startup time - only Preyconfig.cfg and Autoexec.cfg are automatically detected and run by Prey.


Prey Icon Commands


There is one more way you can run command variables for Prey - enter them as part of the command line for the Prey icon. To do this, first right-click on the icon you use to launch Prey, and then select Properties. In the Target box, you will see something similar to this (it varies depending on where you installed the game):


"C:\Program Files\Human Head Studios\Prey\Prey.exe"


You can add command variables to the end of this line by using a space and then a '+' sign in front of each command. For example, to allow easy access to the console each time you start Prey, change the target line to the following:


"C:\Program Files\Human Head Studios\Prey\Prey.exe" +set com_allowconsole 1


Note that there are quotes around the target to the Prey.exe file, but after that, simply add a space and then a plus sign before each command. Another example is provided below with three separate commands:

"C:\Program Files\Human Head Studios\Prey.exe" +set com_allowconsole 1 +disconnect +set r_gamma 1.3


This means that every time I use this icon to launch Prey, it changes my console to one-key access using the '~' key (+set com_allowconsole 1), skips any introductory movies (+disconnect), and changes my gamma from 1.0 to 1.3 (+set r_gamma 1.3). Note the spacing - none between the plus signs and the command, but a single space between each separate command.


So Which Way Is Best?


Now you know the different ways to apply command variables in the Prey engine, as I mentioned before, there is no single 'best' way. Each method works, it just depends on what you find more convenient. I personally prefer to place all my tweaks in a single Autoexec.cfg file, because that way I can see at a glance all the settings I've changed, and if need be I can remove the file (e.g. for troubleshooting purposes), or change each setting back to default. I can also easily back up this file so I can quickly reapply the same tweaks if ever I reinstall Prey, or if my settings are lost after I patch the game.


However, I suggest that you first use the in-game console to try some commands and see what effect they have on the game, and then you can insert them into your Autoexec.cfg file once you've determined if they're worth using, and which values work best for you. Furthermore, some commands are only really useful if used in the console - for example the recorddemo command records a custom demo...not something you want to have in your Autoexec.cfg file. Also note that certain commands don't come into effect until the game is restarted (or just use the vid_restart command - see the Advanced Tweaking section), so you will have to experiment by placing those in your Autoexec.cfg first, see what they do, and then decide whether to keep them or not.


Note again that some commands require that you manually change them back to their original setting. Just removing them from your config files will not necessarily remove them. Remove them from your relevant config file, and then when you next start Prey, type just the command name in the console and see its current value. If it's not the value you want, change it in the console, or insert it with a new value in your autoexec.cfg file.


Important:, if you are going to edit Preyconfig.cfg directly, first make a backup of the file so that should something go wrong you can restore the file to its original state. Also, some people recommend that you make changes to Preyconfig.cfg and then make the file read only to prevent the game from erasing/resetting some of the changed settings. I personally don't recommend this, as Prey needs to have write access to Preyconfig.cfg file so that for example when you change one of the in-game settings or a key binding, it can record the change in that file.



The next section provides a list of all the game's most useful commands/command variables (cvars) along with descriptions.