Optimizing and Checking Your Map

From Valve Developer Community
Revision as of 11:55, 8 April 2005 by Erik Johnson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Once you get your map built, you may want to check on it's performance in the engine and see how you can optimize it (if you need to at all). This document describes some of developer features of the Source engine that let you evaluate performance.

Useful Console Commands

One useful feature of the console in Source: there is a help command! For a brief bit of help on any command, type help followed by the command text. Also, if you need any help finding a command, you can use the new find command. For example if you type find mat you will get a list of all the console commands with the text "mat" in the command text. For more information on using the console, see The Developer Console.

One other point: you will want to enable the console to access it in the game. Go to Options/Keyboard/Advanced... and there is a checkbox there to enable the console.

sv_cheats 0/1 This is the same as in Half-Life 1. It turns off and on the use of "cheat" console commands. You will need to activate cheats with sv_cheats 1 before using some of the commands listed below.
+showbudget The first thing you'll want to do is bind some key (or mouse button) to +showbudget What does +showbudget do? It displays a breakdown of how the engine is spending it's time drawing each frame on the screen. You'll see how long it's spending time drawing world brushes, entity brushes, prop models, displacement surfaces, 3d skybox, ropes, and other items. Now, with this information, you can optimize your map with good information. With what +showbudget shows you, you will know exactly what to optimize. Is your worldbrush load high? Then you know you need to simplify or improve vis blocking. Are static prop models overloading your view? Then you'll need to work on them, etc.
mat_wireframe 0/1 This toggles off and on the display of wireframe detail for all brush and model objects in view. It is useful for showing you how your map's brushwork has been split up by the engine. It is also useful to show you just what is being drawn in any given view.

You will need to activate cheats with sv_cheats 1 to use this command.

mat_leafvis 0/1 This command turns off and on display of a wireframe box around the current leaf. For more information on using this command to debug visibility issues in your map, see Controlling Geometry Visibility and Compile Times.
mat_bumpmap 0/1 This console command toggles off and on the display of bumpmap effects by the engine. If you want to see how much impact on framerate bumpmap display has, toggle the effect on and off and view the changes (if any) with +showbudget. You will need to activate cheats with sv_cheats 1 to use this command.
mat_specular 0/1 Similar to the mat_bumpmap command, this toggles on and off specular reflection in the engine. You will need to activate cheats with sv_cheats 1 to use this command.
ent_messages_draw 0/1 Turns on and off display all entity input/output activity. As each entity is activated by input or output, the action is drawn at the entity's location, and a line drawn between entities as they target other entities. Can be useful for tracing and debugging entity actions in the game.
developer 1/2 Turns on debugging output to the screen listing all entity triggers and activity. Can be useful for tracing and debugging entity actions in the game.