Optimization/Level Design: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Maybe add a note about Propper++ here ? The reason is why yes is because it's very easy and quick to use.)
 
(56 intermediate revisions by 21 users not shown)
Line 1: Line 1:
{{abstract mapping}}
{{LanguageBar|title = Optimization (Level Design) }}
{{Abstract Mapping}}


'''Optimization''' is the act of reducing the computer's workload. In level design terms this is almost always related to reducing the amount of rendering that the video card must perform at any one time.
It's easy to create a map that older (or even newer!) computers will struggle to draw at (or higher than) sixty frames per second. This article is the hub for all information on how to to prevent that by '''optimizing your map'''.


== Areas ==
== Areas ==
; [[Leak]]s
:There's no excuse! Leaks will invalidate almost all of your efforts elsewhere.
; [[VIS optimization|Visibility]]
: Reducing the number of surfaces and objects that are drawn in the first place. The single most important area.
; [[Physics optimization|Physics]]
: Various tricks to avoid overloading the CPU with physics calculations.
; [[Material optimization|Materials]]
: Correct material choices will allow your map to scale down its demands on slower computers.
; [[Lighting optimization|Lighting]]
: Performance and file-size optimisation.
; [[Skybox Optimization|Skybox]]
: A properly optimized skybox will significantly reduce lag and map size
== Brushes ==
; [[Areaportal]]
; [[Hint brush|Hint]] + [[Skip]]
; [[Occluder]]


;[[Leak]]s
== Models ==
:There's no excuse! Leaks will invalidate almost all of your efforts elsewhere.
; [[Static Prop Combine]] {{csgobranch|since}}{{also|{{teamspen}}{{h++}}}}
;[[Optimization (level design)/Visibility|Visibility]]
: Maps using large amounts of static props can reduce GPU drawcall overhead by combining individual static props into batches.
:Reducing the number of surfaces and objects that are be drawn in the first place. This is the largest section.
;[[Optimization (level design)/Physics|Physics]]
:There are various tricks to avoid overloading the CPU with physics calculations.
;[[Optimization (level design)/Materials|Material choices]]
:Correct material choices will allow your map to scale down its demands on slower computers.
;[[Optimization (level design)/Lighting|Lighting and reflections]]
:Real-time and file-size optimisations.


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


;<code>[[showbudget]]</code>
{{Note|Most performance-related commands require {{Command|sv_cheats}}.}}
: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 <code>+showbudget</code> and <code>-showbudget</code>, which means that you can bind the former to a key (i.e. <code>bind <key> +showbudget</code>) and it will only appear when you hold that button down.
;<code>[[Optimization_Commands#mat_wireframe|mat_wireframe]]</code>
:A console variable that lets you see through walls. This way, you can see exactly what is being drawn - for reasons described in the [[Optimization (level design)/Visibility|visibility optimisation article]], 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.
 
==See also==


* [[Budget]]
; {{Command|cl_showfps}}
* [[Controlling Geometry Visibility and Compile Times]]
: A simple output of framerate. <code>1</code> is real-time, <code>2</code> is averaged over the past second, while also displaying the lowest and highest FPS, aswell the latency.
* [[Optimizing and Checking Your Map]]
; [[showbudget|ShowBudget]]
* [[Optimization Commands]]
: 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.
* [[Optimization (Non-Geometry)]]
: It's invoked with <code>+showbudget</code> and <code>-showbudget</code>, which means that you can bind the former to a key (e.g., {{Code|bind <key> +showbudget}}) and it will only appear when you hold that button down.
*:''Geometry optimizations can be complicated, but there are several non-geometry aspects of optimization. Handling them can be an easy way to make your map faster. Keep these in mind when designing a new map, and consult individual sections where [[showbudget]] reports problems.''
; {{Command|mat_leafvis}}
* [[Optimization (Geometry)]]
: A console variable that (when active) displays visleaves. The number of the leaf, area and cluster of the current leaf is reported in the console.
*:''Geometry-based optimizations are those that manipulate map geometry in order to change the way BSP behaves. These can be difficult, but extremely effective. Any professional-grade map will make use of some or all of these techniques.''
; {{Command|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.
; {{Command|r_lockpvs}}
: Locks the [[PVS]] so you can walk around and inspect what is being drawn.


==External links==
== External links ==
*[http://forums.steampowered.com/forums/forumdisplay.php?f=191 Official SDK Forums]
* [http://www.nodraw.net/2009/12/optimization-in-source-a-practical-demonstration/ Optimization in Source: A Practical Demonstration] - Pictorial demonstrations of optimization by [http://www.nodraw.net NoDraw.net]
*[http://hl.logout.fr/?p=optimisation French Optimization tutorial by NykO18]
* [http://www.shamusyoung.com/twentysidedtale/?p=4759 The Truth About The BSP] - Step-by-step explanation on BSP and its application by Twenty-Sided
*[http://www.student.ru.nl/rvanhoorn/optimization.php?chapter=intro Zombie's Optimization tutorial]
* [https://www.mapcore.org/articles/development/displacement-vs-func_detail-a-comparative-fps-study-r73/ Displacement Vs. Func_detail - A comparative fps study] by Will2K on MapCore
[[Category:Level Design]]

Latest revision as of 13:17, 4 February 2025

English (en)Deutsch (de)Français (fr)Русский (ru)中文 (zh)Translate (Translate)
Abstract Mapping series Discuss your thoughts - Help us develop the articles or ideas you want

Ammunition | List of HL2 Animals and Creatures | Mapping with Antlions | Beams and Lasers | Cables and Ropes | Moving Clouds | Color Theory in Level Design | Combat | Combine | Compression (Source 1) | Doors | Dust, Fog, & Smoke | Elevators | Level Transitions | Environmental Lighting, Sun, Weather, & Outdoors | Explosions | Fire | Half-Life 2 Foliage | Glass & Windows | Headcrab | Health | Ladders | Lighting | Optimization (level design) | Physics | Retinal scanners | Sound and Music | Special effects | Terrain | Trains | Turrets | Water | Weapons | Zombie

It's easy to create a map that older (or even newer!) computers will struggle to draw at (or higher than) 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

Brushes

Areaportal
Hint + Skip
Occluder

Models

Static Prop Combine (in all games since CS:GO engine branch)(also in TeamSpen's Hammer AddonsHammer++)
Maps using large amounts of static props can reduce GPU drawcall overhead by combining individual static props into batches.

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, while also displaying the lowest and highest FPS, aswell the latency.
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 (e.g., bind <key> +showbudget) and it will only appear when you hold that button down.
mat_leafvis
A console variable that (when active) displays visleaves. The number of the leaf, area and cluster of the current leaf is reported in the console.
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