Entry 535
GameClass: the game's classes generated, one table row a class, the ccBoss family a narrow enum; the first defs pass set aside
1h 11mbattle
Files8 in 5 directories
classes.rslib.rsmain.rscrates/piney-data/src/classes.rslib.rscrates/piney-data/tests/classes.rscrates/piney-world/src/chara/mod.rsplans/rust-cleanup.mdMentioned inplans/rust-cleanup.md:407
The defs' class is a name the game gives, not a string: piney-gen gen
now writes crates/piney-data/src/classes.rs from Infection's DWARF and
every volume's symbols, and gen --check holds it current.
What is generated
GameClass(#[repr(u16)], names only) and one table,CLASSES: [ClassInfo; COUNT], a row a class: itsclass,name,baseand itsconstructorandvtableon each volume.info()is&CLASSES[self as usize];name,base,constructorandvtableread the row;all()walks the rows. No class is written twice.- Which classes: every name with a
__vt__<n><name>or a__ct__<n><name>F..symbol on some volume (Infection's own ELF table, the later volumes' carried.syms), and the bases of those, to the root: 310 classes, 1,061 lines (the table one row a line).baseis the DWARF's firstTAG_inheritance(0x1c) child.constructoris the lowest of a class's overloads.- A class only a later volume has and the carry did not name (Quarantine's
ROOTTOWN06) is not in it.
BossGameClass: theccBossfamily, every class whose ancestry reachesccBoss(the bosses, Kyvia's, the parts and slaves: 24), each variant with itsGameClassdiscriminant.class()isCLASSES[self as usize].classandFrom<BossGameClass> for GameClassuses it, so the family holds no data of its own. The towns', story maps' and characters' families follow with their defs.- Checked against what the code already knew: ccBoss's constructor INF
0x0045bcf0, ccBoss01's 0x0047b410,
__vt__13ccBossKyvia01MUT 0x0038a180; every boss class's base isccBoss(worklog 534).
The tests (crates/piney-data/tests/classes.rs)
- the table is in discriminant order (row
kis the classk); - the boss family is exactly
ccBoss's subtree in the game's tree, read from the generated enum's text, each member's ancestry reachingccBoss; - a
#[doc(alias)]that names a class spells it asGameClass::name:chara/mod.rshadccnavi(the file's name) forccNavi, now fixed.
Not committed: the first defs pass
BossDef with BASE_BOSS and BASE_PART, the per-boss tables owned by
the boss (BossData gone), the shared blocks in boss/systems/ and one
runner over each def's order were built and checked (290 pins byte for
byte, every harness, the golden shots), but the systems were a flag enum
gating methods of a class trait, with a getter a system on Boss and
downcasts for the world. The maintainer's rule (plan section 2, "What a
system is") rules that shape out, so none of it is committed; the next
pass builds systems as objects emitting requests. Two findings carry over
(the plan's boss item):
- every boss def composes
BASE_BOSS(partsBASE_PART): the generatedbase()of each boss class isccBoss; - Fidchell's, Macha's and Tarvos's own
ExecPatternIndexfall back onccBoss::ExecPatternIndex(OUT gcmn 0x004a4664; QUA 0x003a4228, 0x003a8db0), whose unknown word lets the neutral go with forbid 1 (OUT 0x0046e384, QUA 0x00360c94, Infection's too at 0x0045d10c), where the port holds it (3). The next commit fixes it.
Checks
piney-gen gen --check; the classes tests.- The pins: 290 recorded
battle_probecalls replayed, none differ. - Against the game: the eleven
test_battle_*_rson their volumes,test_boss_effect_rson all four,test_bosscam_rson Infection, Mutation and Quarantine. - The golden boss shots (
corbenik_under_god,kyvia_stage_shots,skeith_shots,tarvos_under_god): every PNG byte for byte the same. - piney-data's, piney-gen's, piney-battle's, piney-world's, piney-effect's and piney-event's tests, piney-game's full suite, release.
- clippy with all features, fmt,
cairns check,tools/docs.py check. too_many_arguments: 151 before, 151 after.
which classes Quarantine adds that Infection lacks
(ROOTTOWN06 among them): the carry names none, so the generated list
cannot hold them until their names are found.