Console Commands and Variables for All In-Game Options
Quote from Enigmaphase on July 14, 2011, 8:27 pmI haven't seen this information collected anywhere in a reasonably convenient manner, so I'm hoping this can save others the frustration and tedium of trawling the webs for hours in search of this info (if, in fact, there are others searching for this info).
Firstly, Portal 2 options are stored in two places: config.cfg and video.txt, both of which are located in the portal2/cfg directory. Everything in the options menu corresponds to a line in one of these files.
• config.cfg is a list of console commands that runs each time you start portal; it is updated whenever you change an option that is stored in this file. However, the commands are not run from this file, so changing the contents of this file has no effect.
• video.txt contains your video settings, but not in console command form - these settings are also applied each time you start Portal 2 and the file is updated whenever you change a video setting.Additionally, you may create a file called autoexec.cfg in your cfg directory. This file can include any console command and will automatically execute each time you launch Portal 2.
Controls/Binds
As most of you are certainly aware, binds (keyboard/mouse/controller mappings) are assigned through the following console command:
- Code: Select all
bind <key> <action>
The bind command can be used not only to map actions to certain buttons, but in fact to map any console command to any button. Examples include:
- Code: Select all
bind "w" "+forward"
bind "F5" "jpeg"
bind "SHIFT" "record demo_name"All of your binds are listed at the top of your config.cfg file.
Audio Settings
Your audio settings are governed by console commands as well, so they are also saved in the config.cfg file. Here are the commands for each option:• Master Volume - volume "value" - the value varies from 0 to 1 with 0 corresponding to no sound and 1 corresponding to maximum volume
• Music Volume - snd_musicvolume "value" - the value again varies from 0 to 1 in the same manner as above
• Sound Quality - governed by two variables: snd_pitchquality and dsp_slow_cpu
--- High: snd_pitchquality "1"; dsp_slow_cpu "0"
--- Medium: snd_pitchquality "0"; dsp_slow_cpu "0"
--- Low: snd_pitchqualiy "0"; dsp_slow_cpu "1"
--- Note: for snd_pitchqualiy "1"; dsp_slow_cpu "1" options menu still displays "low"Video Settings
Your video settings are governed by the video.txt file located in the same directory as your config.cfg file. Each setting in the video menu corresponds to a value assigned to the respective setting variable in video.txt. Here is a list of settings and their corresponding variables:• Aspect Ratio - setting.aspectratiomode: 0 = 4:3, 1 = 16:9, 2 = 16:10
• Resolution (width) - setting.defaultres: value = width in pixels
• Resolution (heght) - setting.defaultresheight: value = height in pixels
(Note: I'm not entirely sure what happens here if the math doesn't work out - just make sure to enter the numbers you actually want)
• Windowed - setting.fullscreen: 0 = windowed, 1 = full screen
• Window Border - setting.nowindowborder: 0 = border, 1 = no border• Anti-Aliasing - setting.mat_antialias: value = anti-aliasing factor, choose from {1, 2, 4, 8} (not sure what happens if you pick a different value)
• Anisotropic Filtering - setting.mat_forceaniso: value = anisotropic filtering factor, choose from {0, 1, 2, 4, 8, 16}
• Vertical Sync on/off - setting.mat_vsync: 0 = off, 1 = on
• Vertical Sync buffering - setting.triplebuffered: 0 = double buffered, 1 = triple buffered (should be 0 if Vertcal Sync is disabled)
• Multicore rendering - setting.mat_queue_mode: 0 = disabled, -1 = enabled (Valve!?)
• Shader Detail - setting.gpu_level: 0 = low, 1 = medium, 2 = high, 3 = very high
• Effect Detail - setting.cpu_level: 0 = low, 1 = medium, 2 = high
• Model/Texture Detail - setting.gpu_mem_level: 0 = low, 1 = medium, 2 = high
• Paged Pool Memory Available - setting.mem_level: 0 = low, 1 = medium, 2 = highWhat's the point of all this information?
Perhaps you're wondering why the hell I would go to all the trouble to find and post this information. Well, I'll give one scenario of how it may be useful, which stems from my initial motivation to uncover all this info.Let's say you wanted to create two different "settings profiles," one with maxed graphics settings that you would use primarily for recording videos (and occasionally for reveling in the beauty of a particularly well-made map), and another with moderate graphics settings to allow for completely lag-free playing (queue "my godly computer can play every video game in existence at ultra-high graphics settings with 300 fps" responses). Well, this can be accomplished very simply by creating a config file and video file for each of your two "profiles" (say you call them config1.cfg, config2.cfg, video1.txt, and video2.txt). Now, if you want to "load" your settings for "profile 1", simply copy the contents of video1.txt into video.txt and copy the contents of config1.cfg into autoexec.cfg. Now launch Portal 2 and you'll have all your settings that were stored in config1.cfg and video1.txt!
Furthermore, if you're a programmer, you can write a very simple program to do the file copying and/or renaming for you, so that with the (double) click of a button, you can completely change your Portal 2 settings to any "profile" that you have created.
I hope people find all or parts of this useful. If there are other options that I haven't included in here that you would like more information about, let me know. Also, if you have any questions of this nature, feel free to post them here as well.
Now I'm off to actually play some Portal.
I haven't seen this information collected anywhere in a reasonably convenient manner, so I'm hoping this can save others the frustration and tedium of trawling the webs for hours in search of this info (if, in fact, there are others searching for this info).
Firstly, Portal 2 options are stored in two places: config.cfg and video.txt, both of which are located in the portal2/cfg directory. Everything in the options menu corresponds to a line in one of these files.
• config.cfg is a list of console commands that runs each time you start portal; it is updated whenever you change an option that is stored in this file. However, the commands are not run from this file, so changing the contents of this file has no effect.
• video.txt contains your video settings, but not in console command form - these settings are also applied each time you start Portal 2 and the file is updated whenever you change a video setting.
Additionally, you may create a file called autoexec.cfg in your cfg directory. This file can include any console command and will automatically execute each time you launch Portal 2.
Controls/Binds
As most of you are certainly aware, binds (keyboard/mouse/controller mappings) are assigned through the following console command:
- Code: Select all
bind <key> <action>
The bind command can be used not only to map actions to certain buttons, but in fact to map any console command to any button. Examples include:
- Code: Select all
bind "w" "+forward"
bind "F5" "jpeg"
bind "SHIFT" "record demo_name"
All of your binds are listed at the top of your config.cfg file.
Audio Settings
Your audio settings are governed by console commands as well, so they are also saved in the config.cfg file. Here are the commands for each option:
• Master Volume - volume "value" - the value varies from 0 to 1 with 0 corresponding to no sound and 1 corresponding to maximum volume
• Music Volume - snd_musicvolume "value" - the value again varies from 0 to 1 in the same manner as above
• Sound Quality - governed by two variables: snd_pitchquality and dsp_slow_cpu
--- High: snd_pitchquality "1"; dsp_slow_cpu "0"
--- Medium: snd_pitchquality "0"; dsp_slow_cpu "0"
--- Low: snd_pitchqualiy "0"; dsp_slow_cpu "1"
--- Note: for snd_pitchqualiy "1"; dsp_slow_cpu "1" options menu still displays "low"
Video Settings
Your video settings are governed by the video.txt file located in the same directory as your config.cfg file. Each setting in the video menu corresponds to a value assigned to the respective setting variable in video.txt. Here is a list of settings and their corresponding variables:
• Aspect Ratio - setting.aspectratiomode: 0 = 4:3, 1 = 16:9, 2 = 16:10
• Resolution (width) - setting.defaultres: value = width in pixels
• Resolution (heght) - setting.defaultresheight: value = height in pixels
(Note: I'm not entirely sure what happens here if the math doesn't work out - just make sure to enter the numbers you actually want)
• Windowed - setting.fullscreen: 0 = windowed, 1 = full screen
• Window Border - setting.nowindowborder: 0 = border, 1 = no border
• Anti-Aliasing - setting.mat_antialias: value = anti-aliasing factor, choose from {1, 2, 4, 8} (not sure what happens if you pick a different value)
• Anisotropic Filtering - setting.mat_forceaniso: value = anisotropic filtering factor, choose from {0, 1, 2, 4, 8, 16}
• Vertical Sync on/off - setting.mat_vsync: 0 = off, 1 = on
• Vertical Sync buffering - setting.triplebuffered: 0 = double buffered, 1 = triple buffered (should be 0 if Vertcal Sync is disabled)
• Multicore rendering - setting.mat_queue_mode: 0 = disabled, -1 = enabled (Valve!?)
• Shader Detail - setting.gpu_level: 0 = low, 1 = medium, 2 = high, 3 = very high
• Effect Detail - setting.cpu_level: 0 = low, 1 = medium, 2 = high
• Model/Texture Detail - setting.gpu_mem_level: 0 = low, 1 = medium, 2 = high
• Paged Pool Memory Available - setting.mem_level: 0 = low, 1 = medium, 2 = high
What's the point of all this information?
Perhaps you're wondering why the hell I would go to all the trouble to find and post this information. Well, I'll give one scenario of how it may be useful, which stems from my initial motivation to uncover all this info.
Let's say you wanted to create two different "settings profiles," one with maxed graphics settings that you would use primarily for recording videos (and occasionally for reveling in the beauty of a particularly well-made map), and another with moderate graphics settings to allow for completely lag-free playing (queue "my godly computer can play every video game in existence at ultra-high graphics settings with 300 fps" responses). Well, this can be accomplished very simply by creating a config file and video file for each of your two "profiles" (say you call them config1.cfg, config2.cfg, video1.txt, and video2.txt). Now, if you want to "load" your settings for "profile 1", simply copy the contents of video1.txt into video.txt and copy the contents of config1.cfg into autoexec.cfg. Now launch Portal 2 and you'll have all your settings that were stored in config1.cfg and video1.txt!
Furthermore, if you're a programmer, you can write a very simple program to do the file copying and/or renaming for you, so that with the (double) click of a button, you can completely change your Portal 2 settings to any "profile" that you have created.
I hope people find all or parts of this useful. If there are other options that I haven't included in here that you would like more information about, let me know. Also, if you have any questions of this nature, feel free to post them here as well.
Now I'm off to actually play some Portal.