BSPSource: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Take bspsource out of console command category, this is for in game commands.)
(updated cite template.)
 
(19 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{lang|BSPSource}}
{{LanguageBar}}
[[Image:Bspsrc.jpg|thumb|right|300px|BSPSource v1.4.0]]
[[File:BSPSource.png|thumb|right|300px|Screenshot of BSPSource.]]
[[File:BSPSource icon.png|64px|left]]'''BSPSource''' is a [[VMEX]]-based map decompiler for [[Source]] games. It converts [[BSP]] files back into [[VMF]] ones that can be loaded in [[Hammer]]. It also includes numerous bug fixes over '''VMEX''' and new features for doing the conversion, such as extracting embedded assets, processing multiple BSPs at once, and more.
{{Stub}}
{{Bspsource|4}} is a GUI map decompiler for {{src|4}} games, written in {{java|4}}.


Based on [[VMEX]], it converts [[BSP]] files into [[VMF]] ones that can be loaded in [[Hammer]]. It also includes numerous bug fixes over '''VMEX''' and new features for doing the conversion, such as extracting embedded assets, processing multiple BSPs at once, and more.


{{note|Decompiled maps aren't identical to the original '''VMF''' files that were used to compile them, and often present issues such as invalid geometry solids or misplaced [[Areaportal|areaportal]] brushes.}}
{{Bug|Newer version (starting with 1.4.4 or later) may not launch{{cite|1}} on some systems (especially with systems with Windows 11 or localized version of the OS). Users can try to install latest version of Java and download the {{path|bspsrc-jar-only|zip}} version and run the {{file|bspsrc|jar}} file, or alternatively, use older version of BSPSource, or downgrade/upgrade/reinstall Windows.}}
{{note|Some maps protected from decompilation prevent the conversion. However, [[VMEX]] "Protection methods" like using '''No_decomp 1''', '''tools/locked''' and the '''obfuscation shape''' will be ignored. A warning will pop up, but it will decompile anyways.}}
{{note|Due to technical reasons, decompiling maps doesn't accurately recreate their original '''VMF''' state, often presenting issues such as invalid geometry solids, tools textures such as NPC Clip or Player Clip all replaced with either Nodraw or entirely replaced with NPC Clip or Player Clip which cause lighting issues or NPCs to get stuck, or misplaced [[areaportal]] brushes in the decompiled file. {{workaround|Decompiling the file again or more times may generate better results, such as avoiding some of these issues{{why}}.}} }}
{{note|If there is decompilation protection present, the conversion may be more difficult to work with.}}


== Console Commands ==
== BSP with File Packing ==
usage: bspsrc [options] <path> [path...]
In the tab "Other" set tick in in "Extract embedded files". Then put downloaded files in game directory.
{{note| BSPSource must be ran with java console via like java -jar <jarfile> args1 args2 etc. }}
{{note| Options must come first, example: java -jar "bspsrc.jar" -o "D:\programs x86\vmfs" "D:\bsps\arena_badlands.bsp"
Which will decompile arena_badlands.bsp and put the vmf into the path given. }}
{|class="standard-table" style="margin:1em 0;width:50%;white-space:pre-wrap"
! Cmd? !! Description
|-style="vertical-align:top"
| -d||style="word-break:break-all"|Enable debug mode. Increases verbosity and adds additional
|-style="vertical-align:top"
| -h,--help||style="word-break:break-all"|Prints the commands
|-style="vertical-align:top"
| -l <file>||style="word-break:break-all"|Use a text files with paths as input BSP file list.
|-style="vertical-align:top"
| -o <file>||style="word-break:break-all"|Override output path for VMF file(s). Treated as directory if multiple BSP files are provided.
default: <mappath>/<mapname>_d.vmf
|-style="vertical-align:top"
| -r||style="word-break:break-all"|Decompile all files found in the given directory.
|-style="vertical-align:top"
| -v||style="word-break:break-all"|Print version info.
|-style="vertical-align:top"
| -no_areaportals||style="word-break:break-all"|Don't write func_areaportal(_window) entities.
|-style="vertical-align:top"
| -no_brush_ents||style="word-break:break-all"|Don't write any brush entities.
|-style="vertical-align:top"
| -no_cubemaps||style="word-break:break-all"|Don't write env_cubemap entities.
|-style="vertical-align:top"
| -no_details||style="word-break:break-all"|Don't write func_detail entities.
|-style="vertical-align:top"
| -no_ladders||style="word-break:break-all"|Don't write func_ladder entities.
|-style="vertical-align:top"
| -no_occluders||style="word-break:break-all"|Don't write func_occluder entities.
|-style="vertical-align:top"
| -no_overlays||style="word-break:break-all"|Don't write info_overlay entities.
|-style="vertical-align:top"
| -no_point_ents||style="word-break:break-all"|Don't write any point entities.
|-style="vertical-align:top"
| -no_rotfix||style="word-break:break-all"|Don't fix instance entity brush rotations for Hammer.
|-style="vertical-align:top"
| -no_sprp||style="word-break:break-all"|Don't write prop_static entities.
|-style="vertical-align:top"
| -force_manual_areaportal||style="word-break:break-all"|Force manual entity mapping for areaportal entities
|-style="vertical-align:top"
| -force_manual_occluder||style="word-break:break-all"|Force manual entitiy mapping for occluder entities
|-style="vertical-align:top"
| -brushmode <enum>||style="word-break:break-all"|Brush decompiling mode:
BRUSHPLANES  - brushes and planes
ORIGFACE      - original faces only
ORIGFACE_PLUS - original + split faces
SPLITFACE    - split faces only
default: BRUSHPLANES
|-style="vertical-align:top"
| -no_brushes||style="word-break:break-all"|Don't write any world brushes.
|-style="vertical-align:top"
| -no_disps||style="word-break:break-all"|Don't write displacement surfaces.
|-style="vertical-align:top"
| -thickness <float>||style="word-break:break-all"|Thickness of brushes created from flat faces in
units.
default: 1.0
|-style="vertical-align:top"
| -bfacetex <string>||style="word-break:break-all"|Replace all back-face textures with this one.
Used in face-based decompiling modes only.
|-style="vertical-align:top"
| -facetex <string>||style="word-break:break-all"|Replace all face textures with this one.
|-style="vertical-align:top"
| -no_texfix||style="word-break:break-all"|Don't fix texture names.
|-style="vertical-align:top"
| -no_tooltexfix||style="word-break:break-all"|Don't fix tool textures.
|-style="vertical-align:top"
| -appid <string/int>||style="word-break:break-all"|Overrides game detection by using this Steam Application ID instead.
Use -appids to list all known app-IDs.
|-style="vertical-align:top"
| -appids||style="word-break:break-all"|List all available application IDs
|-style="vertical-align:top"
| -format <enum>||style="word-break:break-all"|
Sets the VMF format used for the decompiled maps:
AUTO - Automatic
OLD  - Source 2004 to 2009
NEW  - Source 2010 and later
default: AUTO
|-style="vertical-align:top"
| -no_cams||style="word-break:break-all"|Don't create Hammer cameras above each player spawm.
|-style="vertical-align:top"
| -no_lumpfiles||style="word-break:break-all"|Don't load lump files (.lmp) associated with the BSP file.
|-style="vertical-align:top"
| -no_prot||style="word-break:break-all"|
Skip decompiling protection checking. Can increase
speed when mass-decompiling unprotected maps.
|-style="vertical-align:top"
| -no_smart_unpack||style="word-break:break-all"|
Disable 'smart' extracting of embedded files.
Smart extracting automatically skips all files
generated by vbsp, that are only relevant to
running the map in the engine.
|-style="vertical-align:top"
| -no_visgroups||style="word-break:break-all"|Don't group entities from instances into visgroups.
|-style="vertical-align:top"
| -no_vmf||style="word-break:break-all"|Don't write any VMF files, read BSP only.
|-style="vertical-align:top"
| -unpack_embedded||style="word-break:break-all"|Unpack embedded files in the bsp.
|}


== BSPInfo ==
BSPInfo is a mode of BSPSource that instead of decompiling .bsp files, analyses them. Content such as: bsp version, compression type, checksums, AppID, lumps and compile parameters. It can also extract embedded files similarly to {{Gcfscape|2}}.
== See also ==
*{{hlusmd|4}} - GUI map decompiler for {{Gldsrc|4}}
== External links ==
* [https://github.com/ata4/bspsrc/releases BSPSource on GitHub]
* [https://www.oracle.com/java/technologies/downloads Latest Java] (optional, for 1.4.4 or later. This is only required if you are using {{path|bspsrc-jar-only|zip}} (which does not have Java bundled in.)
** After installing, try to run the {{path|bspsrc|jar}} executable, or type {{code|javaw -jar "C:\your-bspsrc-folder\bspsrc.jar"}} in Command Prompt (CMD).
* [https://www.java.com/download/ Java 8] (required in order to use BSPSource 1.4.3 or earlier)
{{references|1=
{{ref2|cite id=1|access-date=June 19, 2025|"[https://github.com/ata4/bspsrc/issues/180 Application not launching caused by "java.lang.IllegalArgumentException: Comparison method violates its general contract!"]". BSPSource. ''GitHub Issues''.}}
}}


== External Links ==
* [https://github.com/ata4/bspsrc/releases Original BSPSource on GitHub]
* [https://github.com/AnthonyPython/bspsrc/releases Anthonypython's CI fork on Github]
{{note|The fork has Github CI, which means anyone can do pull request change merges and a new build will be created automatically with newly-pushed changes.}}
[[Category:Third Party Tools]]
[[Category:Third Party Tools]]
[[Category:Level Design]]
{{sdktools|cat=0|0}}

Latest revision as of 01:14, 19 June 2025

English (en)Polski (pl)Русский (ru)Translate (Translate)
Screenshot of BSPSource.

Stub

This article or section is a stub. You can help by expanding it.

BSPSource BSPSource is a GUI map decompiler for Source Source games, written in Java Java.

Based on VMEX, it converts BSP files into VMF ones that can be loaded in Hammer. It also includes numerous bug fixes over VMEX and new features for doing the conversion, such as extracting embedded assets, processing multiple BSPs at once, and more.

Icon-Bug.pngBug:Newer version (starting with 1.4.4 or later) may not launch[1] on some systems (especially with systems with Windows 11 or localized version of the OS). Users can try to install latest version of Java and download the 🖿bspsrc-jar-only.zip version and run the 🖿bspsrc.jar file, or alternatively, use older version of BSPSource, or downgrade/upgrade/reinstall Windows.  [todo tested in ?]
Note.pngNote:Due to technical reasons, decompiling maps doesn't accurately recreate their original VMF state, often presenting issues such as invalid geometry solids, tools textures such as NPC Clip or Player Clip all replaced with either Nodraw or entirely replaced with NPC Clip or Player Clip which cause lighting issues or NPCs to get stuck, or misplaced areaportal brushes in the decompiled file.
PlacementTip.pngWorkaround:Decompiling the file again or more times may generate better results, such as avoiding some of these issues[Why?].
Note.pngNote:If there is decompilation protection present, the conversion may be more difficult to work with.

BSP with File Packing

In the tab "Other" set tick in in "Extract embedded files". Then put downloaded files in game directory.

BSPInfo

BSPInfo is a mode of BSPSource that instead of decompiling .bsp files, analyses them. Content such as: bsp version, compression type, checksums, AppID, lumps and compile parameters. It can also extract embedded files similarly to GCFScape GCFScape.

See also

External links

  • BSPSource on GitHub
  • Latest Java (optional, for 1.4.4 or later. This is only required if you are using 🖿bspsrc-jar-only.zip (which does not have Java bundled in.)
    • After installing, try to run the 🖿bspsrc.jar executable, or type javaw -jar "C:\your-bspsrc-folder\bspsrc.jar" in Command Prompt (CMD).
  • Java 8 (required in order to use BSPSource 1.4.3 or earlier)

References

References