Tooling built to recover editable source for six 'Mech chassis that exist
in the parallel FS_Build_V4H build but not in this repo. Reverse-engineers
every compiled record type in the .mw4 package format back to the .data /
.instance / .subsystems / .damage / .contents / .torso / .engine /
.armature sources the content pipeline consumes.
Nothing here is wired into the game build. It is a standalone analysis
harness run from Linux.
Package format
--------------
"#VBD" container. Directory records are [len][name][FILETIME][origSize]
[storedSize][offset], payload base at dword 0x0C. A record is stored raw
when storedSize == origSize, otherwise LZW (9->12-bit LSB-first codes,
256=clear, 257=EOF, dict from 258), per Database.cpp:451.
GameModel records are flat /Zp4 structs following the C++ inheritance
chain Entity(0) -> Mover(28) -> MWObject(80) -> Vehicle(664) -> Mech(756),
1636 bytes total. CreateMessage records follow Replicator -> Entity ->
Mover -> MWMover -> MWObject -> Vehicle -> Mech from start=16 (the
undeclared Connection__Message header), ending at 341 and padded to 344.
tools/decompile/
----------------
datamap.py header-driven layout engine; CHAIN + ANCHORS
{Vehicle:664, Mech:756} assert the struct offsets
mw4msg.py CreateMessage reader/walker
data.py .data constants.py define/table symbol resolution
damage.py .damage contents.py .contents
smallmodel.py .torso + .engine instance.py .instance
armature.py / armature_parts.py .armature + armaturedata/armaturevideo
assembly.py joint hierarchy renderer
make_generic_doll.py builds generic MFD/Radar damage dolls
verify_*.py per-type round-trip verifiers
Verified round-trip across all 64 shared chassis:
.armature 2938/2976 pages .subsystems 7579/7585 keys
.data map 6071/6071 values .data trip 8291/8306 keys
.damage 6605/6605 keys .contents 7480/7480 keys
.torso+.engine 1280/1280 keys .instance 896/896 keys, 64/64 pages
armature_parts 1202/1202 .data, 1149/1202 .video
Layout-discovery lessons (documented in DECOMPILING.md)
-------------------------------------------------------
- Never let a field map be discovered by the values that verify it. A
value-matching pass reported 4288/4288 while mis-assigning 34 keys. The
map was rebuilt from header declaration order, anchored on uniquely
resolved fields.
- Read the factory, not the data. 12 .data fields and 5 Torso fields are
declared plain Stuff::Scalar but multiplied by Radians_Per_Degree in
Mech_Tool.cpp:889 / Torso_Tool.cpp.
- Strip typedefs before walking a header. A stray `typedef int AttributeID;`
masked a missing ClassID - two 4-byte errors cancelling out, caught only
by the ANCHORS assertion.
- A verifier that silently narrows its own input reports success. Braced
blocks must be hidden before splitting pages, replacing both CR and LF,
because a `Shadow={...}` block contains a line reading `[shadow]` and
splitlines() also splits on bare CR.
- NSWIZZLE is undefined, so the #else branch is live and orders members
differently. bool is 1 byte; char x[MaxStringLength] is 256.
- V4H carries stale Mech IDs (their Atlas is 5, ours 6), so 64 of 65 shared
chassis are off by one; --retarget-ids emits $(M_<Chassis>)/$(IDS_<Chassis>).
reports/ holds generated diffs. The two ~5 MB manifest-*.tsv intermediates
are gitignored; regenerate everything with run-comparison.sh.
Co-authored-by: Claude Opus 5 (Anthropic) <noreply@anthropic.com>
Co-authored-by: GitHub Copilot <copilot@github.com>
145 lines
3.0 KiB
C
145 lines
3.0 KiB
C
#define NUM_CALLSIGNS 64
|
|
|
|
//These need to cover the full range of levels 0 to 9 at least one of each
|
|
//Twelve Characters at the most please.
|
|
|
|
// If you update the names here, please update Code\MW4\MW4Shell.cpp as well! Just search for NUM_CALLSIGNS.
|
|
callsigns
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
string names[NUM_CALLSIGNS]
|
|
int levels[NUM_CALLSIGNS]
|
|
|
|
names[0] = "Sipstrassi"
|
|
names[1] = "Scarab"
|
|
names[2] = "Pocus"
|
|
names[3] = "Hacksaw"
|
|
names[4] = "Gnaw"
|
|
names[5] = "Darklord"
|
|
names[6] = "Spice"
|
|
names[7] = "Rocker"
|
|
names[8] = "Leepus"
|
|
names[9] = "Coolhand"
|
|
names[10] = "Piotr"
|
|
names[11] = "Propwash"
|
|
names[12] = "Mecca"
|
|
names[13] = "Rusty"
|
|
names[14] = "Faith"
|
|
names[15] = "Thomcat"
|
|
names[16] = "Anubis"
|
|
names[17] = "Tryptic"
|
|
names[18] = "Isis"
|
|
names[19] = "Suredude"
|
|
names[20] = "Jerimiah Rose"
|
|
names[21] = "Lucky"
|
|
names[22] = "Gothmog"
|
|
names[23] = "Grayson"
|
|
names[24] = "Arioch"
|
|
names[25] = "Blackthorns"
|
|
names[26] = "Splotch"
|
|
names[27] = "Paladin"
|
|
names[28] = "Macleod"
|
|
names[29] = "ArcLight"
|
|
names[30] = "BooYah"
|
|
names[31] = "Von"
|
|
names[32] = "Azero"
|
|
names[33] = "Wraith"
|
|
names[34] = "Undead"
|
|
names[35] = "Mantis"
|
|
names[36] = "Wicced"
|
|
names[37] = "Tiny"
|
|
names[38] = "Crusher"
|
|
names[39] = "Darkman"
|
|
names[40] = "Oxen"
|
|
names[41] = "Morfane"
|
|
names[42] = "Darkheart"
|
|
names[43] = "Joker"
|
|
names[44] = "Mouse"
|
|
names[45] = "Greywolf"
|
|
names[46] = "Pyrotech"
|
|
names[47] = "Elengil"
|
|
names[48] = "Undomiel"
|
|
names[49] = "Marz"
|
|
names[50] = "Kuroshii"
|
|
names[51] = "Crow"
|
|
names[52] = "Con"
|
|
names[53] = "Lysosome"
|
|
names[54] = "Dax"
|
|
names[55] = "HamHouke"
|
|
names[56] = "Intrepid"
|
|
names[57] = "Toad"
|
|
names[58] = "Asterix"
|
|
names[59] = "Apophis"
|
|
names[60] = "Thor"
|
|
names[61] = "Sauron"
|
|
names[62] = "Pharaoh"
|
|
names[63] = "Dicion"
|
|
|
|
levels[0] = 1
|
|
levels[1] = 7
|
|
levels[2] = 6
|
|
levels[3] = 8
|
|
levels[4] = 6
|
|
levels[5] = 7
|
|
levels[6] = 7
|
|
levels[7] = 2
|
|
levels[8] = 5
|
|
levels[9] = 6
|
|
levels[10] = 7
|
|
levels[11] = 8
|
|
levels[12] = 5
|
|
levels[13] = 2
|
|
levels[14] = 7
|
|
levels[15] = 4
|
|
levels[16] = 3
|
|
levels[17] = 2
|
|
levels[18] = 4
|
|
levels[19] = 7
|
|
levels[20] = 2
|
|
levels[21] = 2
|
|
levels[22] = 4
|
|
levels[23] = 7
|
|
levels[24] = 4
|
|
levels[25] = 2
|
|
levels[26] = 5
|
|
levels[27] = 6
|
|
levels[28] = 7
|
|
levels[29] = 8
|
|
levels[30] = 8
|
|
levels[31] = 6
|
|
levels[32] = 2
|
|
levels[33] = 2
|
|
levels[34] = 5
|
|
levels[35] = 6
|
|
levels[36] = 3
|
|
levels[37] = 2
|
|
levels[38] = 7
|
|
levels[39] = 6
|
|
levels[40] = 7
|
|
levels[41] = 6
|
|
levels[42] = 2
|
|
levels[43] = 6
|
|
levels[44] = 5
|
|
levels[45] = 6
|
|
levels[46] = 8
|
|
levels[47] = 7
|
|
levels[48] = 5
|
|
levels[49] = 6
|
|
levels[50] = 5
|
|
levels[51] = 7
|
|
levels[52] = 3
|
|
levels[53] = 5
|
|
levels[54] = 4
|
|
levels[55] = 4
|
|
levels[56] = 4
|
|
levels[57] = 4
|
|
levels[58] = 4
|
|
levels[59] = 4
|
|
levels[60] = 4
|
|
levels[61] = 8
|
|
levels[62] = 7
|
|
levels[63] = 0
|
|
}
|
|
}
|