Files
CydandClaude Fable 5 afc3fd839e Vendor dpl3-revive: the Division/DPL3 renderer, now ours
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>
2026-07-05 22:06:25 -05:00

74 lines
3.0 KiB
Python

#!/usr/bin/env python3
"""
scan_scenes.py -- inventory the .SCN files in sda4\HPDAVE: search paths, entities,
spline/event refs, and how many of the referenced objects resolve against surviving
files (checked with the shipped loader's extensions: .BGF/.BMF/.BSL/.TGA/.VTX,
plus .B2Z which staging exposes as .BGF).
python scan_scenes.py
"""
import os, re, glob
SRC = r"s:\OneDrive\Tesla III\DaveMcCoy\sda4"
HP = os.path.join(SRC, "HPDAVE")
LOAD_EXTS = ('.BGF', '.B2Z', '.BMF', '.BSL', '.VTX')
def build_index(dirs):
idx = {}
for d in dirs:
if not os.path.isdir(d):
continue
for f in os.listdir(d):
base, ext = os.path.splitext(f.upper())
if ext in LOAD_EXTS:
idx.setdefault(base, set()).add(ext)
return idx
def main():
for scn in sorted(glob.glob(os.path.join(HP, "*.SCN"))):
try:
text = open(scn, encoding='latin1').read()
except OSError:
continue
lines = [l.split('//')[0].strip() for l in text.splitlines()]
geo_paths, statics, dynamics, spls, other = [], [], [], [], []
for l in lines:
if not l:
continue
t = l.split()
kw = t[0].upper()
if kw == 'GEOMETRY' and len(t) > 1:
geo_paths.append(t[1])
elif kw == 'STATIC' and len(t) > 1:
statics.append(t[1].lower())
elif kw in ('DYNAMIC', 'PATH') and len(t) > 1:
dynamics.append(t[1].lower())
for x in t[2:]:
if x.lower().endswith('.spl'):
spls.append(x.lower())
elif kw in ('SPECIALFX', 'SCROLL', 'NOVIEWMATRIX'):
if kw == 'NOVIEWMATRIX' and len(t) > 1:
statics.append(t[1].lower())
# resolve search dirs relative to HPDAVE
dirs = [os.path.normpath(os.path.join(HP, p.replace('\\', os.sep)))
for p in geo_paths]
idx = build_index(dirs)
names = statics + dynamics
uniq = sorted(set(names))
found = [n for n in uniq if n.upper().split(':')[-1] in idx]
missing = [n for n in uniq if n.upper().split(':')[-1] not in idx]
spl_ok = sum(1 for s in set(spls) if os.path.exists(os.path.join(HP, s)))
size = os.path.getsize(scn)
pct = (100 * len(found) // len(uniq)) if uniq else 0
print(f"{os.path.basename(scn):14} {size:6}B paths={','.join(geo_paths) or '-'}")
print(f" entities: {len(names):3} ({len(uniq)} unique) resolvable: {len(found)}/{len(uniq)} ({pct}%)"
f" splines: {spl_ok}/{len(set(spls))}")
if missing:
print(f" missing: {', '.join(missing[:12])}{' ...' if len(missing) > 12 else ''}")
print()
print("note: resolvable = name found (any loadable ext) in the scene's own GEOMETRY search")
print(" dirs on the archive drive; staging exposes .B2Z as .BGF the same way.")
if __name__ == '__main__':
main()