Prey Tweak Guide
[Page 9] Advanced Tweaking (Pt.2)
This section lists all the major Prey commands and command variables (cvars) by general function, and provides descriptions and recommendations for the important ones. This list is by no means exhaustive, since there are literally over a thousand different commands and command variables for Prey. You can download the full list of Prey commands and cvars from here: PreyCommands.zip (20Kb) and have a look through it at your leisure.
Config and Console Usage: In the Prey/Doom 3 engine, when you want to use a command - whether in a config file or in the console - you can simply type the name of the command, and then any values or parameters (if required), however you must place exactly one space after the command and any following value or parameter. E.g: r_displayrefresh 85. You don't have to use "" (quotes) around the value, nor do you have to use the Set or Seta command in front of them.
Set and Seta In Front of Commands: You will see in certain places, like the Preyconfig.cfg file, that a command is prefaced with the words Set or Seta. You can also insert these in front of your commands in the console or config file, however they aren't absolutely necessary for a command to work. The Set command is used to tell the game engine to set a cvar to a particular value. Seta is more useful in that it tells Prey to set the cvar value, and then archive it (store it). Don't use Seta unless you want a value to 'stick', as it will remain there until you either manually change its value again and/or restore a previous Preyconfig.cfg backup.
Current and Default Values: If at any time you want to see the currently used value for a command variable, open the console and type the name of the variable without a value. For example, type r_displayrefresh and you will see the current value for this variable on your system, and importantly you will also see the default value. There are different defaults for many of the commands depending on your particular system hardware configuration; that's why I don't provide defaults here - they vary based on each system.
Note: if you can't remember the exact name of a command, type the first letter(s) of it in the console and then press the TAB key - the console will show you all commands beginning with the same letter(s). So for example to see all the render varilables, I can just type r_ in the console and press TAB to see them all (note you can use the mouse scroll wheel or the PgUp and PgDn keys to scroll up and down the console display).
The following is a list of all the major commands for Prey, grouped by function, and with a detailed description. Note that I have tested all of these and they should work for Prey specifically - non-working Doom 3/Quake 4 commands have been removed. However if you have any additions or alterations to make based on your own testing or knowledge, please Email Me. Note further that settings which can be easily and fully changed in the Main Menu of the game will not be covered here (e.g. ui_showgun is the same as the Show Weapon in-game setting) - see the In-Game Settings section for descriptions of those. Also some of the more obscure commands are not very useful to most users (such as a range of developer and debugging commands) and these are not included. Finally, remember that some of these commands are considered cheats, and should not/cannot be used when playing online. This includes commands which dramatically alter the appearance of the game world for example, or alter the movement or weapon characteristics.
com_showFPS [0,1] - If set to 1, shows the current frame rate in Frames Per Second (FPS) at the top right of the screen. If set to 0, disables the counter.
com_allowConsole [0,1] - If set to 1, allows the command console to be opened by using only the '~' key, rather than CTRL + ALT + ~.
bind [keyname, command] - Binds a command to a key. For example:
bind F10 com_showFPS 1
bind F11 com_showFPS 0
Binds the F10 key to the command "com_showfps 1" (which turns on the FPS counter), and the next line binds the F11 key to the command "com_showfps 0" (which turns off the FPS counter). If you want to make a key binding 'toggle', that is pressing the same key turns a command on or off, then use the Toggle command instead, for example:
bind F10 toggle com_showFPS
Now the F10 key alone will turn the FPS counter on and off, which frees up the F11 key.
bindunbindtwo [keyname, command] - Same as bind command, however if the key you want to bind is already being used more than twice, it will unbind it first then bind it to the command you've specified.
unbind [keyname] - Unbinds any existing commands from the single key named.
unbindall - Unbinds any commands from all keys. This command is used most commonly as a starting command before setting bindings, so that you can be sure the keys you are binding are not already in use by another command.
loadGame [savename] - Loads a saved game with the name specified. If no name is specified, loadgame will load the last quicksave.
saveGame [savename] - Saves your current game under the name specified. If no name is specified, saves the game in the first quicksave spot.
editor - Opens the Prey level editor.
editFX - Opens the Prey effects editor.
modView - Opens the Prey model viewer.
echo [text] - Prints the specified text onto the screen.
exec [filename] - Executes the commands in the config filename provided. For example to execute all the commands in a custom configuration file called MyTweaks.cfg, type:
And all the commands in it will be compiled and run.
screenshot - Takes a screenshot and places it in your \Prey\base\screenshots\ directory as a .tga file, similar to using the F12 key.
conDump [filename.txt] - Dumps the entire contents of the console for the current session to the text filename specified and places it in your \Prey\base\ directory.
clear - Clears the console of all text to date. Useful if you want to clear the console before generating specific text (e.g. listcmds) then condump them cleanly.
promptKey - Opens a dialog box which shows your current Prey CD Key and allows you to edit it or enter a new key.
developer [0,1] - If set to 1, enables Developer mode, which allows certain other console commands to work.
devmap [mapname] - Loads a map in Developer mode.
noclip - Toggles clipping on/off. By default clipping is on. When clipping is turned off, you can walk through solid objects, useful for troubleshooting or having fun.
god - Enables God mod, useful for troubleshooting or just having fun.
give - Gives you the relevant item. For example give weapon_autocannon gives you the autocannon gun. The other items you can try to give yourself are: weapon_crawler, weapon_hider, weapon_rifle, weapon_rocketlauncher, weapon_soulstripper, weapon_spiritbow and weapon_wrench. To give yourself ammo for these guns, use the give ammo command.
ai_skipthink - Freezes all artificial intelligence in the game, useful for stopping monsters.
possessPlayer - Takes the viewer to spirit mode and the player is viewed in 3rd person mode running around possessed.
kill - Kills the player.
killMonsters - Kills all monsters.
g_wicked [0,1] - If set to 1 along with g_nightmare, should enable Cherokee mode level of difficulty, but I am uncertain of this.
exit - Immediately exits Prey to the Windows Desktop.
The following commands control the image cache, which if enabled and set correctly can help smooth FPS and also boost performance:
com_precache [0,1] - If set to 1, attempts to load necessary resources beforehand to smooth out performance. Should always be set to 1.
image_useCache [0,1] - If set to 1, uses background loading to cache image information. This may not necessarily improve framerate performance, but it does assist in smoothing out frame rates and reducing loading pauses. Note that the image_cacheMinK (see below) size must be raised from its default otherwise the game will crash when using this setting. Once this setting is enabled, the actual cache value is set in the image_cacheMegs setting below. Note, enabling this setting can cause a crash at the 'Mother's Embrace' chapter of Prey. Set this back to 0 if you experience a crash loading up that chapter.
Update: As of the 1.1 Patch onwards, the crashing issues when using this setting have been resolved. See page 4 for details of the patch.
image_cacheMegs [Megabytes] - Determines the maximum amount of system memory to allocate to temporary loading of full-sized precompressed images if the cache is enabled by setting image_useCache to 1. Since a cache is only a temporary holding area, and not the place where the entire game is meant to reside, do not raise this value to something extremely high as that will simply reduce the available memory for the rest of Prey. Try a value of 128MB for those with 512MB of system RAM, and if you have 1GB or more of RAM, you can try a higher value like 256MB for example. Do not automatically set this to half your system RAM or some monstrous amount.
image_cacheMinK [KiloBytes] - This setting determines the minimum size in KB for precompressed image files to be loaded into the cache. To make sure most image files can be loaded, and to also prevent a system crash when enabling caching, select a value like 3072 to start with. Raising this setting may improve caching, but it may also hinder caching if most textures are below the size you specify, so don't just raise this value for the hell of it.
r_brightness [value] - Determines the overall brightness for the game. You can adjust this using the slider in the main options menu (See In-Game settings), however if you want to fine tune it you can do so here. Has no performance impact.
r_displayRefresh [Hz] - Determines the refresh rate used when Prey is launched. You should already be getting the maximum refresh rate possible on your monitor when playing Prey through the use of a refresh rate fix (See my ATI Catalyst Tweak Guide or my Nvidia Forceware Tweak Guide for a link and instructions), however if you want to set this manually, determine the supported maximum refresh rate on your monitor for the resolution you've chosen for Prey, and set this variable to that value.
r_multiSamples [0,2,4,8,16] - This setting determines the level of Antialiasing samples used. This can be set using the in-game menus (See In-Game Settings section). The numerical values here are 0 which is no antialiasing, 2, 4, 8 and 16.
image_anisotropy [1,2,4,8] - This setting determines the level of Anisotropic Filtering used in Prey, and again can be set using the in-game menus. Valid values are 1, 2, 4, and 8. Note that 1 is the lowest you can set for Anisotropic - 0 will simply default back to 1. Also note that if you have forced Anisotropic Filtering in your graphics card's control panel, it will override this setting, so for optimal performance set the Anisotropic Filtering level in your control panel to 'Application Preference', and adjust the level here.
image_filter [GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR] - Determines the OpenGL texture filtering method to use on textures by default. GL_LINEAR_MIPMAP_LINEAR is Trilinear Filtering, however if you want a performance boost without any noticeable image quality loss, change this setting to GL_LINEAR_MIPMAP_NEAREST which is Bilinear Filtering.
r_customHeight [pixels] - Sets a custom screen height in pixels. The r_mode command must be set to -1 to allow this to work.
r_customWidth [pixels] - Sets a custom screen width in pixels. The r_mode command must be set to -1 to allow this to work.
r_mode [-1,3,4,5,6,7,8] - This setting determines the resolution, as set in the in-game menus under Screen Size (See In-Game Settings section). The mode values are -1 = Custom (see r_customheight, r_customwidth commands), 3 = 640x480, 4 = 800x600, 5 = 1024x768, 6 = 1152x864, 7 =1280x1024 and 8 = 1600x1200.
com_videoRam [MB] - Shows the detected amount of video memory on your graphics card in MB. If this value is incorrect, set it to the correct value to improve performance.
cm_backFaceCull [0,1] - If set to 1, removes all polygons behind the direction the player is facing - that is, all the things the player cannot see. This can noticeably improve performance without any image quality loss, but if you experience any visual anomalies or increased loading pauses when entering new areas, set this back to 0. Note it's cm_backFaceCull, not com_backFaceCull.
com_purgeAll [0,1] - If set to 1, discards all data between level loads. Can increase loading times noticeably but may help reduce in-game pauses on systems with less System RAM/Video RAM.
com_fixedTic [0,1] - If set to 0 (the default) Prey's ticrate is capped at 60, meaning the game framerate cannot exceed 60FPS. If you want to remove this cap, set com_fixedTic to 1, but this causes the game physics to go out of sync. Note, com_fixedTic -1 is no longer supported in recent builds of the Doom 3 engine.
r_orderIndexes [0,1] - If set to 1, reorganises indexes to optimize vertex use. This improves rendering performance.
r_usePortals [0,1] - If set to 1, uses portals to perform area culling, otherwise everything is drawn. Setting this to 1 provides the best performance.
r_useOptimizedShadows [0,1] - When set to 1, uses the dmap generated static shadow volumes, which provides optimal performance.
r_lightScale [value] - All light sources are multiplied by this value. Increasing this value increases the intensity of all visible light sources. Basically it makes light sources brighter the higher the value.
r_skipDiffuse [0,1] - If set to 1, disables diffuse lighting. This improves performance, but also darkens areas where such lighting is used since no lighting is used to replace the removed diffuse lighting.
r_skipUpdates [0,1] - If set to 1, lighting is not updated, meaning all lighting will become static (fixed direction and intensity). This can improve performance significantly, but reduces realism.
r_skipDeforms [0,1] - If set to 1, any material which can be deformed will remain in its original state.
r_skipFogLights [0,1] - If set to 1, disables all fog lights which can improve performance.
r_skipTranslucent [0,1] - If set to 1, disables translucent rendering, which can improve performance (but reduce realism) in such areas.
r_skipInteractions [0,1] - If set to 1, disables all light interactions with surfaces, effectively making almost all surfaces black.
r_skipMegaTexture [0,1] - If set to 1, uses only the lowest level images. This improves performance at the cost of lower image quality for some surfaces.
r_skipGuiShaders [0,1,2,3] - If set to 1, this removes all Graphical User Interfaces (GUIs) in the game (i.e. computer terminals, security screens etc.), if set to 2, GUIs aren't drawn but they can still be interacted with, if set to 3 they will be drawn, but cannot be interacted with. These settings can improve performance but obviously reduce playability.
r_useShadowCulling [0,1] - If set to 1, tries to remove shadows from partially visible lights. This provides optimal performance.
r_useLightCulling [0,1,2,3] - Determines the light culling method. 0 is no culling, 1 is box culling, 2 is the exact clip of polyhedron faces, and 3 also includes areas. This should be set to 3 for optimal performance. Other methods can reduce visual anomalies with lighting but will reduce performance.
r_useCulling [0,1,2] - Determines the object culling method. 0 is no culling, 1 is sphere culling and 2 is sphere and box culling. Setting this to 2 provides optimal performance, but other methods can be tried to reduce visual anomalies.
r_renderer [best, arb, arb2, cg, exp, nv10, nv20, r200] - Determines the rendering path to use. Some renderers can't run on certain hardware - for example cg is an Nvidia rendering language and can't run on ATI cards. You can experiment with these to see which is best on your system, however the best option should be set for most.
r_ignoreGLErrors [0,1] - This setting should be set to 1 to ignore OpenGL errors. Most people will have one or two OpenGL errors throughout the game, and these don't seem to affect gameplay.
r_znear [value] - This setting determines the distance at which z-buffer clipping occurs. The default value is 3, and lower values can result in graphical anomalies for distant objects but improve performance, while higher values may help reduce any z-buffer graphical anomalies, but may reduce performance.
r_useInfiniteFarZ [0,1] - If set to 1, this uses the no-far-clip-plane trick which provides optimal performance.
r_useStateCaching [0,1] - This option should be set to 1 for optimal performance, as it caches OpenGL state changes.
r_useIndexBuffers [0,1] - If set to 1, uses ARB_vertex_buffer_object for indexes. This can actually reduce performance, so set to 0.
r_useVertexBuffers [0,1] - If set to 1, uses ARB_vertex_buffer_object for vertexes, which improves performance.
r_useCachedDynamicModels [0,1] - If set to 1, uses cache snapshots of dynamic models which improves performance.
r_useTwoSidedStencil [0,1] - If set to 1, optimizes the processing of stencil shadows.
r_useTurboShadow [0,1] - If set to 1, uses the infinite projection with W technique for dynamic shadows which improves performance without a noticeable drop in image quality.
r_useShadowVertexProgram [0,1] - If set to 1, does the shadow projection in the vertex program on graphics cards with this capability. If you set this to 1 and experience problems or a crash, it is because your graphics card does not support this functionality.
r_useShadowProjectedCull [0,1] - If set to 1, removes polygons which would fall completely inside shadows, optimizing performance.
r_useTripleTextureARB [0,1] - If set to 1, this allows graphics cards with 3+ texture units do a two pass instead of three pass which improves performance. Set this to 1 and if you experience problems, your graphics card does not support this function.
r_useConstantMaterials [0,1] - If set to 1, this setting uses pre-calculated material registers if possible, improving performance.
r_useNV20MonoLights [0,1] - If set to 1, this option uses optimized rendering for mono lights originally intended for Nvidia NV20 GPUs.
r_useLightPortalFlow [0,1] - If set to 1, this uses a use a more precise area reference determination for lighting. Setting this to 0 improves performance but may result in graphical anomalies.
g_projectileLights [0,1] - If set to 1, allows dynamic lights for projectiles. Setting this to 0 can improve performance in combat.
g_doubleVision [0,1] - If set to 1, shows a blurry "double vision" effect when taking damage. Setting this to 0 removes this effect and can improve performance when taking damage.
g_bloodeffects [0,1] - If set to 0, disables all blood effects and splatters.
g_gravity [x,y,z] - Sets the gravity level of X, Y and Z surfaces and the physics will react accordingly.
g_perfTest_aiNoRagdoll [0,1] - If set to 1, disables the "ragdoll" effect when monsters die, which can slightly improve performance on slower CPUs in heavy combat scenes.
g_perfTest_weaponNoFX [0,1] - If set to 1, disables all weapon effects like muzzle flash, ejecting brass, tracers etc. which can improve performance in heavy combat.
r_jitter [0,1] - If set to 1, creates a jittery effect for everything viewed. Can reduce performance.
g_muzzleFlash [0,1] - If set to 1, shows a flash from the muzzle of weapons that are firing. If set to 0, this effect is disabled, which can improve performance.
g_showHud [0,1] - If set to 1, this enables the Heads Up Display (HUD). If set to 0, this removes the HUD from view, which may give a minor performance improvement. This command is most useful for taking "clean" screenshots (i.e. without the HUD).
g_showPlayerShadow [0,1] - If set to 1, the player will cast a shadow when standing near lights. If set to 0, the player casts no shadow, which improves performance.
g_skipViewEffects [0,1] - If set to 1, removes various view-related special effects like the damage effects (double vision). This can improve performance.
g_fov [angle] - Specifies the angle for the Field of View (FOV). The wider the angle, the larger the field of vision for the player, giving a "fish eye" view in effect, however performance will be reduced. The smaller the angle, the higher the performance. The default of 90 is recommended, but players can try 85 which is a value used in some other games and will gain a slight boost in FPS.
g_skipFX [0,1] - If set to 1, disables certain special effects (I'm unclear on which). This can improve performance.
g_skipParticles [0,1] - If set to 1, disables certain particle effects (does not include smoke, dust, fog effects etc). This can improve performance, particularly in areas which use these effects to a large extent, but realism will be reduced.
image_usePrecompressedTextures [0,1] - When set to 1, all textures will be precompressed, resulting in less video memory being used and hence smoother performance on most machines. There may be some minor compression artifacts on textures, but these are hardly noticeable. If set to 0, this setting will force realtime compression on textures which results in reduced image quality and performance. Note that if this setting is set to 0 and the image_useCompression setting is also set to 0, uncompressed textures will be used for highest image quality, but performance will suffer and you will get more small pauses depending on the amount of Video RAM on your graphics card, so on balance this should be set to 1. Note that setting this option to 0 does not work in the Prey demo, it causes missing textures - it only works in the full version. Note further it can also cause crashes if set to 0, so if this is the case for you, set it back to 1.
image_useNormalCompression [0,1,2] - Specifies the compression method used for textures. 0 disables normal map compression for the highest image quality for textures, 1 is 256 color compression (if available), which gives the best performance but provides the most compression artifacts, while 2 is rxgb compression. When combined with the setting above and below, setting this to 0 provides optimal image quality for minimal performance hit. Note that setting this option to 0 does not work in the Prey demo, it causes missing textures - it only works in the full version.
image_useCompression [0,1] - When set to 1, compression is used - with the method of compression specified in the image_useNormalCompression variable. Compression provides the fastest performance by reducing the size of all textures and light maps, but there are some (minor) compression artifacts. When set to 0, precompressed textures are still used, but realtime compression is not used if image_useNormalCompression and image_usePrecompressedTexures are activated. This results in better image quality, but slower performance particularly during periods when precompressed textures are not used.
image_preload [0,1] - If set to 1, Prey attempts to preload most images in the background, meaning less loading pauses during the game but longer loading times. If set to 0, images are loaded dynamically as needed, meaning more loading pauses during the game. 1 is the recommended setting.
image_lodbias [value] - Determines the Level of Detail (LOD) bias for mipmapped images. The higher the number, the less detail is visible on surrounding objects. This can improve performance, but reduces image quality. The default is 0, and values above 1 reduce detail quite heavily, so experiment with fractional values such as 0.2 or 0.5.
s_force22kHz [0,1] - If set to 1, this forces lower quality (22kHz) audio, which reduces sound quality but can improve performance.
s_numberOfSpeakers [2,4,5,6] - This value shows the actual number of speakers the game has detected, based on your general Windows settings and In-Game settings. You can manually alter this value, however make sure it matches your current speaker setup otherwise you will have missing audio channels.
s_volume_dB [? - 0] - This is the sound effects volume level for the game. You should use the in-game menu volume slider to adjust the sound, but if it is too low or too high you can also adjust it here, though note it is deciBels.
s_musicVolume_dB [? - 0] - This is the music volume level for the game. You should use the in-game menu volume slider to adjust the sound, but if it is too low or too high you can also adjust it here, though note it is deciBels.
s_maxSoundsPerShader [value] - This setting determines the maximum number of sounds to use per shader, that is how diverse the sounds effects are. Increasing this value increases sound variety but also increases memory usage and can reduce performance.
s_clipVolumes [0,1] - When set to 1, this removes sounds which cannot be heard which provides optimal performance.
s_useOcclusion [0,1] - Occlusion is a basic audio method which muffles sounds which aren't clearly heard, such as those behind walls and objects. If set to 0, this method is disabled reducing realism but it may increase performance.
s_useEAXOcclusion [0,1] - If set to 1, the EAX Occlusion effect is used, which is an improved form of occlusion. However if you want to adjust this aspect of EAX separately from EAX Reverb (see s_useEAXReverb), you can individually enable/disable it here.
s_useEAXReverb [0,1] - If set to 1, uses the EAX Reverberation effect, however it can be disabled separately here while still retaining EAX Occlusion effects (See s_useEAXOcclusion).
s_useOpenAL [0,1] - If set to 1, uses the OpenAL sound system which is recommended for most sound cards.
s_noSound [0,1] - If set to 1, disables all sounds. Useful for troubleshooting to see if crashes are due to sound-related issues for example.
The following values control the largest size allowed (in pixels) for textures, lighting and render maps. If downsampling is not enabled, these values make no difference. However if downsampling is enabled, changing the limit values can improve performance by restricting the size of texture, light and render maps. The common values are 256 for 64MB graphics cards, 512 for 128MB graphics cards and 1024 for 256MB graphics cards. You can try lower values for your graphics card to see if loading times and in-game pauses are improved, and judge whether your image quality has fallen or not. Typically smaller sample size limits will result in more pixelated textures and less detailed lighting as textures and lightmaps are resized from their original resolutions to smaller ones.
image_downSizeLimit [pixels] - This setting controls the diffuse light map downsample limit - the largest size in pixels for the diffuse light map. Use 256 for graphics cards with 64MB of Video RAM, 512 for 128MB VRAM and 1024 for 256MB VRAM or above.
image_downSize [0,1] - If set to 1, this puts into effect the downSizeLimit value specified above. If set to 0, textures are displayed at full resolution for highest image quality but lower performance.
image_downSizeBumpLimit [pixels] - This setting controls the bump map texture downsample limit. Use 256 for graphics cards with 64MB of Video RAM, 512 for 128MB VRAM and 1024 for 256MB VRAM or above.
image_downSizeBump [0,1] - If set to 1, this puts into effect the downSizeBumpLimit value specified above. If set to 0, bump mapping on textures are displayed at full resolution for highest image quality but lower performance.
image_downSizeSpecularLimit [pixels] - This setting controls the specular lighting light map downsample limit. Use 256 for graphics cards with 64MB of Video RAM, 512 for 128MB VRAM and 1024 for 256MB VRAM or above.
image_downSizeSpecular [0,1] - If set to 1, this puts into effect the downSizeSpecularLimit value specified above. If set to 0, surface effects on textures are displayed at full resolution for highest image quality but lower performance.
The next page continues the console command listing.