Lock-on marker: range colours, sizes, distance gauge (executable + Menu/BtMenu<lang>.alr)
Our reading of the Store build 1.3.25854.2
executable; sprite numbers index the BtMenu
sprite table (“Battle HUD”), sizes from
hudconv.py. Units 0.1 m, ticks 1/30
s, colours ARGB. This replaces the “Lock-on
reticle” and “Range line” bullets of “Battle
HUD”, which read the three rings as three sizes
of one state and mixed the one-view and
split-view offsets. The marker is not one ring:
it is a ring whose size and colour
follow the lock grade, a left arc with a
rotating needle, the distance as a number riding
on that arc, and the target’s name.
The three grades are the lock grades (“Lock-on and targeting”: camera object + 0xc, graded each tick from the 3-D distance d between the player’s first body record and the target’s body record). The marker copies that field; it has no thresholds of its own.
| Grade | Distance d | Colour | Ring (one view / split view) | What it tells the player |
|---|---|---|---|---|
| 1 | d ≤ 80 (8 m) | orange 0xffff7725 | sprite 15, 98 × 98 / sprite 120, 76 × 76 | a lunge (melee) skill reaches |
| 2 | 80 < d ≤ 300 (30 m) | yellow 0xffffd525 | sprite 20, 60 × 60, plus the centre dot 23 / 125 plus 128 | short / medium skills (range class 0) reach |
| 3 | d > 300 | green 0xffa5ff25 | sprite 25, 32 × 32 / sprite 130 | long skills (range class 1) reach |
The ring grows as the target comes closer. Nothing pulses and nothing blends by distance inside a grade; the only animation is the closing-in on a new target and the ring swap when the grade changes (both below).
How the grades relate to the skills’
range fields (skill record words 0x52
set, 0x54 range class, 0x7A behavior;
skills.json):
- Lunge skills (set 0 with behavior 3, 12, 13 or 14) get the target only at grade 1 (cast start 0x140258180, already in “Lock-on and targeting”): orange = the lunge homes.
- The range test 0x140273c80(point a, point b, skill id), squared threshold 90 000 (300 u): a set-0 skill of class 2 is always in range; a set-0 skill of class 0 is in range below 300 u and returns “too far” (2) at or beyond; every other skill (class 1, and every other set) returns “too close” (0) below 300 u and in range from 300 u. Its one caller is the targeted auto skill’s init (0x140265efe), where anything but “in range” ends the skill at once. The range clamp 0x140273d40 of the lobbed and fall kinds uses the same two numbers (class 0 lands 80..300 u away, class 1 300..600 u; “Parabola”).
- So the marker and the skills agree by construction: 80 and 300 are the only range numbers, the HUD shows the grade the lock computed, and class 0 / class 1 skills test the same 300 u. Class 2 (“all”) ignores the grade. Yellow covers both “short” and “medium” as listed on the cards: the data has one class for them (0), and what makes a skill short is its behavior (the lunge kinds), which is the grade 1 rule.
- The distance the grade uses is body record to body record (torso root to torso root); the range test and clamp measure from the skill’s own points, so they can differ from the shown grade by the offset of those points (a muzzle or a landing point), not by a different threshold.
- The CPU players’ lock is graded with the same 80 / 300 from a pairwise distance table (0x14017b2e0, table 0x1404bbe24; M, not followed further).
Aim point. The marker sits on the target’s body record position (record + 0x60, the torso root node’s world position: “Vertical aim of a cast”), projected by the play camera’s tick step 9 (0x140253c00) with no added height. The same point is what shots steer at and what the distance is measured to. Screen point: X = 320 + x, Y = 240 + y in the 640 × 480 design space, x and y being the step 9 values (|x| < 426, |y| < 240). In a split view: X = 160 + x + 14 (left view) or 160 + x + 306 (right view), Y = 120 + y + 112.
Marker record. The battle menu object H keeps one record per view at H + 0x68 + view × 0x28:
| Offset | Field |
|---|---|
| +0x00 | drawn this tick |
| +0x04 | third argument of the update (the local player index in one view; not read by the draw) |
| +0x08 | pointer to the target’s screen x, y (camera object + 0x84 + index × 0x14) |
| +0x10 | target index now; +0x14 target index last tick (−1 none) |
| +0x18 | closing counter (10 → 0) |
| +0x1c | grade shown; +0x20 grade before the last change |
| +0x24 | f32 ring swap progress f (0.2 → 1.0) |
Update (0x1401536e0, once per tick per view, from the HUD tick at 0x14015078e / 0x1401507a8). The player is the view’s player in split screen, else the local player (0x1404bbe00).
- Nothing is drawn unless the HUD is on (H + 0x58 bit 1) and the player object exists, is simulated here (+0x10 = 0), tracks a target (grade ≠ 0), is not spectating (camera object + 0 ≠ 1) and is active and alive (C + 0x20, C + 0x24 ≠ 0). Otherwise both target indices become −1.
- A target index after −1 (a fresh lock) sets the counter to 10. Otherwise a counter above 0 counts down by one, and on reaching 0 plays common bank cue 4 (0x140276330(0, 4, 4, 0x1000, 0x1000, 0)): the lock-on blip sounds when the ring has closed, not at the press.
- The marker is drawn only when the target’s step 9 record has its on-screen flag and the index equals last tick’s. If not (target off screen, or the index just changed by a switch) the counter is set back to 10 and nothing is drawn that tick, so a switch or a target coming back on screen replays the closing-in (from 9, since the next tick counts down first).
- With the counter at 10 (first tick of a fresh lock): grade shown = the lock grade, f = 1. With the counter at 0: the lock grade is copied; if it differs from the grade shown and f ≥ 1, the old grade is kept at +0x20 and f = 0.2; else while f < 1, f += 0.2 (0x1402f7d08). A grade change therefore swaps the ring over 5 ticks (0.2, 0.4, 0.6, 0.8, 1.0), and a second change inside those ticks is taken up at once without restarting f. With the counter between 9 and 1 the grade shown is not refreshed (after a switch the pieces close in the previous target’s colour; M, read not seen).
Other lock states. There is no “lost”, “down” or “invulnerable” marker. The lock’s validity test (0x1402543e0) makes a KO’d target, one with status slot 8 and a team-mate (default option) invalid; the grade is then 0 and step 1 hides everything until the player presses again. A target behind a wall keeps its marker (no line-of-sight test anywhere). A target that leaves the screen loses the marker, the lock itself stays. A locked ally (possible only with option byte 0x14052dfb9) gets sprite 75 (40 × 40, a red “no” sign) at (X − 20, Y − 20) on top, drawn when the target’s team word (+0x1c) equals the local player’s.
Draw (0x140153a10(H, view), called from the HUD draw at 0x1401514d0). Positions below are the top-left corners handed to the sprite draw 0x1401983e0, relative to (X, Y); “split” is H + 0x2a0 ≠ 0. Two sampler states of stage 0 are set first (0x140020c40(0, 3, 2) and (0, 4, 2): the setter’s states 3 and 4 set the magnification and minification bits of the stage’s D3D11 filter word (0x4 and 0x10), value 2 = linear, 1 = point, so linear filtering, which is what the rotated needle needs; the blend is the HUD’s usual one) (lockhud 11-15), and in split mode 2 the 2-D viewport is narrowed to the view.
Closing-in (counter k = 10..1), e = 2 · k² (200, 162, 128, 98, 72, 50, 32, 18, 8, 2): three ring segments fly in from above, lower right and lower left; nothing else is drawn (no gauge, number or name). Colours: grade 1 0xffff7725, grade 2 0xffffd503 (not the steady yellow), grade 3 0xffa5ff25.
| Grade, view | Top piece | Right piece | Centre piece (fixed) | Left piece |
|---|---|---|---|---|
| 1, one | 16 at (−41, −50 − e) | 17 at (e + 3, e − 21) | none | 19 at (−50 − e, e − 21) |
| 1, split | 121 at (−31, −36 − e) | 122 at (e + 2, e − 17) | none | 124 at (−38 − e, e − 18) |
| 2, one | 21 at (−24, −30 − e) | 22 at (e + 2, e − 12) | 23 at (−7, −7) | 24 at (−28 − e, e − 12) |
| 2, split | 126 at (−24, −26 − e) | 127 at (e − 2, e − 11) | 128 at (−9, −5) | 129 at (−26 − e, e − 12) |
| 3, one | 26 at (−10, −16 − e) | 27 at (e, e − 4) | 28 at (−16, −10) | 29 at (−15 − e, e − 4) |
| 3, split | 131 at (−10, −12 − e) | 132 at (e + 1, e − 5) | 133 at (−14, −9) | 134 at (−13 − e, e − 5) |
(Grade 1 passes sprite index −1 for its third piece, which the loop skips; sprites 18 and 123 are 2 × 2 blanks.)
Steady ring (counter 0, f ≥ 1):
| Grade | One view | Split view |
|---|---|---|
| 1 | 15 at (−49, −48) | 120 at (−40, −36) |
| 2 | 20 at (−31, −30), 23 at (−7, −7) | 125 at (−30, −26), 128 at (−10, −5) |
| 3 | 25 at (−16, −13) | 130 at (−18, −11) |
Ring swap (f < 1), s = 1 − f. The scale pointers of the sprite draw stretch the quad from its top-left corner, so each scaled ring is also moved by int(scale-complement × half size) to stay centred (half sizes 47 / 48 for the large ring, 29 / 28 for the middle one, as x / y; the code uses 0x1402f8004 = 47, 0x1402f800c = 48, 0x1402f7fd4 = 29, 0x1402f7fd0 = 28).
| Change | Drawn (one view; split in brackets) |
|---|---|
| to 1 (from 2) | middle ring 20 yellow at (−29, −28) [125 at (−30, −25)], unscaled; large ring 15 orange growing at scale f, at (int(s · 47) − 47, int(s · 48) − 48) [120 at (int(s · 47) − 47, int(s · 48) − 43); the split branch passes the yellow, a port slip] |
| to 2 from 1 | middle ring 20 yellow at (−29, −28) [125 at (−30, −26)], unscaled; large ring 15 orange shrinking at scale s, at (int(f · 47) − 48, int(f · 48) − 49) [120 at (int(f · 47) − 46, int(f · 48) − 42)] |
| to 2 from 3 | small ring 25 green at (−16, −13) [130 at (−18, −11)], unscaled; middle ring 20 yellow growing at scale f, at (int(s · 29) − 29, int(s · 28) − 28) [125 at (int(s · 29) − 29, int(s · 28) − 25)] |
| to 3 (from 2) | small ring 25 green at (−16, −13) [130 at (−18, −11)]; middle ring 20 yellow shrinking at scale s, at (int(f · 29) − 30, int(f · 28) − 29) [125 at (int(f · 29) − 27, int(f · 28) − 25)] |
The centre dot 23 is not drawn during a swap. Grades 1 and 3 assume the other ring is the middle one (a 1 ↔︎ 3 jump in one tick shows the middle ring as the old one).
With the steady ring or the swap, every tick:
- Gauge track: sprite 14 (38 × 56, an arc at the lower left of the ring) at (−41, −17), in the grade colour (during a 3 → 2 swap, green), both view modes.
- Distance. D = d − 10 (0x1402f8334), and D = 0 when that is ≤ 0.9. The number shown is int(D × 100), right-aligned in five characters (so 30 m of body distance reads 29000). d comes from the step 9 record (camera object + 0x90 + index × 0x14).
- Gauge position p (0 near … 64 far), from D by grade, so each grade has its own stretch of the arc: g = int(D / 270 × 130) + 50 (grade 1), int(D / 500 × 105) + 75 (grade 2), int(D / 800 × 70) + 110 (grade 3); p = int(g / 2) − 25, kept within 0..64. Grade 1 covers p 0..16, grade 2 p 19..42, grade 3 p 42..64 (full at D ≈ 777).
- Split mode 2 stops here (ring and track
only). Otherwise an int8 pair table at
0x1402f1370, 65 (x, y) entries indexed
by 64 − p, gives the point on the arc;
with w = 64 (63 at p = 64) and h = 7 (p <
28), 29 (28 ≤ p < 64) or 30 (p = 64):
- the number starts at (tx − w − 50, ty − h − 15), drawn glyph by glyph like the other HUD numbers (black copy at +1, +1, then the glyph through 0x140198ad0 in the grade colour); glyph cell 16 × 16 at ((c mod 64) × 16, (c div 64) × 16) of the 2-D context’s glyph sheet, advance = width table 0x1402f2890[c − 0x20] + 1 (10 when that is ≤ 0); the table is one byte per character: space 6, the digits 8, so the advance is 7 / 9. M for the sheet (how these cells relate to the (digit × 16, 0x740) cells of the other HUD numbers was not reconciled);
- an underline, sprite 76 (64 × 1) at (tx − w − 63, ty − h), grade colour;
- the needle, sprite 77 (100 × 100: an arc with a tick line) at (−50, −48), grade colour, rotated about its centre by p × 1.8125 − 116 degrees (the tenth argument of the sprite draw is a rotation in degrees; 0x1402f7e88, 0x1402f8070). Skipped when the marker is off the right or bottom edge (X − 60 ≥ 616 or Y − 48 ≥ 432 in one view). Turn direction (lockhud 11-15): positive degrees turn clockwise on screen. Checked on the Rebirth frame at 29937 (p 43, −38°): the needle’s tick line, which points up-left in the unturned sprite, then ends at the underline’s right end, as the table intends (the other sign would put it above the ring); the yellow frame at 10197 agrees.
- Name (one view only): the target’s player name (table 0x1404bca30, 65 bytes per slot; the slot is the target owner’s, or its stand-in index when the owner’s menu object has +0x10 set) through the rich string draw 0x1402477e0, cell 8 × 16, black at (X + 5, Y + 31) then the grade colour at (X + 4, Y + 30). One game mode substitutes a fixed string (0x140533cd8) for a slot whose word C + 0x12c70 is 0 (not followed). Then the ally sign (above).
The table’s 65 pairs, for 64 − p = 0..64 (x, y): (14, 7) (14, 7) (13, 9) (13, 11) (12, 12) (11, 14) (11, 16) (11, 18) (11, 19) (11, 21) (11, 23) (9, 25) (11, 26) (11, 28) (11, 30) (11, 31) (9, 33) (9, 35) (9, 37) (10, 39) (11, 40) (11, 42) (11, 44) (12, 45) (12, 47) (13, 48) (13, 50) (14, 52) (14, 54) (15, 56) (16, 57) (16, 58) (18, 59) (19, 62) (20, 63) (20, 64) (21, 65) (23, 44) (24, 46) (25, 48) (26, 48) (27, 49) (28, 50) (29, 52) (30, 54) (30, 49) (31, 51) (33, 52) (37, 56) (38, 56) (39, 58) (41, 59) (42, 59) (44, 60) (46, 61) (48, 61) (49, 61) (50, 62) (52, 62) (54, 62) (56, 62) (56, 63) (57, 63) (59, 63) (62, 63). The y values jump at entry 37 because h changes there; ty − h is continuous (−23 far … +56 near).
Checked against footage (private reference library, Rebirth on the Deck, one view): a green small ring with the numbers 29937, 34468 and 43466 (d = 309, 355, 445 u), a yellow middle ring with its centre dot at 8857 and 11251 (d = 99, 123 u); the number sits above an underline left of the ring, the underline 13 design px below the ring centre at 29937 and 2 px below at 43466 as the table gives (entries 21 and 15); the name below right in the ring’s colour. No clip shows the orange ring (nothing closer than 8 m while locked), the closing-in or a swap frame by frame.
Confidence. Grades, colours, rings, thresholds and their tie to the skill range test: H (code read, green and yellow and both numbers’ scale matched in footage). Distance number, gauge position, table, underline: H. Needle direction: H (footage, see 4). Orange ring, closing-in and swap offsets, cue 4: M (code only). Glyph sheet, split-view values, the substituted name: M / L as marked.
Update order checked (lockhud
11-15). On a fresh lock the update
stores the new index as “last” before the
on-screen / same-index test, so the fresh lock’s
own tick passes it and draws the closing-in at
counter 10 (k = 10, e = 200) with the grade
taken; after a switch or an off-screen tick the
counter is 10 with nothing drawn and the next
tick draws from 9. The targeted auto kind’s init
(0x140265ea0) runs the range test only for set
0, behaviour 4, 0x7C = 0, between the auto
object’s start point (+0x68) and the target’s
body record position (+0x60). Built in the
rebuild: PdLockMarker (the record),
PdHud._lock() (the one-view draw),
PdLockOn.range_test()
(AutoAttack.start).
Not decoded: which split layout H + 0x2a0 = 2 is against 1; the record’s +0x04 reader; the fixed-name mode; whether the Xbox build draws the same marker (PC build only read).
Implementation notes for the rebuild (built 11-15 lockhud: notes 1–5 for one view; split view not built)
pd_hud.gd_lock(): dropLOCK_AIM_HEIGHT; project the target’s torso root node (the body record position PdLockOn already uses for aim) and add nothing.player.gdline 353 uses the same constant for a 3-D point: switch it to the same node.- Take the grade from PdLockOn (1 / 2 / 3 at 80 / 300 u, body record to body record) and draw ring, colour and dot from the steady table; hide the marker when the lock tracks nothing or the target is off screen.
- Marker state per view: closing counter 10 → 0 with e = 2 · k² and the piece table, cue 4 of the common bank when it reaches 0, replay on switch / back on screen; ring swap f in 0.2 steps with the scale-and-recentre rule.
- Gauge: track 14, needle 77 rotated by p × 1.8125 − 116°, underline 76 and the number int((d − 10) × 100) at the table point; p from the three per-grade formulas. Ship the 65-pair table as a constant.
- Target name at (X + 4, Y + 30) in the grade colour with the 1 px black copy; ally sign 75 only if ally lock is ever enabled.
- Skills: gate the targeted auto kind with the range test (class 0 < 300 u, class 1 ≥ 300 u, class 2 always) and keep lunge homing at grade 1, so the HUD colour and what a cast does agree. No other range numbers exist; do not derive ranges from card text.
- Split-view sprites (120..134) and offsets are in the tables for when split screen is built.