[Home]

Source Engine Console Commands

Last Updated - [5/7/2024]

Shy’s cool and useful source engine console command list, mostly for my own reference also semi specific to gmod

Most of these need sv_cheats!

BSP & Vis Debugging:

mat_leafvis 1 shows the current leaf you are in
mat_leafvis 2 shows the current viscluster you are in.
mat_leafvis 3 shows all visclusters in PVS
r_lockpvs 1 lets you move around without the pvs updating
r_visambient 1 will show you ambient light probes, only when using leafvis. good for fixing lighting
r_visocclusion 1 shows func_occluders in world
r_occlusion 1/0 toggles occlusion to test if your occluders are actually doing anything
r_drawportals 1 shows areaportals in world
gl_clear_randomcolor 1 replaces black void with random color each frame
debugsystemui lots of useful toggles (useful with above to remove sky and check for holes)
mat_surfaceid 1 displays in 3d the ID of the SURFACE of a brush or displacement in hex, advanced

Level Debugging:

fog_ * fog commands, various, used to set specific values vs using fogui command
r_farz value manually set zclip, only properly works with values LOWER than what the map was compiled with, -1 is default
impulse 81 gives cubemap weapon
perfui lil super useful ui that lets you visualize a few things like prop fades and occluders
vcollide_wireframe show model collisions that use vphysics, does not always work with bbox, or static props
r_drawclipbrushes 2 draws brushes with clip textures on them
r_printdecalinfo prints amount of decals in use, and the decal limit
mat_luxels 1 shows lightmap grid texture in game

Audio Debugging:

snd_show 1 SUPER IMPORTANT, shows sound buffers and currently playing sounds
snd_visualize 1 requires above, shows in 3d where sounds come from
snd_showmixer shows volumes of different sound channels, useful for sequence development
room_type value forces different DSP. if you run it without a value it will display the value from the soundscape
snd_restart will restart the soundsystem and reload any soundscapes but it will NOT reload soundSCRIPTS! (i think)
sv_footsteps 0/1 turns off/on footstep noise, but does not stop jumping or splash noises

Entity Debugging:

ent_messages_draw 1 shows logic between ents in game
report_touchlinks lists ents that do col testing in vphys with the entity number
picker 1 shows bounding box and origin of ents
report_simthinklist lists of ents that are currently "thinking", doesn't take into account timers or delays in logic?
cl_showents prints all ents by number and their class name
cl_entityreport value value is the first ent number it will list at, shows a dynamic ent allocation table in gui

Model Debugging:

r_drawmodelstatsoverlay 1 VERY USEFUL, works on statics, shows tons of info including texture paths
r_drawmodelstatsoverlaydistance max distance the above overlay will draw info, 256 is a pretty good value
r_drawlightcache 1 kind of shows a general view of how lights are being applied from source to model
r_drawmodellightorigin 1 shows the lighting origin and rays expanding out to the bounding box of the model
r_lod -1 Default LOD behavior
r_lod 0 fully disables lod switching
r_lod 1-X force a specific lod level on all models, very important for lod debugging
impulse 106 prints model targetname and path, but does not work with static props. useful for ent debug as well
listmodels prints list of in-use model paths to console and refcounts
cl_ent_absbox show the model's grid aligned abs box use these by pointing at a model, doesn't work on statics
cl_ent_bbox show the model's bounding box
cl_ent_rbox show the model's render box

Texture Debugging:

impulse 107 prints path of texture (ignores models)
mat_surfacemat 1 displays in 3d the name of the material on a brush or displacement
mat_crosshair shows material that is under the crosshair
mat_texture_list 1 opens the texture list displaying only textures from the current frame, toggle all with button in ui
mat_normalmaps 1 will show the normal(bump), works with ssbumps on everything that has it, will likely crash when you turn it off, does not show blending
lightprobe test 512 will create a compiled cubemap vtf (and hdr files?) named test with the size of 512 where you are standing
dlight_debug spawns a dynamic light that slowly fades away
mat_normals 1 shows the NORMAL of a surface, useful for finding out why certain shading is busted


