Facepunch / garrysmod-requests

Feature requests for Garry's Mod
83 stars 24 forks source link

bspzip functionality from 2013MP/TF2 (repacking/compressing) #2372

Open goodusername123 opened 2 months ago

goodusername123 commented 2 months ago

Details

The copy of bspzip included/compiled with Garry's Mod appears to be quite old (from some point before 2015) and as a result is entirely missing later functionality such as -repack which allows compressing and decompressing BSPs with LZMA compression (like what's used for some default TF2 maps and used for all TF2 workshop maps after a certain date). Also something that may or may not be missing is the ability to set a target path for -extractfiles however in my very sparse amount of testing I was unable to get -extractfiles to do anything in any copy of bspzip although it's probably because I'm doing something wrong, either way as a result I'm unsure if there is actually extra functionality for -extractfiles in newer versions of bspzip or just a case of the CMD printout being updated with info that was previously missing missing.

printout of Garry's Mod's bspzip:

Valve Software - bspzip.exe (Mar 21 2024)
usage:
bspzip -extract <bspfile> <blah.zip>
bspzip -extractfiles <bspfile>
bspzip -dir <bspfile>
bspzip -addfile <bspfile> <relativepathname> <fullpathname> <newbspfile>
bspzip -addlist <bspfile> <listfile> <newbspfile>
bspzip -addorupdatelist <bspfile> <listfile> <newbspfile>
bspzip -extractcubemaps <bspfile> <targetPath>
  Extracts the cubemaps to <targetPath>.
bspzip -deletecubemaps <bspfile>
  Deletes the cubemaps from <bspFile>.
bspzip -addfiles <bspfile> <relativePathPrefix> <listfile> <newbspfile>
  Adds files to <newbspfile>.

printout of some newer copy of bspzip:

Valve Software - bspzip.exe (Apr 19 2024)
usage:
bspzip -extract <bspfile> <blah.zip>
bspzip -extractfiles <bspfile> <targetpath>
bspzip -dir <bspfile>
bspzip -addfile <bspfile> <relativepathname> <fullpathname> <newbspfile>
bspzip -addlist <bspfile> <listfile> <newbspfile>
bspzip -addorupdatelist <bspfile> <listfile> <newbspfile>
bspzip -extractcubemaps <bspfile> <targetPath>
  Extracts the cubemaps to <targetPath>.
bspzip -deletecubemaps <bspfile>
  Deletes the cubemaps from <bspFile>.
bspzip -addfiles <bspfile> <relativePathPrefix> <listfile> <newbspfile>
  Adds files to <newbspfile>.
bspzip -repack [ -compress ] <bspfile>
  Optimally repacks a BSP file, optionally using compressed BSP format.
  Using on a compressed BSP without -compress will effectively decompress
  a compressed BSP.

​ ​ ​ Also something semi-unrelated that I would like to bring up as well (related to LZMA map compression but not bspzip) which I feel is too minor to request or question in another request/issue is that GMod is missing the lzma_persistent_buffer CVAR which is likely due to the fact it is seemingly specific to TF2's implementation of compressed BSPs as an attempt to Improve the situation with a problem on Mac OS and was never backported to 2013MP. While it's a very minor thing It would be nice if this CVAR was added as well even if it's probably only actually useful in extremely niche scenarios, although the same could be said for many other CVARs.