Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSPX Test Maps #188

Open
3 of 15 tasks
snake-biscuits opened this issue Jun 14, 2024 · 1 comment
Open
3 of 15 tasks

BSPX Test Maps #188

snake-biscuits opened this issue Jun 14, 2024 · 1 comment
Labels
help wanted Extra attention is needed MegaTest test every .bsp you can find slow burn lots of work & will take a long time

Comments

@snake-biscuits
Copy link
Owner

2a5433b has added support for BSPX12
I'd like to build out LumpClasses for every known lump type
At present I've only found Quake II Re-Release maps w/ BSPX data
https://github.com/ericwa/ericw-tools/ can generate some BSPX lumps, but not all3

A few lumps are deprecated / made redundant by other implementations

  • FACENORMALS is an ericw replacement for VERTEXNORMALS
  • DECOMPLED_LM replaces all LM* lumps

We aren't going to find 1 map with every lump type at once
Making maps with some BSPX lumps might require sourcing outdated versions of current compilers

If we do end up tracking down older tools, we should document & archive them
Could be helpful for dating older maps

Lump Samples

  • BRUSHLIST
  • DECOUPLED_LM
  • ENVMAP
  • FACENORMALS
  • LIGHTGRID_OCTREE
  • LIGHTINGDIR
  • LIGHTING_E5BGR9
  • LMOFFSET
  • LMSHIFT
  • LMSTYLE
  • LMSTYLE16
  • RGBLIGHTING
  • SURFENVMAP
  • VERTEXNORMALS
  • ZIP_PAKFILE

Footnotes

  1. Valve Developer Community - BSPX

  2. https://github.com/fte-team/fteqw/ on GitHub - specs/bspx.txt

  3. https://github.com/ericwa/ericw-tools/ on GitHub - include/common/bspxfile.hh

@snake-biscuits snake-biscuits added help wanted Extra attention is needed MegaTest test every .bsp you can find labels Jun 14, 2024
@snake-biscuits
Copy link
Owner Author

Here's how I confirmed the BSPX lumps available in Quake II's Re-Release:

>>> import bsp_tool, os, fnmatch
>>> md = "E:/Mod/QuakeII/rerelease/pak0/maps/"
>>> maps = {m[:-4]: bsp_tool.load_bsp(os.path.join(md, m)) for m in fnmatch.filter(os.listdir(md), "*.bsp")}
>>> subfolders = {d for d in os.listdir(md) if os.path.isdir(os.path.join(md, d))}
>>> maps.update({
...     f"{sd}/{m}"[:-4]: bsp_tool.load_bsp(os.path.join(md, sd, m))
...     for sd in subfolders
...     for m in fnmatch.filter(os.listdir(os.path.join(md, sd)), "*.bsp")})
... 
>>> from bsp_tool.bspx import BspX
>>> bspx_maps = {m: b for m, b in maps.items() if b"BSPX" in b._tail()}
>>> {L for b in bspx_maps.values() for L in BspX.from_bsp(b).headers.keys()}
{'DECOUPLED_LM', 'FACENORMALS', 'LIGHTGRID_OCTREE'}

A BspX is fairly similar to a BspClass, though it doesn't hold a copy of the file
BspX also only uses a single branch branches.bspx

branches.bspx is quake style; there is no version in bspx.LumpHeader
bspx.LumpHeader contains lumps names, limited to 24 chars each
Since lump indices don't matter bspx.LUMPS: Set[str] is used, rather than bspx.LUMP: Enum.enum
BSP_VERSION / GAME_VERSIONS don't appear, as the BSPX header isn't versioned
Other than that, branches.bspx is extremely similar to any other branch script
(this includes mounting methods, which can be useful for linking bspx lumps to bsp lumps)

@snake-biscuits snake-biscuits moved this to Todo: Research in bsp_tool Format Coverage Jun 14, 2024
@snake-biscuits snake-biscuits added the slow burn lots of work & will take a long time label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed MegaTest test every .bsp you can find slow burn lots of work & will take a long time
Projects
Status: Todo: Research
Development

No branches or pull requests

1 participant