Bring the graphics-dev collaborator's dpl3-revive into the repo as first-class
project code (they've handed it off; it's ours now). This is the proven
Division renderer that our in-process rt_draw has been trying to be.
What's here:
- parser/ B2Z/V2Z/SVT/SCN/SPL/BGF/BMF/BSL decoders (pure Python).
- spec/ reverse-engineered format + the definitive VelociRender wire
protocol (from the original DIVISION source, matches our live
VPX node/action tables exactly).
- source-ref/ read-only copies of the original DIVISION C (BIZREAD.C,
DPLTYPES.H, DPL.H) that define the formats.
- patha/ the "virtual VelociRender board": vrboard.py (24-action protocol
server), vrview.py (numpy software rasterizer, the reference),
vrview_gl.py (moderngl GPU backend, 832x512@60Hz), plus the
run/replay/regress tooling and evidence renders. Drives FLYK/BLADE/
Star Trek demos AND our btl4opt/rpl4opt game binaries.
- viewer/ WebGL archive generators (.py); prebuilt HTML/data regeneratable.
- samples/ small test models/textures.
- bt*.raw.bin real BTL4OPT arena wire captures (kept for offline renderer
testing/regression against OUR game).
.gitignore keeps the multi-hundred-MB demo capture dumps + debug logs +
regeneratable viewer bundles out of history (they stay on disk).
Phase 0 of the integration is validated: their board decodes our bt8 capture
with zero errors (3748 nodes, 507 instances, 4 mechs) and renders our arena
(terrain/dome/sky, correct Division DAC gamma). Plan + status in memory;
integration continues in emulator/RENDERER-COLLAB.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
70 lines
2.8 KiB
Python
70 lines
2.8 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
gen_launchers.py -- generate one Windows .bat per runnable staged scene
|
|
(patha\\launch\\RUN_<PRODUCT>_<SCENE>.BAT), each starting the virtual board +
|
|
window + DOSBox via run_demo.py. Also writes launch\\MENU.BAT (a picker).
|
|
|
|
Skips scenes in the MUNGA key=value dialect (they hang FLYK's parser) and the
|
|
known cwd-only loaders (HPDAVE BDEMO/SAND/TEMP).
|
|
|
|
python gen_launchers.py
|
|
"""
|
|
import os, re, glob
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
STAGE = r"c:\temp\flykc"
|
|
OUT = os.path.join(HERE, "launch")
|
|
SKIP = {("HPDAVE", "BDEMO"), ("HPDAVE", "SAND"), ("HPDAVE", "TEMP")}
|
|
|
|
|
|
def munga_dialect(path):
|
|
"""MUNGA map-scenes use key=value lines (viewangle=60.0) FLYK can't read."""
|
|
try:
|
|
head = open(path, encoding='latin1').read(600)
|
|
except OSError:
|
|
return True
|
|
return bool(re.search(r'(?m)^\s*(viewangle|clip|fog|backgnd)\s*=', head))
|
|
|
|
|
|
def main():
|
|
os.makedirs(OUT, exist_ok=True)
|
|
entries = []
|
|
for prod in ("HPDAVE", "STDAVE", "RPDAVE", "BTDAVE", "FX"):
|
|
pdir = os.path.join(STAGE, prod)
|
|
if not os.path.isdir(pdir):
|
|
continue
|
|
for scn in sorted(glob.glob(os.path.join(pdir, "*.SCN"))):
|
|
name = os.path.splitext(os.path.basename(scn))[0].upper()
|
|
if (prod, name) in SKIP or munga_dialect(scn):
|
|
continue
|
|
# ambient particle sim only where it belongs (underwater HPDAVE)
|
|
sfx = " --sfx" if (prod, name) in {
|
|
("HPDAVE", "SHARKS"), ("HPDAVE", "SDEMO"), ("HPDAVE", "BDDEMO"),
|
|
("HPDAVE", "FISHSPLS"), ("HPDAVE", "BDPAL")} else ""
|
|
bat = os.path.join(OUT, f"RUN_{prod}_{name}.BAT")
|
|
with open(bat, "w") as fp:
|
|
fp.write(
|
|
"@echo off\r\n"
|
|
f"rem {prod}\\{name}.SCN on the virtual VelociRender board\r\n"
|
|
f"cd /d \"{HERE}\"\r\n"
|
|
f"python run_demo.py {name} --dir {prod} --prefix {name.lower()}{sfx}\r\n"
|
|
"pause\r\n")
|
|
entries.append((prod, name))
|
|
print(f" RUN_{prod}_{name}.BAT")
|
|
|
|
with open(os.path.join(OUT, "MENU.BAT"), "w") as fp:
|
|
fp.write("@echo off\r\nsetlocal enabledelayedexpansion\r\n:menu\r\ncls\r\n"
|
|
"echo === DPL3 virtual VelociRender scene launcher ===\r\necho.\r\n")
|
|
for i, (prod, name) in enumerate(entries, 1):
|
|
fp.write(f"echo {i:3}. {prod:8} {name}\r\n")
|
|
fp.write("echo.\r\nset /p pick=scene number (or Q): \r\n"
|
|
"if /i \"%pick%\"==\"Q\" exit /b\r\n")
|
|
for i, (prod, name) in enumerate(entries, 1):
|
|
fp.write(f"if \"%pick%\"==\"{i}\" call \"%~dp0RUN_{prod}_{name}.BAT\"\r\n")
|
|
fp.write("goto menu\r\n")
|
|
print(f"\n{len(entries)} launchers + MENU.BAT -> {OUT}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|