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 bulk bsps #139

Open
snake-biscuits opened this issue Aug 15, 2023 · 6 comments
Open

Load bulk bsps #139

snake-biscuits opened this issue Aug 15, 2023 · 6 comments
Assignees
Labels
Apex Archive archiving Apex Legends releases enhancement New feature or request MegaTest test every .bsp you can find need test We need to write a test for regression testing refactor requires restructuring some backed stuff Titanfall Engine Applies to all Titanfall Engine branch scripts
Milestone

Comments

@snake-biscuits
Copy link
Owner

snake-biscuits commented Aug 15, 2023

Most times when I test things, I grab multiple maps at once
This involves typing the same block of code at the start of every session:

>>> import bsp_tool, fnmatch, os
>>> md = "E:/Mod/Titanfall"
>>> maps = {m[:-4]: bsp_tool.load_bsp(os.path.join(md, m)) for m in fnmatch.filter(os.listdir(md), "*.bsp")}

tests.utils.get_test_maps does a similar job, but doesn't overlap well w/ current needs
I would also like to feed the archive to gets w/ get_test_maps, as a pytest flag

tests.test_load_bsp.test_load_bsp

I'd like to break The MegaTest up into more functions
(seeing the name all typed out, it's so ugly; real MuffinMail.MuffinHash.MuffinHash energy)
Being able to target a specific chunk of the MegaTest would be nice
Also means the MegaTest is just for redundancy, new branches can be tested solo

The Apex Archive will require more robust tools

We need to be able to compare iterations of maps (extensions.diff needs more work too)
e.g. Titanfall: Beta -> Titanfall 2: Tech Test (PS4) -> Titanfall 2
And because of how manual the process is rn, Titanfall Engine depots/ are rarely looked at.

@snake-biscuits snake-biscuits added enhancement New feature or request need test We need to write a test for regression testing Titanfall Engine Applies to all Titanfall Engine branch scripts Apex Archive archiving Apex Legends releases labels Aug 15, 2023
@snake-biscuits snake-biscuits added this to the v1.0.0 milestone Aug 15, 2023
@snake-biscuits snake-biscuits self-assigned this Aug 15, 2023
@snake-biscuits
Copy link
Owner Author

spending all day on tools for The Apex Archive made me realise how bad it is

@snake-biscuits
Copy link
Owner Author

Would be nice to have bulk tools for the following branches:

Vindictus has over 400 maps, and we have 2 branches to manage w/ 3 StaticProp formats
Also ties into:

@snake-biscuits
Copy link
Owner Author

Loading all Titanfall 2 depots:

>>> import bsp_tool, os, fnmatch
>>> dd = "E:/Mod/Titanfall2/depot"
>>> depots = os.listdir(dd)
>>> sd = "game/r2/maps"
>>> maps = {f"{d}/{m[:-4]}": bsp_tool.load_bsp(os.path.join(dd, d, sd, m))
...         for d in depots
...         for m in fnmatch.filter(os.listdir(os.path.join(dd, d, sd)), "*.bsp")}

Inspecting workshop map listings is equally absurd (1 folder per "mod")
Could probably say the same for .pk3 (Quake III Dreamcast is hell)

@snake-biscuits snake-biscuits added the refactor requires restructuring some backed stuff label Oct 3, 2023
@snake-biscuits snake-biscuits changed the title [refactor] bulk processing inspect maps in bulk Oct 3, 2023
@snake-biscuits snake-biscuits added the MegaTest test every .bsp you can find label Aug 28, 2024
@snake-biscuits
Copy link
Owner Author

#195 is kinda revisiting this idea
But coming in from the angle of tests

Since we broke out autodetect into it's own script, bsp_tool/__init__.py is much less cluttered
I can see some proper functions for this

def bulk_load_bsp(special_dict: BulkDict, BspClass=None, branch=None):
    if BspClass is None or branch is None:
        use_autodetect = True
    ...

@snake-biscuits snake-biscuits moved this from Todo: Code to Todo: Research in bsp_tool Core Functionality Aug 28, 2024
@snake-biscuits snake-biscuits changed the title inspect maps in bulk Load bulk bsps Aug 28, 2024
@snake-biscuits
Copy link
Owner Author

We need some kind of standard object to return
Not just a {"map_name": bsp} dict
Where a .bsp comes from is important (which Apex season, .pak etc.)

@snake-biscuits snake-biscuits moved this from Todo: Research to Todo: Code in bsp_tool Core Functionality Aug 28, 2024
@snake-biscuits snake-biscuits moved this from Todo: Code to Todo: Research in bsp_tool Core Functionality Aug 28, 2024
@snake-biscuits
Copy link
Owner Author

I've mostly finished a refactor of tests.files that could work for this

>>> from tests import files
>>> search_area = {"Steam": {"Half-Life 2 (Ep1)": ["half-life 2/episodic/maps/"]}}
>>> from bsp_tool.valve import ValveBsp
>>> from bsp_tool.branches.valve import orange_box
>>> files.library_bsps(ValveBsp, {orange_box: search_area})
{"Steam | Half-Life 2 (Ep1) | credits.bsp": <ValveBsp 'credits.bsp' valve.orange_box (VBSP version 19)>,
 "Steam | Half-Life 2 (Ep1) | ep1_c17_00.bsp": <ValveBsp 'ep1_c17_00.bsp' valve.orange_box (VBSP version 20)>,
 ...}

NOTE: no autodetect, since it's for testing branch scripts & BspClasses

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apex Archive archiving Apex Legends releases enhancement New feature or request MegaTest test every .bsp you can find need test We need to write a test for regression testing refactor requires restructuring some backed stuff Titanfall Engine Applies to all Titanfall Engine branch scripts
Projects
Status: Todo: Research
Development

No branches or pull requests

1 participant