Overview
BSPSource’s behavior is controlled by theBspSourceConfig class, which contains all configuration options for the decompilation process. These options can be set via:
- CLI flags - Command-line arguments (see CLI Reference)
- GUI controls - Graphical interface options (see GUI Usage)
- Programmatic API - Direct configuration when using BSPSource as a library
Configuration Object
When using BSPSource programmatically, create and configure aBspSourceConfig instance:
Configuration Options
General Settings
Enable debug mode.Increases log verbosity and adds additional debug information to the VMF file. Useful for troubleshooting decompilation issues.CLI:
--debug or -dImpact: Larger VMF files, more console outputOverride automatic game detection with a specific Steam Application ID.BSPSource normally auto-detects the game from BSP metadata. Set this to force a specific game when detection fails or is incorrect.CLI:
--appid <id>Common Values:0- Auto-detect (default)220- Half-Life 2440- Team Fortress 2550- Left 4 Dead 2620- Portal 2730- Counter-Strike: Global Offensive
VMF format version to use for output.Values:
AUTO- Automatically determine based on game (default)OLD- Source 2004-2009 formatNEW- Source 2010+ format
--format <format>When to change: Rarely needed. Use OLD if you’re working with older Hammer versions.Entity Options
Control which entity types are written to the VMF file.Write point entities to the VMF.Point entities are entities without brushes, such as:
light- Light sourcesinfo_player_start- Player spawnsenv_sprite- Spritesambient_generic- Sounds
--no_point_ents (inverted - flag disables)Write brush entities to the VMF.Brush entities are entities with associated geometry, such as:
func_door- Doorstrigger_multiple- Triggersfunc_breakable- Breakable objects
--no_brush_ents (inverted)Write
prop_static entities to the VMF.Static props are non-moving model entities like buildings, trees, rocks, and decorative elements.CLI: --no_sprp (inverted)Impact: Disabling can significantly reduce VMF size and complexity.Write
info_overlay entities to the VMF.Overlays are decals applied to surfaces, such as graffiti, signs, blood stains, and bullet holes.CLI: --no_overlays (inverted)Write
env_cubemap entities to the VMF.Cubemaps provide reflections for reflective surfaces like water and metal.CLI: --no_cubemaps (inverted)Write
func_detail entities to the VMF.Detail brushes don’t affect visibility calculations and are used for small decorative geometry.CLI: --no_details (inverted)Write
func_areaportal and func_areaportal_window entities to the VMF.Areaportals control visibility between different areas of the map for performance optimization.CLI: --no_areaportals (inverted)Write
func_occluder entities to the VMF.Occluders block visibility to improve rendering performance.CLI: --no_occluders (inverted)Write
func_ladder entities to the VMF.Ladder entities define climbable surfaces.CLI: --no_ladders (inverted)Write
func_viscluster entities to the VMF.Visibility clusters are used for optimization in large, complex maps.CLI: --no_visclusters (inverted)Fix instance entity brush rotations for Hammer Editor.BSPSource corrects rotation issues that occur with instance entities during compilation. Disable this to preserve original rotations.CLI:
--no_rotfix (inverted)Force manual entity mapping for areaportal entities.By default, BSPSource automatically maps areaportal entities to their associated brush entities. Enable this to force manual mapping.CLI:
--force_manual_areaportalMerge
func_detail brushes that touch into one entity.Can reduce entity count in the decompiled VMF, but may make editing more difficult.CLI: --merge_detailsDistance threshold for merging detail brushes.Only applies when
detailMerge is enabled. Brushes within this distance are considered touching.CLI: Not exposed (advanced setting)Maximum number of brush sides for cubemap brushes.CLI: Not exposed (advanced setting)Impact: Higher values create more accurate cubemap placement but increase complexity.
Maximum number of brush sides for overlay entities.CLI: Not exposed (advanced setting)Impact: Higher values support more complex overlays.
Brush Options
Control how world brushes are decompiled.Write world brush geometry to the VMF.World brushes are the main solid geometry of the map. Disabling this creates an entity-only VMF.CLI:
--no_brushes (inverted)Write displacement surfaces to the VMF.Displacements are deformable surfaces used for terrain, hills, and organic shapes.CLI:
--no_disps (inverted)Brush decompiling mode.Controls how brushes are reconstructed from the BSP file.Values:
BRUSHPLANES- Reconstruct brushes using plane information (default, most accurate)ORIGFACE- Create brushes from original faces before VBSP splittingORIGFACE_PLUS- Create brushes from both original and split facesSPLITFACE- Create brushes from split faces only (most complex)
--brushmode <mode>Recommendations:- Use
BRUSHPLANESfor best results (default) - Use
ORIGFACEifBRUSHPLANESfails - Use
SPLITFACEfor exact engine geometry (complex output)
Thickness of brushes created from flat faces, in units.In face-based modes (
ORIGFACE, ORIGFACE_PLUS, SPLITFACE), some faces are perfectly flat. This setting controls the thickness of brushes created from these faces.CLI: --thickness <value>Range: 0.1 to 100.0 (practical range)Recommendations:- Keep at 1.0 for most cases
- Increase if brushes are too thin and cause issues
- Decrease for more precise geometry (may cause problems)
Texture Options
Control texture handling during decompilation.Replace all face textures with this texture.Useful for debugging geometry or creating template maps. Leave empty to preserve original textures.CLI:
--facetex <texture>Examples:"dev/dev_measuregeneric01"- Generic measurement texture"tools/toolsnodraw"- Invisible texture""- Preserve original (default)
Replace all back-face textures with this texture.Only used in face-based decompiling modes. Back faces are the internal faces of brushes created from flat faces.CLI:
--bfacetex <texture>Common Value: "tools/toolsnodraw" - Hide internal facesFix environment-mapped material references.BSPSource corrects cubemap texture references to work properly in Hammer Editor.CLI:
--no_cubemaptexfix (inverted)Recommendation: Keep enabled for Hammer compatibility.Fix tool texture names.BSPSource corrects tool texture names like
toolsnodraw or toolsblocklight to their proper forms.CLI: --no_ttfix (inverted)Recommendation: Keep enabled for Hammer compatibility.Miscellaneous Options
Don’t write VMF files, only read BSP.Useful for testing BSP reading or using BSPSource as a BSP parser without generating output.CLI:
--no_vmfLoad lump files (
.lmp) associated with the BSP file.Lump files contain additional data that can be stored separately from the main BSP. Disabling this may result in incomplete decompilation.CLI: --no_lumpfiles (inverted)Recommendation: Keep enabled unless you know lump files are not needed.Skip decompilation protection checking.Some maps include mechanisms to prevent or break decompilation. BSPSource attempts to detect these. Enabling this skips detection, which can increase speed when batch-processing known-unprotected maps.CLI:
--no_protWarning: May produce incorrect results on protected maps.Group entities from instances into visgroups.BSPSource organizes instance entities into Hammer visgroups for easier editing.CLI:
--no_visgroups (inverted)Create Hammer cameras above each player spawn.BSPSource creates camera entities at player spawn points for easy navigation in Hammer Editor.CLI:
--no_cams (inverted)Impact: Adds convenience for map editing but increases entity count slightly.Unpack embedded files from the BSP.Many BSP files contain embedded resources like textures, models, sounds, and particles. Enabling this extracts them to disk.CLI:
--unpack_embeddedOutput Location: Files are extracted to a folder next to the VMF file.Use ‘smart’ extraction of embedded files.Smart unpacking automatically skips files generated by VBSP that are only relevant to running the map in the engine (like compiled lighting data).CLI:
--no_smart_unpack (inverted)Only applies when: unpackEmbedded is trueRecommendation: Keep enabled to avoid extracting unnecessary files.VMF Precision Settings
These advanced settings control numerical precision in VMF output.Decimal places for general floating-point values in VMF.CLI: Not exposed (advanced setting)Impact: Higher values increase precision but create larger files.
Decimal places for texture axis vectors.CLI: Not exposed (advanced setting)
Decimal places for texture scale values.CLI: Not exposed (advanced setting)
Configuration Presets
Default Configuration
Out-of-the-box settings for complete decompilation:Geometry Only
Extract only world geometry, no entities:Fast Processing
Optimized for speed when processing many maps:Debug Mode
Maximum information for troubleshooting:Extract Everything
Decompile map and extract all embedded resources:Programmatic Usage
Basic Example
Advanced Example with Multiple Files
See Also
- CLI Reference - Command-line flag documentation
- GUI Usage - Graphical interface guide
- Supported Games - List of games and their app IDs