Useful console commands for mappers

Discussion in 'Tutorials & Resources' started by sevin, Feb 17, 2015.

  1. sevin

    aa sevin

    Positive Ratings:
    I have spent some time aggregating a list of useful console commands for TF2 mappers. Most lists I've found on the internet are not complete and miss some commands that I use regularly when I'm testing/studying a map in-game. This is not to say mine is complete, it's just what I've personally found useful. I've also made a cleaner .cfg of the list should you wish to have it in your custom folder, as well as a mapping.cfg that you can execute in-game to bind some of the more important commands to keys, increments, or toggles as needed. You can download that here.

    The list:

    // -----------------------------------
    // ----------------------------------- 
    // by sevin
    // ---------------------------
    // texture/model identifiers
    // ---------------------------
    surfaceprop                            // Displays texture and/or model name of whatever is 
                                        // under crosshair
    mat_texture_list 1                    // Generates a table of textures currently displayed 
                                        // on screen, including model textures
    mat_crosshair                        // Reports texture of brush or displacement under 
                                        // crosshair
    sv_skyname                            // Reports skybox texture name
    impulse 107                            // Reports texture of brush under crosshair BUT IN 
                                        // CAPS LOCK (EDGY)
    impulse 106                            // Reports entity class, name, and model of whatever 
                                        // is under crosshair (only works on named entities)
    // ---------------------------
    // sound
    // ---------------------------
    soundscape_debug 1                    // Displays all active/inactive soundscapes and their 
                                        // locations with green/red/yellow lines
    cl_soundscape_printdebuginfo         // Prints all soundscape file names in the game
    sv_soundscape_printdebuginfo        // Prints all soundscape names and positions in the 
                                        // map
    snd_show 1                            // Displays all sounds currently being played along 
                                        // with their volume, position, path, and more
    snd_visualize 1                        // Displays all sounds currently being played with a 
                                        // tag in the exact location they're playing from
    snd_rebuildaudiocache                // Updates sounds in-game if you've added custom sound 
                                        // files
    playsoundscape                        // Plays a specified soundscape. These stack so use 
                                        // the command below to disable each before playing 
                                        // another
    stopsound                            // Stops current soundscape
    // ---------------------------
    // menus
    // ---------------------------       
    perfui                                // Menu that allows you to view all portals, 
                                        // distances from props (for fades, kinda not useful 
                                        // but interesting), and occluders
    colorcorrectionui                    // Show/hide the color correction tools UI if there is 
                                        // a color correction entity in the level
    fogui                                // Show/hide a basic env_fog_controller manipulator 
                                        // menu
    // ---------------------------
    // entities 
    // ---------------------------
    ent_fire "timer" setmaxtime 9999     // Resets the maximum time allowed in the round to 
    ent_fire "timer" settime 9999        // 9999 minutes and then sets the timer to that time
                                        // so you don't run out of it while you are testing.
                                        // "timer" is the name of the round timer, usually
                                        // "game_timer" or "timer_round" etc.
    ent_fire "capname" disable            // Disables the point called. You can start typing 
                                        // "cap" and you should be able to figure out what it
                                        // is. Good for taking level screenshots on the 
                                        // central point without capping it
    ent_dump !picker                    // Dumps active keyvalues of entity under crosshair.
                                        // Ignores prop_statics
    ent_messages_draw 1                    // Displays I/O events and the commands given               
    // ---------------------------
    // game changers
    // ---------------------------
    mat_wireframe 1                        // Displays polygons of every model/brush in the 
                                        // map/player
    vcollide_wireframe 1                // Displays collision meshes for enabled models
    mat_leafvis 1                        // Shows what visleaf you're in with a red wireframe 
                                        // box
    mat_leafvis 3                        // Shows all visleafs currently rendered with red 
                                        // wireframe boxes
    mat_hdr_level 2                        // Turns on full HDR on enabled maps
    mat_luxels 1                        // Draws luxel graph on world geometry much like the
                                        // lightmap view in Hammer. Will probably screw up 
                                        // the lighting
    map_showspawnpoints                    // Shows location of spawn points and their direction 
                                        // for 60 seconds
    showtriggers_toggle                    // Shows all trigger brushes in the map with the 
                                        // trigger texture
    r_drawmodellightorigin 1            // Displays lighting origin currently rendered models.
                                        // Also appears to show origin of currently equipped
                                        // weapon
    r_drawmodelstatsoverlay 1            // Displays model names,  paths, LODs, and tri counts
                                        // for props within a radius of the player
    r_drawmodelstatsoverlaydistance 500    // Sets the radius of the above command
    r_drawclipbrushes 2                    // Draws all clip brushes in a solid red/purple 
                                        // texture   
    r_drawportals 1                        // Draws all nearby areaportals and areaportalwindows
    r_lockpvs 1                            // Locks currently visible set so you can see exactly
                                        // what is currently being rendered. This also kills
                                        // the skybox
    r_visocclusion 1                    // Shows occluders in a white outline, currently 
                                        // rendered entities in red, and entities that would
                                        // be would rendered but are blocked by the occluder
                                        // in green
    cl_detaildist 1024                    // Distance at which detail sprites become no longer 
                                        // visible
    cl_detailfade 400                    // Distance at which detail sprites fade in
    rope_wind_dist 1000                    // Distance at which CPU stops applying small gusts of
                                        // wind to ropes
    // ---------------------------
    // show/hide entities/geometry
    // ---------------------------
    r_drawdisp 0                        // Hides displacements. Useful for seeing what's going
                                        // on under your map maybe?
    r_drawfuncdetail 0                    // Hides func_detail's. Helpful when checking out how
                                        // how your map looks to vis.exe
    r_drawbeams 0                        // Hides point_spotlight volumetric spotlight beam
    r_drawentities 0                    // Hides all entities. This will show you the barebones
                                        // geometry of your level
    r_drawstaticprops 0                    // Hides static props. Why? Who cares
    r_drawothermodels 0                    // Hides dynamic props/models. Useful for checking
                                        // areaportal operation when using doors
    r_drawdetailprops 0                    // Hides detail sprites because whatever
    r_3dsky    0                            // Removes the 3D skybox
    // ---------------------------
    // miscellaneous
    // ---------------------------
    sv_cheats 1                            // Enables "cheats", needs to be on to use most other 
                                        // commands
    developer 1                            // Displays all console data at the top left of the 
                                        // screen, useful for using commands where info is 
                                        // spit back into the console and you have to go back 
                                        // into it to see it
    find "searchterm"                    // Finds all commands that include the given string
    maps "*"                            // Displays full list of .bsp's from your maps folder
    map "mapname"                        // Loads specified map (ex. - map "pl_upward")
    mp_waitingforplayers_cancel 1        // Cancels "waiting for players" time at the start of 
                                        // a new map
    mp_restartgame_immediate            // Resets the map
    cl_leveloverview 7                    // Displays map from top-down in an orthographic view.
                                        // Mess with the value to vary zoom levels
    god                                    // You become a god. Cool lifehack
    getpos_exact                        // Dumps your exact angle and position to the console
    noclip                                // Disables player clipping, allowing you to "clip" 
                                        // through walls and not be affected by gravity
    cl_drawhud 0                        // Hides the HUD, useful for taking map screenshots
    r_drawviewmodel 0                    // Disables viewmodels, also useful for taking map 
                                        // screenshots
    mat_fullbright 1,2                    // At 1, removes all shadows from map so all surfaces 
                                        // are equally lit. At 2, turns the whole map 
                                        // grayscale so you can see how the lighting is 
                                        // working in your map easier
    cl_showfps 1                        // Displays current FPS in top right corner
    cl_showpos 1                        // Displays current position and orientation in top 
                                        // right corner, as well as velocity in HU/s
    light_crosshair                        // Dumps luxel color in RGB from under crosshair
    The script file should you want it:

    sv_cheats 1
    developer 1
    // testing binds
    bind             KP_INS                 "surfaceprop"
    bind             KP_DEL                 "soundscapetoggle"
    bind             KP_ENTER             "collisionstoggle"
    bind             KP_END                 "mat_reloadallmaterials"
    bindtoggle         KP_DOWNARROW         "r_lockpvs"
    bind             KP_PGDN             "mat_crosshair"
    bind             KP_LEFTARROW         "incrementvar mat_leafvis 0 3 1"
    bind             KP_5                 "incrementvar mat_wireframe 0 3 1"
    bind             KP_RIGHTARROW         "showtriggers_toggle"
    bindtoggle         KP_HOME             "r_drawfuncdetail"
    bindtoggle         KP_UPARROW             "r_drawentities"
    bindtoggle         KP_PGUP                "snd_restart"
    // for screenshots
    bind            KP_PLUS                "viewtoggle; graphtoggle; sndoff; clipoff; noclip"
    // toggle aliases
    alias        soundscapetoggle sndon
    alias        sndon                        "soundscape_debug 1; snd_show 1; snd_visualize 1; alias soundscapetoggle sndoff"
    alias        sndoff                        "soundscape_debug 0; snd_show 0; snd_visualize 0; alias soundscapetoggle sndon"
    alias        viewtoggle viewoff
    alias        viewoff                        "cl_drawhud 0; r_drawviewmodel 0; developer 0; alias viewtoggle viewon"
    alias        viewon                        "cl_drawhud 1; r_drawviewmodel 1; developer 1; alias viewtoggle viewoff"
    alias        graphtoggle graphoff
    alias        graphoff                    "net_graph 0; alias graphtoggle graphon"
    alias        graphon                        "net_graph 1; alias graphtoggle graphoff"
    alias        collisionstoggle clipon
    alias        clipon                        "r_drawclipbrushes 2; vcollide_wireframe 1; alias collisionstoggle clipoff"
    alias        clipoff                        "r_drawclipbrushes 0; vcollide_wireframe 0; alias collisionstoggle clipon"
    I doubt it's a complete list, so let me know if you find anything missing that you use.
    • Thanks Thanks x 12
    • Useful Useful x 1
    Last edited: Apr 8, 2016
  2. ades

    ades L4: Comfortable Member

    Positive Ratings:
    very useful
  3. Egan

    aa Egan

    Positive Ratings:
    Ones I frequently use to add to your list:
    ent_dump !picker - will show the active keyvalues of the entity under your crosshair

    con_filter_enable 1 (ty booj)
    con_filter_text_out - will let you filter lines of text out of console, to not appear
    con_filter_text - lets you filter lines of text from console, to only appear

    mat_leafvis 2 - shows the current active viscluster

    +showbudget - show the current processing power required in each field to view the current scene, useful to figure out what specifically is causing low fps
    • Thanks Thanks x 2
    Last edited: Feb 17, 2015
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Positive Ratings:
    From my mapping.cfg

    bind "KP_INS" "noclip" duh
    bind "KP_END" "incrementvar mat_leafvis 0 1 1" visibility stuff
    bind "KP_DOWNARROW" "incrementvar r_drawbrushmodels 0 1 1" brush entities
    bind "KP_PGDN" "showtriggers_toggle" causes toolstrigger to render visible
    bind "KP_LEFTARROW" "incrementvar mat_wireframe 0 3 3" for the vis checking
    bind "KP_5" "incrementvar r_drawdisp 0 1 1" hide displacements... just because
    bind "KP_RIGHTARROW" "incrementvar r_drawclipbrushes 0 2 1" helps you not miss ledges
    bind "KP_HOME" "incrementvar r_drawportals 0 1 1" again for working on vis, this means area portals
    bind "KP_UPARROW" "incrementvar r_drawfuncdetail 0 1 1" hide detail
    bind "KP_PGUP" "incrementvar mat_luxels 0 1 1" this used to be nice for lightmap optimziation, but valve broke it
    bind "KP_SLASH" "incrementvar r_drawstaticprops 0 1 1" duh
    bind "KP_MINUS" "cl_showents" reports all edicts
    bind "KP_PLUS" "map_showspawnpoints" display all spawn locations, through walls, with indicators of whether they are valid or not and the actual spawn location as compared to the entity location
    bind "KP_ENTER" "mp_showrespawntimes" current spawn wave times, to make sure they are being adjsted right. this also works on servers without cheats so you can check easy when at a gameday if you think something is off.
    bind "KP_DEL" "incrementvar r_drawlightinfo 0 1 1" weirdo boojum light problem helper
    bind ALT "+showbudget" finding where your rendering load is
    bind DEL "incrementvar cl_drawhud 0 1 1; incrementvar r_drawviewmodel 0 1 1" for clean screenshots
    bind HOME "incrementvar sv_cheats 0 1 1" so everything else works
    bind END "mp_waitingforplayers_cancel 1; ent_fire tf_gamerules setredteamrespawnwavetime 0; ent_fire tf_gamerules setblueteamrespawnwavetime 0; mp_teams_unbalance_limit 16" to get right to the testing and not waste time.

    I like 'em on the keypad because then they can just stay there.
    • Thanks Thanks x 6
  5. sevin

    aa sevin

    Positive Ratings:
  6. Toomai

    Toomai L3: Member

    Positive Ratings:
    These ones are found in mvm_example.pop and are pretty good for MvM testing:
    • currency_give q: Gives you Q money (max 30,000).
    • tf_populator_health_multiplier q: Makes all bots have xQ health.
    • tf_populator_damage_multiplier q: Makes all bots deal xQ damage.
    • tf_mvm_jump_to_wave q: Skips to wave Q.
    • tf_bot_flag_kill_on_touch 0/1: Kills anything that picks up the bomb.
    • nb_blind 0/1: Bots ignore players.
    • nb_stop 0/1: Bots ignore players and are frozen in place.
  7. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Positive Ratings:
    Haha, I uhh... wasn't trying to. I didn't even notice where you posted this or what your intent was, I thought you were just asking everyone if they had any, so I posted mine.
    You had more than us anyway!

    Although, I think special mention needs to be made about FIND. It is the single most important command there is. Can't remember something? Wondering if there is a command for something? Just search for a related word or abbreviation and you'll probably discover it.
  8. iiboharz

    aa iiboharz eternally tired

    Positive Ratings:
    still works for me ...?
  9. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Positive Ratings:
    Hmm, a nice clean grid on everything? It gets smeared and distorted when I use it... maybe there is some other graphical setting that affects it.
  10. nightwatch

    aa nightwatch

    Positive Ratings:
    Try disabling steam overlay - just a hunch.
    I'd do it myself but I can't run tf2 right now.
  11. Waffe

    Waffe L4: Comfortable Member

    Positive Ratings:
    I personally use mp_tournament 1, which is much simpler if you don't have to test the game logic.
  12. sevin

    aa sevin

    Positive Ratings:
    Updated to v2, added some more commands to the list as well as rebound the commands in mapping.cfg to the keypad since that makes more sense. Also added Boojum's little screenshot script.
  13. Pocket

    aa Pocket func_croc

    Positive Ratings:
    I had no idea there were so many useful visual debugging tools built right into the engine.

    One that you missed, though, was mat_fullbright 2, which does the exact opposite of 1 — replaces all the textures with pure white and leaves the lighting intact. I imagine it would be more useful than its counterpart.
  14. sevin

    aa sevin

    Positive Ratings:
  15. Tumbolisu

    aa Tumbolisu  I ⌄ I 

    Positive Ratings:
    Lightwarp effects still work, meaning that for example Pyrovision still looks colorfull on dustbowl.
  16. UKCS-Alias

    aa UKCS-Alias Mann vs Machine... or... Mapper vs Meta?

    Positive Ratings:
    It depends on your task. Fullbright is usefull when searching for visible texture bugs related to z-clipping and misalignment. And for some it can help at spotting dev textures.

    To me you cant realy test light without the actual surface behind it. A dark or light texture affects lighting alot. And if its to see if a certain density is good you still need the actual texture as with a flat color everything can quickly look bad.
  17. happs

    happs L1: Registered

    Positive Ratings:
    Some more entity related commands:

    ent_text <entity name> // displays entity related information on screen
    // for example logic_timer will display current tick count and tick fire count

    developer 2
    // will display verbose messages of entity input and entity output messages

    ent_messages_draw 1 // will visually display entity I/O messages

    ent_bbox <entity> // displays bounding box around entitiy. Useful for displaying nodraw textured brush entities

    ent_pivot <entity> // displays orientation angle of the entity. useful for stuff like func_rotating

    cl_showpos 1 // shows the client's position and orientation

    //To visualize trigger volumes:
    showtriggers 1

    // find_ent will display a list of entities matching targetnames or classnames
    find_ent mytimer_*
    find_ent logic_timer

    // for debugging entity relationships I like to use the following
    host_timescale 0.1 // slows down the game including event processing
    host_timescale 1 // default

    dumpeventqueue // displays the event queue of pending entity inputs
    ent_pause // pauses event processing
    ent_step // once paused you can execute line by line using step

    // however I prefer to enable the pause command with sv_pauseable 1

    // for logs I like to use the following:
    con_timestamp 1
    log 1
    log_verbose_enable 0
    sv_log_onefile 1
    con_logfile debug_console
    sv_logecho 1
    sv_lowedict_action 1

    // what you type into the console will be redirected to file. The logfile is named and always the same, concatenating if one already exists.
    • Thanks Thanks x 1
  18. Egan

    aa Egan

    Positive Ratings:
    Found this neat command that shows tris on props in the map within a radius around the player. Would be good to tell what is eating FPS like those dang barrel props (not the one in the screenshot tho - the wood ones in dustbowl I'm talking about).


    r_drawmodelstatsoverlay 1
    • Thanks Thanks x 4
  19. LeNitrous

    LeNitrous L2: Junior Member

    Positive Ratings:
    Can sticky? This is really helpful
  20. sevin

    aa sevin

    Positive Ratings:
    If that would actually be a thing I'd need to update this again. Got a few more commands to add.