Optimization/Level Design: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Commands: I've yet to find a USEFUL useful use for mat_leafvis so I removed it from the list.)
m (→‎Commands: Accidentally pressed "Save page".)
Line 29: Line 29:
{{note|Most performance-related commands require <code>[[sv_cheats]]</code>.}}
{{note|Most performance-related commands require <code>[[sv_cheats]]</code>.}}


;<code>cl_showfps</code>
;<code>[[cl_showfps]]</code>
:A simple output of framerate. <code>1</code> is real-time, <code>2</code> is averaged over the past second.
:A simple output of framerate. <code>1</code> is real-time, <code>2</code> is averaged over the past second.
;<code>[[showbudget]]</code>
;<code>[[showbudget]]</code>
Line 36: Line 36:
;<code>[[mat_wireframe]]</code>
;<code>[[mat_wireframe]]</code>
:A console variable that lets you see exactly what is being rendered - for reasons described in [[visibility optimization]], often more than you might think is sensible.
:A console variable that lets you see exactly what is being rendered - for reasons described in [[visibility optimization]], often more than you might think is sensible.
:There are three wireframe modes, <code>1</code> through to <code>3</code>, which display the information you need with progressively fewer lines.
;<code>[[r_lockpvs]]</code>
;<code>r_lockpvs</code>
:Locks the [[PVS]] so you can walk around and inspect what is being drawn.


== External links ==
== External links ==

Revision as of 15:19, 31 January 2011

Template:Otherlang2

It's easy to create a map that older (or even newer!) computers will struggle to draw at sixty frames per second. This article is the hub for all information on how to to prevent that by optimizing your map.

Areas

Leaks
There's no excuse! Leaks will invalidate almost all of your efforts elsewhere.
Visibility
Reducing the number of surfaces and objects that are drawn in the first place. The single most important area.
Physics
Various tricks to avoid overloading the CPU with physics calculations.
Materials
Correct material choices will allow your map to scale down its demands on slower computers.
Lighting
Performance and file-size optimisation.
Skybox
A properly optimized skybox will significantly reduce lag and map size

Commands

There are many more useful console commands than the ones listed here — find them in their relevant articles.

Note.pngNote:Most performance-related commands require sv_cheats.
cl_showfps
A simple output of framerate. 1 is real-time, 2 is averaged over the past second.
showbudget
A panel which displays how your computer is spending its budget for each frame. It's the premier tool for working out exactly what's sucking up performance in your map.
It's invoked with +showbudget and -showbudget, which means that you can bind the former to a key (i.e. bind <key> +showbudget) and it will only appear when you hold that button down.
mat_wireframe
A console variable that lets you see exactly what is being rendered - for reasons described in visibility optimization, often more than you might think is sensible.
r_lockpvs
Locks the PVS so you can walk around and inspect what is being drawn.

External links

Half-Life 2 Map Editing Optimization Guide - Another great site for more on map optimization in Half-Life 2 by Ralph van Hoorn
Optimization in Source: A Practical Demonstration - Pictorial demonstrations of optimization by NoDraw.net