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

load_bsp branch detection can't tell some formats apart #17

Open
20 tasks
snake-biscuits opened this issue Oct 14, 2021 · 9 comments
Open
20 tasks

load_bsp branch detection can't tell some formats apart #17

snake-biscuits opened this issue Oct 14, 2021 · 9 comments
Assignees
Labels
ace_team.zeno_clash Zeno Clash branch script arkane.dark_messiah_mp Dark Messiah multiplayer branch script enhancement New feature or request gearbox.blue_shift Half-Life: Blue Shift branch script help wanted Extra attention is needed nexon.cso2_2018 Counter-Strike: Online 2 (post-2018) branch script nexon.vindictus Vindictus (Steam) branch script nexon.vindictus69 Vindictus branch script outerlight.outerlight The Ship branch script raven.hexen2 Hexen II branch script raven.soldier_of_fortune Soldier of Fortune branch script raven.soldier_of_fortune2 Soldier of Fortune II branch script refactor requires restructuring some backed stuff ritual.sin SiN branch script slow burn lots of work & will take a long time Source Engine Applies to all Source Engine branch scripts utoplanet.merubasu メルバス ブランチ スクリプト valve.alien_swarm Alien Swarm branch script valve.left4dead Left 4 Dead branch script valve.left4dead2 Left 4 Dead 2 branch script valve.source_filmmaker Source Filmmaker branch script
Milestone

Comments

@snake-biscuits
Copy link
Owner

snake-biscuits commented Oct 14, 2021

Need to bring more automation to auto-detect
Adding a new game should be as simple as writing a new branch script
Setting defaults for each (FILE_MAGIC, BSP_VERSION) may remain automated for a while though

Could default to mainline IdTech / Source Titles?

The way bsp headers are handled also needs to be refactored
VBSP v20 Vindictus, DarkMessiah headers & Ubertools .bsps don't play nice with the current system
Bsp base classes also don't do enough work, a lot of copy-pasted code needs to be eliminated

TRACKER: auto-detect added:

  • ace_team
    • Zeno Clash
  • arkane.dark_messiah_mp
    • Dark Messiah of Might & Magic Multiplayer
  • gearbox.blue_shift
    • Half-Life: Blue Shift
  • nexon.cso2_2018
    • Counter-Strike: Online 2
  • nexon.vindictus
    • Vindictus
  • nexon.vindictus69
    • Vindictus v1.69 EU
  • outerlight.outerlight
    • Bloody Good Time
    • The Ship
  • raven.hexen2
    • Hexen II
  • raven.soldier_of_fortune2
    • Soldier of Fortune 2
    • Star Wars Jedi Knight II: Jedi Outcast
  • raven.soldier_of_fortune
    • Soldier of Fortune
  • ritual.sin
    • SiN
    • SiN: Gold
  • utoplanet.merubasu
    • Fairy Tale Busters
  • valve.alien_swarm
    • Alien Swarm
    • Alien Swarm: Reactive Drop
  • valve.left4dead2
    • Left 4 Dead 2
  • valve.left4dead
    • Left 4 Dead
  • valve.source_filmmaker
    • Source Filmmaker
@snake-biscuits snake-biscuits added the enhancement New feature or request label Oct 14, 2021
@snake-biscuits snake-biscuits added this to the v0.4.0 milestone Oct 14, 2021
@snake-biscuits snake-biscuits self-assigned this Oct 14, 2021
@snake-biscuits
Copy link
Owner Author

Header clunk has been lessened, but base.Bsp methods still need work.
ValveBsp is preferred when QuakeBsp should be the default, as ancestor of all.

ValveBsp GAME_LUMP handling is clunky
Dynamically opening a bunch of files and indexing into them is kinda messy & doesn't suit every setup
Though it does make for an OK setup when comparing multiple .bsps, it makes complex operations slow
e.g. converting to blender geo

@snake-biscuits
Copy link
Owner Author

snake-biscuits commented Oct 23, 2021

Header parsing now works OK, but we need other identifiers for shared headers

ata4/bspsrc detects unique entity classnames to determine branch
This still isn't 100% accurate as unique entities may not always be present
Still could be a deciding factor in cases where lump sizes match, however

checking the filepath for game names could help, but ideally all info needed should be in the .bsp

CSO2's split (pre/post 2018) will likely need to be determined by lump size, as filepath and entities likely didn't change much
(no determinant has been found yet anyway)

@snake-biscuits snake-biscuits added the help wanted Extra attention is needed label Nov 29, 2021
@snake-biscuits
Copy link
Owner Author

Grabbing a list of potential branch scripts & hooking just the header reads from bsp classes might be a valid approach

