Entry 405
Every Root Town's merchants stand on its floor as in the game: the merchant harness had never registered the town's mesh, and now checks every merchant in every town
Filestools/test_world_rs.pyUNKNOWNS.md
397 found Carmina Gadelica's merchants 15 and 16 higher in the port
than in tools/test_world_rs.py's MerchantRun (z 2.0 and 1.4e-4 against
0). It asked whether ROOTTOWN03 registers its Hit chunk otherwise than
ROOTTOWN01, and compared Carmina's Event NPC alone.
What it was
- Not the game's set-up. On Mutation,
setMerchant,ccMerchan::ccMerchanandentryObject/initObjectset a merchant down withccLandHitCheck(pos, 0x20000002)(MUT gcmn 0x00520910-0x005210b0), as Infection does.ccLandHitCheck,_ccHitCheckLMandcollisionLMdiffer only in addresses. Each town has one Hit chunk (HIT_sr2town1hit,HIT_sr3flo1hit,HIT_sr4flo1hit), which the port reads whole. - The harness had no floor.
MerchantRundecodes the town's Hit chunk and enables accModelHiton it, throughccModelHit::HitEnable. ButPieces, its base, stubsHitEnablefor the static pieces. So the mesh was never on the list.- Over a grid of 357 points in Mac Anu and in Carmina, the game's
ccLandHitCheckfound nothing. - Every merchant kept its dummy's z. Where a dummy lies on the floor (Mac Anu, Dun Loireag) that is the same.
- Carmina's
DMY_merchant5andDMY_merchant6(z 0) are a little under it: the port gives 7.6e-6 and 2.0. - So is the fourth town's
DMY_merchant6(z -340): the port gives -338.
- Over a grid of 357 points in Mac Anu and in Carmina, the game's
- The port was right.
Fix
MerchantRunlets the realHitEnablerun for the town's mesh.- It and
TownPcsRunstore the town's stream at ROOTTOWN01's +0x1a4 as the disc lays it out (404). test_every_town(new) runsccSetMerchant(0)in each of the four Root Towns besideset_merchants: every merchant's id, name, position, posP, headings, idle and body. Then 300 frames ofroutineandccMerchan::mainbesidestep_all, Kite walking about the town.test_event_npccompares Carmina's merchants with its Event NPC again.
Checked
- With the mesh registered, all 23 merchants of Mutation's four towns match the port at the start, 15, 16 and 22 among them.
MerchantsAgainstGamepasses on all four volumes:test_merchants,test_event_merchant,test_every_townand, from Mutation on,test_event_npc.- tools/test_world_rs.py passes whole on Mutation;
cairns checkandtools/docs.py checkpass. No Rust changed.
Still unknown: nothing.