Skip to content

Releases: snake-biscuits/bsp_tool

v0.5.0

01 Aug 12:57
Compare
Choose a tag to compare

New Status Quo

After almost a year and a half it's time to ship a new version
Massive changes have been made since 0.4.0
So much so I cannot help people using the old version because I forget how it works

Many systems have been either gutted or redesigned
This will probably continue in future:

  • many extensions need some serious refactors (decompile, diff & editor)
  • loading from & saving to files is going to change drastically in the next version

But before making those large changes we should at least ship some stable
So here it is, v0.5.0, the New Status Quo

NOTE: changes are pulled from CHANGELOG.md, which probably misses a bunch of stuff

Changelog

New

  • __init__ methods for all SpecialLumpClasses
  • branches.colour
  • branches.ieee754
    • Float32 BitField reversing helper
  • extensions.editor
    • parse .map & .vmf
    • compare uncompiled maps to .bsp
  • utils
    • binary
    • editor
    • geometry
    • physics
    • texture
  • NexonBsp
    • thanks cso2 big-endian fourCC
  • BSPX lumps can be parsed with bspx.BspX

Changed

  • SpecialLumpClasses & GameLumpClasses refactor
    • new basic __init__ for making your own from scratch
    • loaded from files with from_bytes
  • BspLump refactor
    • new barebones __init__
    • maps bsp lumps with from_header
    • pulled out of streams with from_count
    • lumps.create_RawBspLump will decompress before mapping
    • added append, extend & insert methods to RawBspLump
    • BspLump.find(attr=val) method is now .search()
    • removed .find() method from BasicBspLump
    • allowed implicit changes (e.g. bsp.VERTICES[0].z += 1)
    • __iter__ doesn't update _changes, reducing unnessecary caching
    • TODO: bsp.LUMP[::] creates a copy & doesn't affect / share _changes
    • RawBspLump slices are bytearrays
  • Fractured Source Engine into more branches ("solves" version conflicts of SPRP formats)
  • extensions.archives refactor
    • One script per-developer
    • Placeholders for not-yet-supported archives
    • MeruBasu utoplanet.Apk can extract files
    • Titanfall respawn.Vpk can list files (no extraction)
  • Capturing compiler signatures
    • RespawnBsp MRVN-Radiant signature
      • saved by .save_as
      • parser in extensions.compiler_signature
  • Moved valve_physics to valve.physics
  • RespawnBsp .save_as() can now skip .bsp_lump
  • respawn.ExternalLumpManager now handles .bsp_lump saving
  • added leaves_of_node method to most branch scripts
  • methods of branch scripts are now stored in dict
  • Moved branches.vector to utils.vector

Fixed

  • shared.Entities the following silent failures are now caught by the parser
    • curly braces inside key values
    • multi-line keys
  • shared.PakFile can be edited
    • .as_bytes() correctly includes "end record", without calling .close()

Newly Supported Branches

  • Genesis3D
  • Id Tech 2
    • Qbism
    • Quake 64
  • IW Engine
    • Call of Duty 1 SP Demo: Burnville
    • Call of Duty 1 SP Demo: Dawnville
  • Source Engine
    • Fairy Tale Busters (メルヘソバスターズ)
    • Zeno Clash
  • Titanfall Engine
    • Apex Legends Season 13-18
    • Apex Legends Season 18+
  • Ubertools
    • Star Trek Elite Force II SP Demo

Updated Support

  • Quake
  • Source Engine
    • More dynamic reading of Static Props
    • Split into more branches for Static Prop variants
  • Titanfall Engine
    • Split v50 into it's own branch

The big refactor

28 Mar 09:55
Compare
Choose a tag to compare

After almost 2 years, I finally got a fresh release out.
Hopefully the next release won't take as long

TL;DR

Totally changed how LumpClasses work (SpecialLumpClasses are next)
Rebuilt branch script detection (still incomplete)
Split handles for internal & external lumps (can see both at once)
Massively reduced RAM consumption (more reductions to come)
Added branch scripts for pretty much every game/engine I want to support

New

  • Added support for Ritual Entertainment's Ubertools (Quake III Engine Branch)
  • If autoload cannot find the specified .bsp file a UserWarning is issued
  • Support for ValveBsp & RespawnBsp Xbox360 formats (.360.bsp)