Filemagic -> BspClass must be decided first
Checking all lump sizes will not confirm a .bsp's format 100% of the time
(raise a UserWarning if checking lumps sizes doesn't confirm the format)

This also requires checking for compressed lumps if ValveBsp or a subclass of ValveBsp
And incomplete / incorrect branch scripts will break this method anyway
So no matter what difficult to indentify .bsps will cause issues somewhere for the user if they don't already know it's origin

More documentation around these cases is needed!

NOTE: we do have some strings in branch scripts to try using filepaths as a hint (but this should only be an option with clear warnings)

@snake-biscuits
Copy link
Owner Author

snake-biscuits commented Feb 28, 2022

ValveBsp is preferred when QuakeBsp should be the default, as ancestor of all.

commit 2a60a1f brought base.Bsp more inline with QuakeBsp, removing all references to versioned lumps

This means the more common QuakeBsp subclasses are no longer aligned with ValveBsp by default
And the inheritance tree of all BspClasses now better reflects the engine family tree

@snake-biscuits
Copy link
Owner Author

Considering that at present we have no way of guaranteeing the branch_script of any .bsp in these edge cases, we 100% need to give the user a warning that the automatically selected branch_script may be incorrect

Corrupted & encrypted .bsps will likely also create all sorts of issues

@snake-biscuits snake-biscuits added the slow burn lots of work & will take a long time label Dec 17, 2022
@snake-biscuits
Copy link
Owner Author

#16 having a bunch of very similar minimum viable maps would be very useful for this
mp_lobby.bsp simple box & light likely won't have any distinct entities or lumps
Telling maps that basic apart would make for a great test.

@snake-biscuits snake-biscuits changed the title load_bsp is clunky and far too manual load_bsp branch detection can't tell some formats apart Dec 17, 2022
@snake-biscuits snake-biscuits modified the milestones: v0.4.0, v0.5.0 Jan 25, 2023
@snake-biscuits snake-biscuits modified the milestones: v0.5.0, v1.0.0 Mar 17, 2023
@snake-biscuits
Copy link
Owner Author

Drawing clues from the paths of .bsps will be hugely helpful
But we should really build a database of key identifiers (unique entities, struct sizes etc.)

@snake-biscuits
Copy link
Owner Author

wfowler1/LibBsp also has a fair few autodetect methods for various formats

Including some bsp formats we don't support yet... (cod1 demo & stef2 demo)
Found 2 cod 1 sp demos CallOfDutyView.net
STEF2's demo is available on the internet archive
Installers only though, not the extracted files

@snake-biscuits snake-biscuits added Source Engine Applies to all Source Engine branch scripts ace_team.zeno_clash Zeno Clash branch script arkane.dark_messiah_mp Dark Messiah multiplayer branch script gearbox.blue_shift Half-Life: Blue Shift branch script nexon.cso2_2018 Counter-Strike: Online 2 (post-2018) branch script nexon.vindictus Vindictus (Steam) branch script labels Sep 6, 2023
@snake-biscuits snake-biscuits added nexon.vindictus69 Vindictus branch script outerlight.outerlight The Ship branch script raven.hexen2 Hexen II branch script raven.soldier_of_fortune Soldier of Fortune branch script raven.soldier_of_fortune2 Soldier of Fortune II branch script ritual.sin SiN branch script utoplanet.merubasu メルバス ブランチ スクリプト valve.alien_swarm Alien Swarm branch script valve.left4dead Left 4 Dead branch script valve.left4dead2 Left 4 Dead 2 branch script valve.source_filmmaker Source Filmmaker branch script labels Sep 6, 2023
@snake-biscuits
Copy link
Owner Author

A lot of Source Engine version conflicts come down to StaticProp version
We could write a barebones VBSP inspector to check the SPRP version & size (from num_props)

@snake-biscuits snake-biscuits added the refactor requires restructuring some backed stuff label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ace_team.zeno_clash Zeno Clash branch script arkane.dark_messiah_mp Dark Messiah multiplayer branch script enhancement New feature or request gearbox.blue_shift Half-Life: Blue Shift branch script help wanted Extra attention is needed nexon.cso2_2018 Counter-Strike: Online 2 (post-2018) branch script nexon.vindictus Vindictus (Steam) branch script nexon.vindictus69 Vindictus branch script outerlight.outerlight The Ship branch script raven.hexen2 Hexen II branch script raven.soldier_of_fortune Soldier of Fortune branch script raven.soldier_of_fortune2 Soldier of Fortune II branch script refactor requires restructuring some backed stuff ritual.sin SiN branch script slow burn lots of work & will take a long time Source Engine Applies to all Source Engine branch scripts utoplanet.merubasu メルバス ブランチ スクリプト valve.alien_swarm Alien Swarm branch script valve.left4dead Left 4 Dead branch script valve.left4dead2 Left 4 Dead 2 branch script valve.source_filmmaker Source Filmmaker branch script
Projects
Status: Todo: Research
Development

No branches or pull requests

1 participant