Yesterday's page said "Generic (394 per pak) is the unit datasheet".
Only 114 of the 394 are. Every IDXD file carries exactly one Generic
record and its schema is set by what kind of file it is. Partitioned
by field set, identically in all six GP_MAIN_GAME_*.pak:
114 has HP -- a unit datasheet
204 {Count} only -- a dialogue file
64 {ID, Name, SideID, Unique} -- a character (36 TCAF + 28 ADAN)
10 {EnumAsteroidGroup} -- an asteroid group
2 degenerate
204+114+64+10+2 = 394, and 178 distinct Generic.ID = 114 unit + 64
character, the only two shapes carrying an ID. That settles the
"178 IDs vs 394 records" question the previous entry left open.
Positive control in the same loop: for the 204 dialogue headers Count
equals the number of Message_NNN siblings, 204/204, zero mismatches.
Cross-check from the other side: Maneuver = 114, Effect = 114, the
carrying-entry sets are identical, every unit Generic has a Maneuver
sibling, and Generic.Type splits 43 Craft + 71 Vessel -- the same
43/71/114 unit-struct-runtime.md reached from live guest memory.
New tool generic_partition.py + artefact; ISL artefacts byte-identical.
44 lines
2.3 KiB
Python
44 lines
2.3 KiB
Python
import sys, glob, collections
|
|
S="/tmp/claude-1000/-home-fabi-RE-Project-Sylpheed/b113cc12-4769-4ed8-ad66-c2b48f800773/scratchpad"
|
|
sys.path.insert(0,S+"/wt-root/Syplheed-Reborn/tools/re-capture")
|
|
exec(open(S+"/regn_decode.py").read().split("# ── the object")[0])
|
|
import unitgroup as U
|
|
print("# `Generic` is the per-FILE header record, not a table")
|
|
print("#")
|
|
print("# One `Generic` per IDXD pak entry; its schema is set by the file's TYPE.")
|
|
print("# Regenerate: see docs/re/structures/unit-datasheet-static.md")
|
|
for pk in sorted(glob.glob("/work/sylph_extract/**/GP_MAIN_GAME_*.pak",recursive=True)):
|
|
E=pak_entries(pk); items=E.items() if isinstance(E,dict) else E
|
|
kinds=collections.Counter(); ids=set(); types=collections.Counter()
|
|
nidxd=0; man=eff=0; ctl_ok=ctl_bad=0; one_per=True
|
|
for h,b in items:
|
|
if bytes(b[:4])!=b'IDXD': continue
|
|
try: recs=U.parse(bytes(b))
|
|
except Exception: continue
|
|
nidxd+=1
|
|
names=[r['squadron'] for r in recs]
|
|
if names.count('Generic')>1: one_per=False
|
|
man+= 'Maneuver' in names; eff+= 'Effect' in names
|
|
for r in recs:
|
|
if r['squadron']!='Generic': continue
|
|
n=U.named(r)
|
|
if 'HP' in n:
|
|
kinds['unit datasheet']+=1; types[n.get('Type','<none>')]+=1
|
|
elif set(n)=={'Count'}:
|
|
kinds['message-file header']+=1
|
|
nmsg=sum(1 for x in names if x.startswith('Message_'))
|
|
ctl_ok+= str(nmsg)==n['Count'].strip(); ctl_bad+= str(nmsg)!=n['Count'].strip()
|
|
elif 'SideID' in n: kinds['character']+=1
|
|
elif 'EnumAsteroidGroup' in n: kinds['asteroid group']+=1
|
|
else: kinds['other (%d fields)'%len(n)]+=1
|
|
if 'ID' in n: ids.add(n['ID'])
|
|
print()
|
|
print("== %s (%d IDXD entries)" % (pk.split('/')[-1], nidxd))
|
|
for k,v in kinds.most_common(): print(" %-22s %4d" % (k,v))
|
|
print(" %-22s %4d" % ("TOTAL Generic", sum(kinds.values())))
|
|
print(" distinct Generic.ID %4d (= unit %d + character %d)"
|
|
% (len(ids), kinds['unit datasheet'], kinds['character']))
|
|
print(" unit Generic.Type %s" % dict(types))
|
|
print(" entries w/ Maneuver %d w/ Effect %d" % (man,eff))
|
|
print(" CONTROL message-header Count == #Message_NNN siblings: %d ok / %d bad" % (ctl_ok,ctl_bad))
|