Optimizing and Checking Your Map: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
m (Fixing double redirect. This action was performed by a bot.)
Tag: Redirect target changed
 
(26 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Level Design]]
#REDIRECT [[Optimization/Level Design]]
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 <code>help</code> on any command, type help followed by the command text. Also, if you need any help finding a command, you can use the new <code>find</code> command. For example if you type <code>find mat</code> you will get a list of all the console commands with the text <code>"mat"</code> 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 <code>sv_cheats 1</code> 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 <code>+showbudget</code> What does <code>+showbudget</code> 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 <code>+showbudget</code> 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 <code>sv_cheats 1</code> 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 <code>+showbudget</code>. You will need to activate cheats with <code>sv_cheats 1</code> 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 <code>sv_cheats 1</code> 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.
|}

Latest revision as of 15:21, 21 January 2024