Open snake-biscuits opened 1 year ago
spending all day on tools for The Apex Archive made me realise how bad it is
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:
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)
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
...
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.)
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
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:
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 apytest
flagtests.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 soloThe 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 Enginedepots/
are rarely looked at.