Performance Analysis:

mat_fillrate 1 IMPORTANT! shows overdraw, basically the more stuff overlapping = bad
+showbudget "-" turns it off, too much to explain, read the wiki for this one
showbudget_texture 1 just like +showbudget but this one monitors texture related usage
host_ShowIPCCallCount 0/1 shows IPC calls per frame/tick, need developer mode for console overlay
vprof_on / vprof_off turns on or off vprofiler sampling
+/-showvprof show/hide the vprofiler
vprof_generate_report prints a report, should write it out but im not sure if it can without a special convar that prob needs set via launch?
bench_start / bench_end will lock your fps to the tickrate (66.666 default) and manipulate the speed of the game depending on real fps, when ended shows average fps and writes the results in a file in the results folder

Config and path Related:

key_findbinding (ex. +jump, shows buttons bound to +jump) used to find a key
key_listboundkeys shows a list of every key and what it is bound to, I ran this and i still have gms_ stuff from like 2010 lol
differences shows convars that are not default, but not v useful because it always overflows the console output
dumpstringtables_new lists the status of all string tables, stringtable info can help you to reduce networking ent load
dumpstringtables actually prints the strings, but can overflow console
cache_print prints the entire cache and all the paths to sounds or models in it
path very useful, shows active filepath locations of game content

Visual and Hud:

crosshair 0/1 shows or hides the 5 dot hl2 crosshair
hidehud 1 makes it so you cant change weapons, and doesn’t show ammo counter.
cl_drawhud 0 actually hides the hud
hud_quickinfo 0/1 show/hide the hl2 health and ammo counters on crosshair
hud_draw_fixed_reticle 0/1 show/hide the alternate crosshair (kinda like a static quickinfo, usually needed for modded crosshairs)
mat_monitorgamma value default 2.2 (SRGB standard) Should adjust the gamma in fullscreen, in windowed SHOULD stay 2.2
cl_leveloverview value shows top down camera overview, value is zoom, 0 is off, culls geometry to current ground level, kinda pointless
r_shadows 0/1 enables or disables dynamic prop shadows also projected textures (lamps)
r_cleardecals client command to remove placed decals like blood from world, works in mp


Gmod Lua custom stuff:

dgetinfo a lil atlaschat command, prints lots of useful info very simple to recreate

dgetinfo:

concommand.Add("dgetinfo", function(ply)
	local infoget=ply:GetEyeTrace().Entity
	Msg(tostring(infoget) .. "\n")
	Msg(tostring(infoget:GetPos()) .."\n")
	Msg(tostring(infoget:GetAngles()) .. "\n")
	Msg(tostring(infoget:GetModel()) .. "\n")
end)

add a texture to the material tool:

list.Add( "OverrideMaterials", "shystudios/tools/greengreengreeen" )

add a model to the player model list:

list.Set( "PlayerOptionsModel", "Nick", "models/shystudios/nik001.mdl" )
player_manager.AddValidModel( "Nick", "models/shystudios/nik001.mdl" )

add any of the above commands to a file in your lua autoruns folder to make them work

Gameplay:

sv_friction value can be used to control walk speed, default value in gmod is 7 or 8 higher = slower


Shy's Compile Params:

Not console commands but equally useful! These are the settings I use to compile my maps!

VBSP:

-allowdynamicpropsasstatic -low -game $gamedir $path\$file

VVIS:

-low -threads 32 -game $gamedir $path\$file

VRAD:

-ldr -final -smooth 30 -StaticPropLighting -StaticPropPolys -TextureShadows -low -threads 32 -noskyboxrecurse -game $gamedir $path\$file

Launch Params:

-dev -console -allowdebug -game $gamedir +map $file