Patching levels with lump files: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Removed notice that vbspinfo isn't released.)
No edit summary
 
(30 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Half-Life 2: Episode One]] added a simple system to allow mapmakers to patch levels by shipping only the level lumps that have changed. It was written to handle any .bsp file lump, but right now it's really only useful for lumps that don't depend on other lumps, until a tool exists that will find all the changed lumps. For example, changing geometry in a map changes many lumps, and each changed lump would need to be selected by hand. Once many lumps have been changed, you may as well ship a new .bsp.
{{since|{{src06}}}}{{also|{{titanfall branch}}{{gmod}}}}


For now, it's a great way of shipping new entity lumps, or new game data lumps without having to re-ship the entire .bsp.
{{hl2ep1|4}} added a simple system to allow mapmakers to patch levels by shipping only the [[LMP|level lumps]] that have been altered. It is usually used to update entity lumps, changing a .BSP file's entities without a recompile necessary.


== Creating and using new lumps ==
Technically, it is written to handle any .BSP file lump, but there are lumps that itself heavily depend on other lumps. For example, altered geometry in a map, even slightly, changes many lumps, and thus each changed lump would need to be verified by hand. Once this many lumps have been changed, until tools made for checking altering lumps have been setup, you may as well compile a new .BSP file.
 
{{Example|In {{portal|1}}, it includes {{code|escape_02_l_0.lmp}}, along with lump for two background maps. The former is used to add extended ending (where Chell is being dragged by Party Escort Bot), introduced with [https://combineoverwiki.net/wiki/Portal_ARG#March_3.2C_2010 Portal 2 ARG update] (3/3/2010).}}
{{important|This feature is disabled in {{hl2dm|4}}, {{bms|4}} and most{{confirm}} other multiplayer games. The reason is mentioned [https://github.com/ValveSoftware/Source-1-Games/issues/2224#issuecomment-293333039 here].}}
 
== Creating and using new entity lumps ==
The steps involved are as follows (assuming that a previous version of the .bsp file has already been shipped):
The steps involved are as follows (assuming that a previous version of the .bsp file has already been shipped):


# Make a backup copy of the current .bsp.
# Make a backup copy of the current .bsp.
# Make the desired changes to the level, and compile a new .bsp.
# Make the desired changes to the level, and compile a new (revised) .bsp.
# Use <code>"%sourcesdk%\bin\vbspinfo" -X ''bspname''</code> to extract the desired lumps into .lmp files.
# Use <code>"%sourcesdk%\bin\vbspinfo" -X ''bspname''</code> to extract the entity lump into a .lmp file.
#:{{note|The .lmp file will be created in the same directory as the input .bsp.}}
#:{{note|The .lmp file will be created in the same directory as the input .bsp.}}
# Put the .lmp files into your ''gamedir''\maps directory (if they aren't already), and ensure their <id> numbers are correct (see below).
# Put the .lmp files into your ''gamedir''\maps directory (if they aren't already), and ensure their <id> numbers are correct (see below).
# Make a backup copy of the revised .bsp.
# Make a backup copy of the revised .bsp.
# Restore the backup of the old .bsp, and test it with the new .lmp.
# Restore the backup of the ''old'' .bsp, and run the map to test it with the new .lmp. Make sure it works properly with the updated entities.
# Ship the .lmp files only.
# Ship the .lmp files only.


Line 20: Line 25:
  <bsp name>_l_<id>.lmp
  <bsp name>_l_<id>.lmp


After loading the .bsp, the engine will then load .lmp files starting at id 0, and stopping as soon as it fails to find a .lmp for the next id. Each .lmp file overrides any existing lump in the .bsp, or preceding .lmp files. If a new lump has already been shipped as a <code><bsp_name>_l_0.lmp</code> file, that lump can overridden with a <code><bsp_name>_l_1.lmp</code> file.
After loading the .bsp, the engine will then load .lmp files starting at id 0, and stopping as soon as it fails to find a .lmp for the next id. Each .lmp file overrides an existing lump in the .bsp with the corresponding lump type, or preceding .lmp files. If a new lump has already been shipped as a<code><bsp_name>_l_0.lmp</code>file, that lump can be avoided being overridden with a<code><bsp_name>_l_1.lmp</code>file.
 
In the Left 4 Dead series, you may end up with lumps that contain the letters <code>_h_</code> and <code>_s_</code>. These are specifically used for Survival and Scavenge respectively.
 
== Hammer compile profile ==
 
The following lines of code can be entered into Hammer's advanced compile dialogue to automate lump creation of the entity lump:
 
'''$bsp_exe'''
-game $gamedir -onlyents -keepstalezip $path\$file
 
'''C:\Program Files\Steam\steamapps\common\<game-name>\bin\vbspinfo'''
-x0 $path\$file.bsp
 
'''Copy File'''
$path\$file_l_0.lmp $bspdir\$file_l_0.lmp
 
'''Delete File'''
$path\$file_l_0.lmp
 
If you are creating a lump file with an ID number other than zero, change the last two commands accordingly.
 
Note also that a Hammer bug currently prevents the use of <code>$SteamUserDir</code> or <code>%sourcesdk%</code> in the second command; using either will lead to "access denied" error messages.
 
== See also ==
* [[Source BSP File Format]]
* [[Lump file format]]
 
[[Category:Source]]
 
[[Category:Level Design]]
[[Category:Publicity & Publication]]

Latest revision as of 01:05, 15 June 2025

(in all games since Source 2006)(also in Titanfall branchGarry's Mod)

Half-Life 2: Episode One Half-Life 2: Episode One added a simple system to allow mapmakers to patch levels by shipping only the level lumps that have been altered. It is usually used to update entity lumps, changing a .BSP file's entities without a recompile necessary.

Technically, it is written to handle any .BSP file lump, but there are lumps that itself heavily depend on other lumps. For example, altered geometry in a map, even slightly, changes many lumps, and thus each changed lump would need to be verified by hand. Once this many lumps have been changed, until tools made for checking altering lumps have been setup, you may as well compile a new .BSP file.

PlacementTip.pngExample:In Portal, it includes escape_02_l_0.lmp, along with lump for two background maps. The former is used to add extended ending (where Chell is being dragged by Party Escort Bot), introduced with Portal 2 ARG update (3/3/2010).
Icon-Important.pngImportant:This feature is disabled in Half-Life 2: Deathmatch Half-Life 2: Deathmatch, Black Mesa Black Mesa and most[confirm] other multiplayer games. The reason is mentioned here.

Creating and using new entity lumps

The steps involved are as follows (assuming that a previous version of the .bsp file has already been shipped):

  1. Make a backup copy of the current .bsp.
  2. Make the desired changes to the level, and compile a new (revised) .bsp.
  3. Use "%sourcesdk%\bin\vbspinfo" -X bspname to extract the entity lump into a .lmp file.
    Note.pngNote:The .lmp file will be created in the same directory as the input .bsp.
  4. Put the .lmp files into your gamedir\maps directory (if they aren't already), and ensure their <id> numbers are correct (see below).
  5. Make a backup copy of the revised .bsp.
  6. Restore the backup of the old .bsp, and run the map to test it with the new .lmp. Make sure it works properly with the updated entities.
  7. Ship the .lmp files only.

ID numbers

.lmp files are automatically named in the following format:

<bsp name>_l_<id>.lmp

After loading the .bsp, the engine will then load .lmp files starting at id 0, and stopping as soon as it fails to find a .lmp for the next id. Each .lmp file overrides an existing lump in the .bsp with the corresponding lump type, or preceding .lmp files. If a new lump has already been shipped as a<bsp_name>_l_0.lmpfile, that lump can be avoided being overridden with a<bsp_name>_l_1.lmpfile.

In the Left 4 Dead series, you may end up with lumps that contain the letters _h_ and _s_. These are specifically used for Survival and Scavenge respectively.

Hammer compile profile

The following lines of code can be entered into Hammer's advanced compile dialogue to automate lump creation of the entity lump:

$bsp_exe
-game $gamedir -onlyents -keepstalezip $path\$file
C:\Program Files\Steam\steamapps\common\<game-name>\bin\vbspinfo
-x0 $path\$file.bsp
Copy File
$path\$file_l_0.lmp $bspdir\$file_l_0.lmp
Delete File
$path\$file_l_0.lmp

If you are creating a lump file with an ID number other than zero, change the last two commands accordingly.

Note also that a Hammer bug currently prevents the use of $SteamUserDir or %sourcesdk% in the second command; using either will lead to "access denied" error messages.

See also