Optimization (Level Design)

From Valve Developer Community
Jump to: navigation, search
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 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 Addons)
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.
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