Changed

  • Moved physics SpecialLumpClasses to branches/shared/physics.py
  • Fixed up GAME_LUMP.sprp errors across source, left4dead & source_2013
  • Updated both base.Struct & base.MappedArray
    • built in asserts to verify accurate definitions
    • rebuilt __init__ method, can now generate blank
    • added _bitfields attr, defines child base.BitFields
    • added _classes attr, overrides class of named attr
    • added as_bytes method
    • added as_cpp method
    • added from_bytes method
    • added from_stream method
    • added from_tuple method (replaces old __init__ behaviour)
  • Added base.BitField for more reliable bitfield mapping
    • behaves similarly to base.MappedArray
  • Completely refactored branch_script detection
    • only file_magic & bsp_version matter (unless .d3dbsp)
    • load_bsp now only accepts a branch_script as it's optional argument
  • RespawnBsp .ent file headers moved to RespawnBsp.entity_headers
  • RespawnBsp .bsp_lump moved to bsp.external
    • Uses the respawn.ExternalLumpManager
    • .bsp_lump are only opened when accesed via bsp.external.LUMP_NAME
  • "MegaTest" RAM usage significantly reduced
  • ArkaneBsp has been rolled into ValveBsp
  • LumpHeader now use bsp.branch.LumpHeader instead of collections.namedtuple
  • Support for ValveBsp & RespawnBsp x360 (big-endian) formats
  • Caught some unexpected behaviour with GAME_LUMP_CLASS dict deepcopies

Newly Supported Branches

  • Infinity Ward Engine
    • Call of Duty 2
    • Call of Duty 4: Modern Warfare
  • Ion Storm IdTech
    • Daikatana
  • Respawn Engine
    • Titanfall (Xbox360)
  • Source Engine
    • Half-Life 2 (Xbox)
    • Infra
    • Momentum Mod
    • Orange Box (Xbox360)
    • Portal 2 (Xbox360)
    • Tactical Intervention
    • Vampire the Masquerade: Bloodlines
  • Ubertools

Updated Support

  • Id Tech 3
    • Quake III Arena
    • Raven Software Titles
  • Infinity Ward Engine
    • Call of Duty
  • Quake Engine
    • Hexen II
  • Source Engine
  • Titanfall Engine

Merged Pull Requests

  • Added missing slot for apex_legends VertexLitBump by @r-ex in #18
  • add plane to CM_BRUSHES by @BobTheBob9 in #22

New Contributors

Full Changelog: v0.3.1...v0.4.0

PhysicsCollide & Blue Shift Support

04 Oct 07:18
Compare
Choose a tag to compare

Quick patch adding PhysicsCollide Lump support to both the Source & Titanfall Engines
This patch also brings support for Half-Life: Blue Shift

Broader Game Support

29 Sep 02:30
Compare
Choose a tag to compare

This version brings many changes to how files are handled, and supports a large number of games
More big refactors to come, to help with handling associated files & saving changes back to the .bsp

New

  • Added load_bsp function to identify bsp type
  • Added D3DBsp, IdTechBsp, RespawnBsp & ValveBsp classes
  • Added general support for the PakFile lump
  • Added general support for the GameLump lump
  • Extension scripts
    • archive.py extractor for CoD .iwd / Quake .pk3
    • diff.py compare bsps for changelogs / study
    • lightmaps.py bsp lightmap -> .png
  • Made a basic C++ 17 implementation in src/

Changed

  • Bsp lumps are loaded dynamically, reducing memory usage
    • New wrapper classes can be found in bsp_tool/lumps.py
  • mods/ changed to branches/
    • Added subfolders for developers
    • Helpful lists for auto-detecting a .bsp's origin
    • Renamed team_fortress2 to valve/orange_box
  • LumpClasses now end up in 3 dictionaries per branch script
    • BASIC_LUMP_CLASSES for types like short int
    • LUMP_CLASSES for standard LumpClasses
    • SPECIAL_LUMP_CLASSES for irregular types (e.g. PakFile)
    • GAME_LUMP_CLASSES for GameLump SpecialLumpClasses
  • Bsps no longer print to console once loaded
  • Base.Bsp & subclasses have reserved ALL CAPS member names for lumps only
    • BSP_VERSION, FILE_MAGIC, HEADERS, REVISION -> bsp_version, file_magic, headers, revision
  • TODO: load external lumps and internal lumps at the same time

New Supported Games

  • GoldSrc Engine (excluding Half-Life: Blue Shift)
  • Quake II
  • Quake 3 Arena
  • Source Engine

Broken Support

  • Call of Duty
  • Dark Messiah of Might and Magic
  • Half-Life: Blue Shift
  • Quake

Updated Game Support

  • Apex Legends
  • Orange Box
  • Titanfall
  • Titanfall 2