From ad49ec708f7300e7d31ad8e1e6f0a5e520912aa1 Mon Sep 17 00:00:00 2001 From: RT Date: Sat, 8 Aug 2026 16:48:29 -0500 Subject: [PATCH] Fix Rifleman MFD/Radar damage mappings; document the authoring pipelines Repairs Rifleman's external MFD and Radar paper-doll source rectangles, removes the dead commented-out Dasher rows, and records the canonical authoring pipelines that had never been written down. Requires a Windows VC6 Release/Profile rebuild - DXRasterizer.cpp includes coord.cpp directly - plus a physical MFD/Radar hardware test. The Linux workflow validates data and geometry only. How the mapping was validated ----------------------------- Ground truth is Mad Cat (ID 40), whose mapping is known-good in game and user-confirmed. It establishes the invariant: texuv2/texuv3 rectangles must bound the component blobs in the runtime BMP, and the rule is exact - texuv = blob bounding box with x1,y1 + 1. offset2/offset3 are on-screen placement and deliberately do NOT align to the BMP; overlaying them against the art is meaningless. Scoring each rectangle by IoU against the nearest art blob gives a clean bimodal split: healthy chassis 0.78-0.99 (the single sub-0.5 zone is normally HD, which has no blob of its own), broken chassis below 0.5. Rifleman -------- Its texuv2 row was a verbatim copy of Mad Cat's, so CT landed in empty space, S1/S2 enclosed nothing and the legs hung off the art. Its texuv3 row was independently misaligned. MFD 0.14 -> 0.86 Radar 0.25 -> 0.87 (Mad Cat control, unchanged: 0.88) Zone labels were confirmed by eye, not inferred - an automatic classifier trained on the 42 healthy chassis reproduces only ~70% of labels, because zone placement is conventional but not guaranteed. HD is the small 3-bar element under the centre torso, recovered by merging three sub-300px fragments that the blob threshold had discarded. Note the Radar layout is NOT a mirror of the MFD one: the legs move up into the middle row and the wide S1 slab moves from the top to the bottom. Radar S2 is now zeroed; the previous {186,10,312,78} had no corresponding art. Dasher rows ----------- Dropped the four commented-out M_Dasher rows from all four arrays. Dasher is not in the 65-ID roster, and a commented row is an active hazard: any tool that parses these arrays or texturename[] without stripping comments first picks it up and shifts every later chassis by one. That exact bug produced a bogus "id41 madcat" during this work. (huddamage.cpp still has a commented "hud\\dasher" entry - same hazard, left for a separate change.) MFD-RADAR-MAPPINGS.md --------------------- Adds the project owner's verbatim MFD and Radar authoring pipelines as the authority, plus the fact that coord.cpp is edited via the GameOS project's "External Dependencies" folder in the VC6 IDE. Records the distinction that caused a wrong diagnosis during this work: Radar expands its canvas to 512 BEFORE the unexploded view is saved, so Radar coordinates are measured in 512 space, whereas MFD expands to 512 AFTER all coordinates are recorded, so MFD coordinates are in 340 space. Also MFD separates sections with a 4x4 black line while Radar outlines with 2x2 white, both rectangles are measured on the unexploded view, and the exploded view saved in indexed mode is the runtime BMP. File remains CRLF-only; all four arrays verified at 65 rows x 11 zones. Co-authored-by: Claude Opus 5 (Anthropic) Co-authored-by: GitHub Copilot --- .../code/CoreTech/Libraries/GameOS/coord.cpp | 8 +-- MFD-RADAR-MAPPINGS.md | 70 +++++++++++++++++++ 2 files changed, 72 insertions(+), 6 deletions(-) diff --git a/Gameleap/code/CoreTech/Libraries/GameOS/coord.cpp b/Gameleap/code/CoreTech/Libraries/GameOS/coord.cpp index 9cc180b5..56ced2c4 100644 --- a/Gameleap/code/CoreTech/Libraries/GameOS/coord.cpp +++ b/Gameleap/code/CoreTech/Libraries/GameOS/coord.cpp @@ -27,7 +27,6 @@ float texuv2[65][11][4]={ {{171,135,273,330},{ 63,135,150,330},{270, 69,315,171},{ 27, 69, 66,171},{ 72, 33,135,126},{201, 33,264,126},{324, 18,378,171},{ 0, 0, 0, 0},{159, 0,182, 14},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Cougar {{214,150,288,356},{ 50,150,124,356},{256, 42,314,142},{ 24, 42, 82,142},{100, 38,128,114},{210, 38,238,114},{146, 54,192,192},{ 0, 0, 0, 0},{164,222,176,234},{148, 14,190, 48},{ 0, 0, 0, 0}}, // M_Cyclops {{183,159,300,333},{ 30,159,147,333},{237, 51,282,150},{ 48, 51, 93,150},{102, 36,162,153},{168, 36,228,153},{309, 63,375,195},{ 0, 0, 0, 0},{156, 15,177, 33},{309, 15,372, 42},{ 0, 0, 0, 0}}, // M_Daishi -// {{250,174,300,336},{ 40,174, 90,336},{280, 2,322,110},{ 16, 2, 58,110},{ 62, 60,104,136},{234, 60,276,136},{110, 62,230,198},{ 0, 0, 0, 0},{156, 24,182, 34},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Dasher {{191,142,265,337},{ 76,142,150,337},{266, 58,328,142},{ 12, 58, 75,141},{ 93, 56,150,129},{190, 56,246,129},{152, 60,188,198},{ 0, 0, 0, 0},{166, 42,177, 49},{184, 2,245, 55},{ 96, 2,157, 55}}, // M_Deimos {{237,147,300,345},{ 84,147,147,345},{324, 78,372,147},{ 12, 72, 66,135},{ 81, 33,147,111},{237, 33,300,111},{162, 42,222,186},{ 0, 0, 0, 0},{177, 15,207, 30},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Dragon {{ 86,142,162,326},{178,142,254,326},{ 24, 22, 68,134},{272, 22,316,134},{188, 14,270,136},{ 68, 14,150,136},{124, 16,214,202},{ 0, 0, 0, 0},{162, 90,178,100},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Fafnir - Skippy @@ -52,7 +51,7 @@ float texuv2[65][11][4]={ {{225,162,312,336},{ 63,162,150,336},{291, 51,360,135},{ 15, 51, 84,135},{ 90, 87,141,150},{234, 87,285,150},{150, 36,225,186},{ 0, 0, 0, 0},{ 99, 51,135, 57},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Owens {{222,162,330,357},{ 42,162,150,357},{309, 15,369,135},{ 6, 15, 66,135},{ 78, 15,135,105},{237, 15,294,105},{147, 15,222,150},{ 0, 0, 0, 0},{168,177,204,195},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Puma {{201,135,270,342},{ 69,135,138,342},{237, 21,297, 93},{ 39, 21, 99, 66},{108, 33,168,126},{171, 33,231,126},{138,198,201,333},{ 0, 0, 0, 0},{162, 12,177, 27},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Raven - {{177,189,267,378},{ 69,189,159,378},{240, 78,288,171},{ 48, 78, 96,171},{102, 39,165,141},{171, 39,234,141},{309, 60,375,177},{ 0, 0, 0, 0},{156, 24,180, 33},{243, 18,300, 72},{ 36, 18, 93, 72}}, // M_Rifleman + {{235,167,292,324},{ 53,167,110,324},{272, 72,331,122},{ 11, 72, 71,122},{ 85, 60,126,147},{217, 60,258,147},{142, 60,205,194},{ 0, 0, 0, 0},{168,212,179,231},{126, 9,221, 50},{ 0, 0, 0, 0}}, // M_Rifleman {{162,171,249,375},{ 63,171,150,375},{231, 42,291,156},{ 51, 42,111,156},{117, 45,168,123},{174, 45,225,123},{261,180,369,309},{ 0, 0, 0, 0},{159, 21,183, 33},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Ryoken {{201,126,309,342},{ 33,126,141,342},{237, 63,312,120},{ 27, 63,105,120},{111, 21,147,117},{195, 30,231,117},{141,156,201,318},{ 0, 0, 0, 0},{162, 6,180, 15},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Shadowcat {{222,168,294,370},{ 44,168,116,370},{284, 66,336,162},{ 4, 66, 54,162},{ 60, 34,134,134},{130,196,202,274},{136, 8,210,182},{ 0, 0, 0, 0},{162,324,188,336},{216, 66,272,126},{ 0, 0, 0, 0}}, // M_Solitaire @@ -98,7 +97,6 @@ int offset2[65][11][2]={ {{171,135},{ 63,135},{270, 69},{ 27, 69},{ 72, 33},{201, 33},{144, 18},{ 0, 0},{159, 48},{ 0, 0},{ 0, 0}}, // M_Cougar {{184,134},{ 80,134},{236, 46},{ 44, 46},{110, 42},{200, 42},{146, 38},{ 0, 0},{164, 84},{148, 8},{ 0, 0}}, // M_Cyclops {{183,159},{ 30,159},{234, 51},{ 51, 51},{102, 36},{168, 36},{135, 63},{ 0, 0},{156, 87},{174, 15},{ 0, 0}}, // M_Daishi -// {{190,180},{100,180},{230, 8},{ 66, 8},{102, 66},{194, 66},{110, 68},{ 0, 0},{156,100},{ 0, 0},{ 0, 0}}, // M_Dasher {{191,144},{ 76,144},{242, 60},{ 35, 60},{ 93, 58},{190, 58},{152, 62},{ 0, 0},{165, 77},{184, 7},{ 96, 7}}, // M_Deimos {{198,134},{ 99,134},{234, 65},{ 63, 59},{ 87, 20},{207, 20},{150, 29},{ 0, 0},{165, 44},{ 0, 0},{ 0, 0}}, // M_Dragon {{ 8,142},{256,142},{ 8, 2},{288, 2},{206, 14},{ 50, 14},{126,140},{ 0, 0},{162, 90},{ 0, 0},{ 0, 0}}, // M_Fafnir - Skippy @@ -168,7 +166,6 @@ float texuv3[65][11][4]={ {{374,266,502,496},{ 16,266,142,496},{438, 92,494,206},{ 12, 92, 70,206},{ 90, 26,206,144},{300, 26,418,144},{222, 12,284,198},{ 0, 0, 0, 0},{240,294,266,308},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Cougar {{392,246,478,494},{ 38,246,126,494},{400, 92,470,210},{ 38, 92,108,210},{144, 86,182,178},{324, 86,362,178},{224, 82,282,248},{ 0, 0, 0, 0},{242,296,266,320},{228, 22,278, 72},{ 0, 0, 0, 0}}, // M_Cyclops {{340,272,496,496},{ 14,272,170,496},{428, 92,490,216},{ 20, 92, 82,216},{100, 74,186,218},{314, 74,400,218},{208, 98,300,276},{ 0, 0, 0, 0},{222, 10,286, 54},{218,354,294,408},{ 0, 0, 0, 0}}, // M_Daishi -// {{410,286,468,484},{ 32,286, 90,484},{428, 24,478,152},{ 30, 24, 80,152},{112, 94,168,184},{340, 94,396,184},{184, 96,326,258},{ 0, 0, 0, 0},{236, 32,274, 48},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Dasher {{372,258,470,496},{ 42,258,138,496},{398,118,476,218},{ 34,118,112,220},{144,116,216,204},{296,116,368,204},{234,120,278,288},{ 0, 0, 0, 0},{240,320,272,336},{272, 14,346, 78},{166, 14,240, 78}}, // M_Deimos {{348,238,430,498},{ 94,238,176,498},{430,146,488,222},{ 40,134, 98,206},{ 58, 40,132,128},{412, 40,476,128},{208, 56,326,240},{ 0, 0, 0, 0},{250,314,284,332},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Dragon {{390,258,488,488},{ 20,260,118,490},{440, 20,500,162},{ 20, 20, 78,162},{160,200,266,466},{320, 20,428,186},{180, 20,308,266},{ 0, 0, 0, 0},{300,300,324,316},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Fafnir - Skippy @@ -193,7 +190,7 @@ float texuv3[65][11][4]={ {{394,244,492,492},{ 14,244,112,492},{414, 36,502,150},{ 4, 36, 92,152},{102, 78,190,164},{316, 78,404,164},{204, 16,304,216},{ 0, 0, 0, 0},{236,350,270,372},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Owens {{348,226,494,492},{ 16,226,162,492},{414, 50,496,210},{ 16, 50, 96,210},{112, 10,178,130},{332, 10,398,130},{190, 10,320,192},{ 0, 0, 0, 0},{228,228,282,260},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Puma {{398,232,494,494},{ 14,232,108,494},{430, 16,504,100},{ 10, 12,104, 68},{122, 26,204,136},{324, 26,406,136},{216, 44,310,214},{ 0, 0, 0, 0},{232,290,294,318},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Raven - {{352,240,428,448},{ 70,240,146,448},{404,114,488,182},{ 10,114, 94,182},{132, 96,194,214},{304, 96,366,214},{206, 98,292,278},{ 0, 0, 0, 0},{238,392,260,406},{232,314,266,372},{186, 10,312, 78}}, // M_Rifleman + {{327,202,399,398},{115,202,187,398},{404, 82,481,145},{ 30, 82,108,145},{136, 65,194,176},{318, 65,376,176},{219, 66,299,236},{ 0, 0, 0, 0},{250,272,268,297},{199,430,319,494},{ 0, 0, 0, 0}}, // M_Rifleman {{394,244,498,498},{ 10,244,116,498},{426, 2,500,136},{ 10, 2, 82,136},{100, 6,174,116},{332, 6,408,116},{192, 50,320,210},{ 0, 0, 0, 0},{230,284,276,310},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Ryoken {{362,220,494,494},{ 14,220,144,494},{400, 64,502,156},{ 6, 58,108,132},{128, 12,190,132},{318, 24,380,132},{214, 14,294,210},{ 0, 0, 0, 0},{244,266,264,314},{ 0, 0, 0, 0},{ 0, 0, 0, 0}}, // M_Shadowcat {{392,234,480,478},{ 48,234,136,478},{430, 80,492,196},{ 26, 80, 86,196},{114, 42,202,164},{320, 62,412,164},{216, 10,302,218},{ 0, 0, 0, 0},{236,356,270,374},{220,250,288,326},{ 0, 0, 0, 0}}, // M_Solitaire @@ -237,7 +234,6 @@ int offset3[65][11][2]={ {{204,156},{ 76,156},{348, 92},{ 2, 92},{ 60, 36},{230, 36},{172, 22},{ 0, 0},{190, 64},{ 0, 0},{ 0, 0}}, // M_Cougar {{212,156},{108,156},{260, 52},{ 78, 52},{144, 46},{224, 46},{174, 42},{ 0, 0},{192, 96},{178, 2},{ 0, 0}}, // M_Cyclops {{220,182},{ 34,182},{288, 52},{ 60, 52},{120, 34},{204, 34},{158, 58},{ 0, 0},{172, 60},{218, 4},{ 0, 0}}, // M_Daishi -// {{230,206},{122,206},{278, 4},{ 80, 4},{122, 74},{230, 74},{134, 76},{ 0, 0},{186,112},{ 0, 0},{ 0, 0}}, // M_Dasher {{222,168},{ 92,168},{288, 68},{ 44, 68},{114, 66},{226, 66},{184, 70},{ 0, 0},{190,100},{222, 4},{116, 4}}, // M_Deimos {{228,148},{104,148},{280, 76},{ 60, 64},{ 78, 0},{262, 0},{148, 16},{ 0, 0},{190, 24},{ 0, 0},{ 0, 0}}, // M_Dragon {{214,175},{ 92,175},{332, 13},{ 13, 13},{ 72, 2},{224, 2},{138, 4},{ 0, 0},{190, 99},{ 0, 0},{ 0, 0}}, // M_Fafnir - Skippy diff --git a/MFD-RADAR-MAPPINGS.md b/MFD-RADAR-MAPPINGS.md index 27120370..b1b2863e 100644 --- a/MFD-RADAR-MAPPINGS.md +++ b/MFD-RADAR-MAPPINGS.md @@ -23,6 +23,12 @@ into a mech texture atlas. They are not the 512x512 damage-mask images mapped by ## Controlling code +The file to edit is `Gameleap/code/CoreTech/Libraries/GameOS/coord.cpp`. In the VC6 IDE it is +not a listed source file of any project: it appears under the **GameOS project's "External +Dependencies" folder**, because `DXRasterizer.cpp` `#include`s it directly. Open it from there +(or from disk). Because it is an include, editing it requires rebuilding the game executable, +not merely relinking. + `coord.cpp` defines four positional arrays: ```cpp @@ -91,6 +97,70 @@ Black Hawk Radar RT `x=85`. Radar's integer `/2` truncates odd values at runtime odd authored value can move an edge or origin in the rendered 256x256 view. Work from the upper-left to lower-right of each component, and do not overlap source rectangles. +## Canonical authoring steps + +This is the project owner's own specification of the two pipelines, recorded verbatim. It is the +authority. The expanded prose sections that follow explain and justify these steps but must not +contradict them. + +### MFD (verbatim) + +```text +take 1024 image +reduce image to 320 +expand canvas to 340 (centered) +Using a 4x4 black line seperate the sections +***save as unexploded*** +split components (no overlaps from upper left to lower right of component) +record coords from upper left to lower right, use even numbers. +(x,y,x1,y1) +Now using the Unexploded view (image in upper left corner) overlay the exploded pieces +and record the upper left corner coord. +(x2,y2) +expand canvas to 512x512 (upper left corner) +Save the exploded view in Index Mode. + +Modify file(s): +coord.cpp (under GameOS/External dependancies) +``` + +### Radar (verbatim) + +```text +take 1024 image +reduce to 400 +expand canvas to 410 (centered) +expand canvas to 512 (upper left corner) +***Save this as Unexploded View*** +split components (no overlaps from upper left to lower right of component) +Outline components in white 2x2 pixel +record coords from upper left to lower right, use even numbers. +(x,y,x1,y1) +Now using the Unexploded view (image in upper left corner) overlay the exploded pieces +and record the upper left corner coord. +(x2,y2) +Save the exploded view in Index Mode. + +Modify file(s): +coord.cpp (under GameOS/External dependancies) +``` + +### Points that are easy to lose + +- The two pipelines differ in **when** the canvas becomes 512. Radar expands to 512 **before** + the unexploded view is saved, so Radar coordinates are measured in 512 space. MFD expands to + 512 **after** all coordinates are recorded, so MFD coordinates are measured in 340 space. +- MFD separates sections with a **4x4 black line**; Radar outlines components with a **2x2 white + line**. These separators exist so no source rectangle can bleed into a neighbouring component. +- Both `(x,y,x1,y1)` rectangles are measured on the **unexploded** view, never on the exploded + BMP. +- `(x2,y2)` is recorded by keeping the unexploded view in the upper-left and laying the exploded + pieces over that same canvas, so offsets share the unexploded coordinate space. +- The exploded view is saved in **indexed color mode**. That saved exploded 512x512 image is the + runtime BMP. +- Prefer even numbers when recording, but never round an odd value that has already been + visually validated. + ## MFD authoring pipeline Start with the finished 1024x1024 full-color 'Mech image.