Battle HUD (Menu/BtMenu<lang>.alr + executable)
Read from the 2017 PC build
(PDUWP.exe 1.3.25854.2). Converter:
pdconv <alr> <out> --textures
for the atlases,
converter/hudconv.py <alr> <out>
for the sprite table (sprites.json,
by index, no names). Godot:
godot/scripts/pd_hud.gd.
File. An ALR (version 82)
with chunks 0x11, 0x15, 0x16, 0x10 and three DXT
textures: 256×512 (panels, ring, capsule icons,
status icons, button plates), 512×512 (lock-on
reticles, range circles, capsule get/use/erase
flash frames), 1024×256 (result and start logos,
name plates, clock icon). Chunk 0x10 (10 988
bytes in the English file): +0x08 texture count
(3), +0x0C sprite count (180), texture records,
then 180 sprite records of 60 bytes filling the
chunk’s end:
+0x00 i32 texture, +0x04 char[32] name, +0x24 f32 u0 v0 u1 v1, +0x34 i32 width, height
(pixels; (u1-u0)·texture width
equals the width). The Japanese file has the
same layout.
Draw call.
0x1401983e0(ctx, handle, x, y, flags, scale_x*, scale_y*, argb*, …):
the battle menu object keeps one handle per
sprite at +0x268 →
[i·4] (so [rax+0x15c]
is sprite 87); handle packs
group/sub/sprite in its bytes.
flags bit 0 mirrors in x, bit 1 in
y; scale pointers stretch width/height (null =
1); argb tints (null = white). The
quad’s corners are (x, y) plus the
sprite record’s int16 origin, then width/height
(0x1402a83c0), so x/y are the
top-left corner. Space: the 640×480 design area
centred in the port’s fixed 853 : 480
frame (x −106.6 … 746.4 visible), and
that frame is fitted into the window with bars
when the window is not 853 : 480: see “Screen
frame, aspect and the 2-D space” (uifix
11-14; this replaces the earlier text here,
which read 0x1402a8aa9 as an ortho set-up and
0x14028a4a9 as the HUD area: the first is the
3-D projection and viewport reset after the 2-D
pass, the second a post-process pass’s texture
coordinates). The one-view layout uses x
< 0 and x > 640 (see below).
Layout tables (.rdata,
(x, y) int32 per variant: [0] one
view, [1] split left, [2] split right; the
variant is
[obj+0x2a0] == 0 ? 0 : 1 + view):
| Table | [0] | [1] | [2] | Drawn by |
|---|---|---|---|---|
| 0x1402f1250 | (−59, 57) | (−59, 57) | (462, 57) | status panels 0x140155310 |
| 0x1402f14e8 | (603, 36) | (84, 57) | (605, 57) | deck box 0x140151840 |
| 0x1402f1500 | (507, 344) | (79, 344) | (505, 344) | aura ring 0x140151f90 |
| 0x1402f11e0 | (465, 198) | (−39, 210) | (446, 210) | 0x140155160, 0x140158930 (not followed) |
| 0x1402f12d0 | (463, 92) | (−39, 92) | (446, 92) | 0x140158930 (not followed) |
Elements (offsets from the table base; sprite numbers are table indices):
- Own status panel: box 35 (142×26)
at the base tinted palette[0x10] 0xfff57e27, or
palette[0x18] 0xff89bc18 when a flag
(
r12, not traced) is set (0x14015730e); one health segment, sprite 32 (4×16), per health point at(0x33 + 4·i, 3), at most 0x14 (0x14015768e). Health is shown in 20-point tiers: tier(hp − 1) / 20(0x1401573ba), the tier’s points lit in palette[{0x11, 0x12, 0x13}[tier]] (0xffad3a03, 0xffb06b05, 0xffcc9835; with the flag {0x1a, 0x1b, 0x1c}), the tier’s missing segments in the tier below’s colour, argb 0 (not visible) in tier 0 (0x1401573dc). The shown value is a float at+0x2bcthat drains toward the real health (0x1401557f3, rate at 0x1402f7d0c, delay counter+0x2ac; not played yet); with[obj+0x20c]bit 2 the colour is scaled by[obj+0x21c], and the aura-state blend (below) applies to it too. The palette at 0x1402f2a40 is 48 ARGB words (menu, panel and team colours). The panel’s row cursor[obj+0x2a4]advances 0x1c per row; other players use the small box 37/89 and 4-wide segments 34 at(0x33 + 4·i, row + 4). - Aura ring: sprite 56 (98×98, the
ring with the four button sockets) at (−19,
−18), level box 57 (58×58) at (0, 0) tinted
0xff6e2500 (blended toward 0xffbebebe /
0xffbb56e6 / 0xffffd83d by a state at
+0x38c, 0x14015206c); ten recharge bars, table 0x1402f1470 of(sprite, x, y): sprites 58–67 at (29,4) (41,9) (48,20) (42,35) (29,45) (14,45) (6,36) (4,20) (6,9) (14,4) (clockwise from the top). They show the progress toward the next aura point, not the level. The player record ([0x1404bc608 + 8·p]) has the level as int32+0x18and the aura as f32+0x1c(read at 0x140152162/0x140152166); the aura number shown is the aura truncated to an integer. The bar count (from 0x1401524ca): when aura ≥ level, no bar is drawn; else n = int(frac(aura) · 10) + 1, with frac(aura) = aura − int(aura) and the 10.0 constant at 0x1402f7f7c (1 bar at a whole point, 10 from .9 up). The loop at 0x140152590 draws the first n table entries (sprite handle from the HUD’s sprite list at+0x268, position = ring origin + table x/y) with argb 0xff5a1e02 (0x140152568). Unlit bars are not drawn (the dim track is the level box’s art). No flash on a completed point in this function. - Aura state colours:
+0x38c(per view, stride 0x1c) defaults to −2 (0x140150bc8): plain colours. A status check (0x14024d4d0) sets it to 0, 1 or 2 with a 16-tick timer+0x390(0x140150acd); the box, numbers and bars then lerp (0x140153640, by a/255) toward 0xffbebebe, 0xffbb56e6 or 0xffffd83d with a = 255 / (timer − 11) for timer ≥ 12, 255 / (5 − timer) below 4, else 255 (0x140152006). Not played yet. - Aura point sound (regeneration
0x14024de20): the tick keeps int(aura) from
before the regen (0x14024de63), adds and clamps,
and when int(aura) afterwards differs
(0x14024dee7) and the player’s battle menu
object (
[player+0x61a0]) has+0x30set, calls 0x140276330 with (slot 0, cue 5, 5, 0x1000, 0x1000, no position) → 0x140240870 (no position: not 3-D). So common-bank cue 5 (one track, transposed −6 semitones, see “Pitch”) plays once per whole point the regeneration gains (not when a capsule or a cost changes the aura). One cue per tick whose integer part changed: at the decoded rates one tick gains at most factor × 1.25 / 30 × (100 + s) / 100, far below a point, so the game never crosses two points in one tick. Ours plays one per point crossed (only a debug jump or a late snapshot can cross several). Netplay (ours, not the exe’s): a client counts a point only when int(aura) rises above the highest point it has already counted; that mark follows int(aura + 0.1) down, so snapshots that straddle a point (jitter of a few hundredths) give one sound, a spent point arriving by snapshot is counted again whatever the drop size, and a snapshot that jumps past a point still gives it. - Slots: drawn by 0x140152620 in a
loop of four; capsule icons by skill type
through 0x1402f1278 (type 0..6 → sprites 0, 2,
4, 8, 12, 10, 6; small 8×4 icons: 0x1402f1348 →
1, 3, 5, 9, 13, 11, 7); name plates of three
pieces (left cap, middle stretched by the text
width − 3, right cap: 171–173, 174–176, 177–179)
placed from the text width
(
[0x14047b908] − [0x14047b900]). Slot icon overlays (lock 139, question 140, skull 142, shield 141, ice 136–138) at small fixed offsets from the slot centre. (uifix 11-14: the slot icon corners are decoded, “Slot icons, cost numbers and name text” below: (19, −18) (−18, 18) (55, 18) (19, 57) from the ring base; the socket centres (30, 70) (68, 29) (−10, 30) (30, −9) used so far were measured from the art and are 1–4 px off.) - Slot colours: per skill type an RGB
triple of int32 at 0x1402f12f0 (type 0..6:
(82,88,88) (90,19,21) (19,19,75) (70,19,73)
(38,85,21) (104,80,19) (19,71,73)), scaled by
[obj+0x21c]and blended by the aura state like the other colours (0x1401529e4). It is not a plate tint (the plate pieces are drawn with a null argb): it goes to 0x140151cb0, which draws a custom quad by the name string at 0x1402f1538 (a card back; the next two strings name text and clock backs) between render-state changes (0x140020c40) after the plates: the coloured card behind each slot. Not played yet. - Numbers: digits are 16×16 glyph
cells drawn by 0x140198ad0 from source
(digit·16, 0x740), set 12 apart, after a black pass (0x1402a80b0 with 0xff000000 corners). Health: panel + (0xf, 4) in the segment tier colour (0x14015751f). Aura: level box + (0x11, 0xc) in 0xffad3a03 (blended by the aura state, 0x140152203). Level: level box y + 0x21 in 0xff5a1e02 (0x14015249b; its glyphs come from a computed source, its x not traced). - Deck box: sprite 30 (94×20) at the
base tinted 0xfff57e27, or 144 (76×20) at
(+0x13, 0) in the other mode
(
[obj+0x12c40]); count text at (+7, +1) in 0xff5a1e02 (0x1401519c6), then capsule icons. - Clock: sprite 87 (15×14) at x −37 (one view) or 639, y 0x1ac (428), tint 0xfff54322 (0x140154cb0); “m:ss” text at x + 0x12.
- Lock-on marker (draw 0x140153a10, update 0x1401536e0): see “Lock-on marker: range colours, sizes, distance gauge” (docs 11-15 lockring; this replaces the earlier bullets here, which read the rings 15 / 20 / 25 as three sizes with an untraced rule, paired the one-view ring 20 with the split-view ring 125 and the track 14 with the large ring, and called the needle 77 a range line).
- Result / start logos: sprites 81–86
(1024×256 texture); placement in
battleend/battlestartscripts (not decoded).
Skill
card (Menu/WusMn<lang>.alr +
executable)
The card the battle HUD shows while a player
stands at one of their own capsules (the same
card routine draws skills in the menus). Read
from the 2017 PC build. Converter:
pdconv <alr> <out> --textures
and
hudconv.py <alr> <out>
as for BtMenu (same sprite record layout; the
English file has 201 sprites on eight textures);
the game reads
<data>/wusmenu/. Godot:
PdHud._card().
When. Each tick a player’s “standing at” state is rebuilt (0x140251550): another player within 15 units (0x1402516a0, radius 0x1402f7fb0 = 15.0) gives state 2; else the first of the player’s own three capsule slots that is out on the field (slot state 2) and within 15 units gives state 1 with that capsule’s skill id (0x14014f630: the capsule point is lowered by 9 units, 0x1402f7f64, before the distance to the player’s position is taken, so the test is a sphere of 1.5 m around a point 0.9 m below the capsule); else an entry of the list at 0x14058bd30 gives state 3 (not identified), else 0. Other players’ capsules are found by a second scan (0x14014f700, same test) into another field and never give a card. The battle menu (0x140155160) draws the card for states 1, 3 and 4; a held slot button first shows that slot’s card instead. No open/close animation or sound is in this path: the card is drawn on the frames the state is set.
Gates and the held slot (0x140155160, in order; any failing gate draws no card at all):
- the battle menu’s flag word
+0x58needs bit 0x10. The menu sets the word to 0xffff at init (0x14015017c); one script command (entry 13 of the native table at 0x1403f1d50, 0x1402169a0; its arguments are a mask and an on/off value) switches bits later (0x1401581a0); - the per-player word
+0x3fcof the menu (records of 0x210 bytes per player) must be 0. It is 1 while a “choose a capsule from the rest of your arsenal” list is open: opened by 0x1401582f0 (called from a skill effect at 0x140271221 with the 30 − drawn capsules left), drawn by 0x140158930, closed by 0x1401585f0; - the global 0x140533744 must be 3: the battle’s load state (0 at init 0x140245a35, 1/2 while loading, 3 once the four players are set up at 0x1402483d7 and at 0x14024605d), not a game mode; it holds during any loaded battle, versus included;
- then the held slot (0x140150080 with the
view’s player, the local player when the menu
has one view,
+0x2a0= 0): the first of the four slots, in slot order, whose button bit is in the player’s held-button mask (+0x1425c; the default masks at+0x142b0 + 4·slot, remapped ones through+0x14288when option 0x24 is on). No hold time, no other condition (moving, casting, locked on or the “standing at” state do not matter). For that slot (records of 0x50 bytes from the player’s+0x350): an empty slot (+0x350= 0) falls through to the capsule card, even when a later held slot holds a skill (only the first held slot is looked at); with+0x384≥ 0 (an override index whose label comes from a 65-byte name table at 0x1404bca30; not identified) nothing is drawn; else the card of the slot’s skill id+0x378; - the capsule card also needs the menu’s
per-player nibble
+0x118 + 4·player& 0xf to be 0 (not identified).
Where. Layout table
0x1402f11e0, (x, y) per view
variant: one view (465, 198), split left (−39,
210), split right (446, 210): the top-left
corner in the HUD’s 640×480 space, fixed on
screen (it does not follow the player or the
capsule).
Layout (card routine 0x140168410, offsets from the corner; sprites are WusMenu table indices; the battle HUD passes no frame flag and style 0, so the window frame and the number strip are skipped. (uifix 11-14 correction: there is no separate “long description”; the description below is the same text in every caller. See “Skill card callers, text lookup and the aura card”.)):
- back, sprite 22 (234×96), at (0, 0); type band, sprite 23 (230×26), at (3, 1) tinted per skill type (record +0x0E) from a table built at the routine’s start: type 0..6 = (255,255,255) (255,165,165) (165,170,225) (225,165,205) (166,225,165) (225,223,165) (165,204,225), no skill (138,138,138);
- name at (10, 3), colour 0xff262626, 8×16 cells; school icon (record +0x12) at (0xb5, 1), school 0..5 → sprites 15, 21, 20, 18, 16, 17 (0x140167c8a);
- the stat line: sprites at y 0x19 tinted 0xffa5a5a5, numbers as 14×16 glyph cells (the digit strip at source row 0x740, 14 apart) at y 0x16 in the same grey. Cost label sprite 1 at x 4, the cost (+0x28) from x 0x28 (from 0x24 for 10..19). At x 0x44: sprite 14 for attacks (type 1) with the damage (+0x58, only when the skill set +0x52 and the formula +0x56 are 0) at x 0x67; for defenses (type 2) the defense value (+0x5A when the set is 2 and +0x54 is not 6); otherwise sprite 0 (a dash) and no number. The uses icon, sprite 13, at x 0x7e with the uses glyphs from x 0x8d; the range label at x 0xa1;
- the range label: 0x140167970 classes set-0 records by behavior (+0x7A) and range (+0x54): melee kinds 3, 12, 13, 14 → 1; 8, 9 → 5; 4, 16 → none; range ≠ 1 → 2; behavior 0, 5, 10, 11 → 3; else 4; class k draws sprite {12, 9, 8, 8, 4}[k − 1] (table 0x1402f2850). With no class, 0x140167a10 gives: set 3 → 1; set 0 → 3 for behavior 8, 16, or 4 with +0x7C = 2, else 2; set 4 → 1 for range 0, 2 for range 1, else 3; set 1 → 5 for range 2 or 5, else 4; others 0. Then 1 (or any defense) draws sprite 10, 0 sprite 0, 4 and 5 go on at 0x140169c1c (not followed), environment skills sprite 7, set 0 with behavior 4 sprite 6, 2 sprite 10, 3 nothing;
- the description (record text) at (2, 0x2d) in 0xff3e3e3e over a shadow pass at (3, 0x2e) in 0xff858881, 7×14 cells, wrapped at 0xe5.
Colours are scaled by the battle menu’s
brightness [obj+0x21c] when the
flag bits 0x40000, 0x80000 or 0x100000 are set
(not played).
Font atlas
(System/dbfont.ddx).
Layout from the shared notes (“Character table”,
“Sources”), checked by decoding our
file (wrapped in a DDS header and
opened with Pillow): no header, 1,048,576 bytes
= a 1024 × 2048 DXT1 surface in plain row-major
block order, white glyphs on black, in
16 × 16 pixel cells, 64 per row
(123 of the 128 cell rows hold glyphs). Cells
0..255 are a single-byte code page (cell =
character code: the space cell is empty,
printable ASCII from 0x21); from cell 256 on the
two-byte Japanese set follows in its standard
row order, 94 cells per row of the set (unused
rows skipped). dbfont_ko.ddx is the
same shape. Glyphs sit at the left of their cell
with different ink widths (a narrow letter
covers 2 px, a wide one 11), so the text routine
advances by a per-glyph width: the width table,
the code-point map and the text routines are in
“Bitmap font and text drawing” below (docs
11-10; the card text’s 8×16 setting is the atlas
at 1:1 and 7×14 is 7/8 scale).
Not decoded yet: animations (pip/box blending, slot flashes 91–118), other players’ panels in detail, and the per-sprite int16 origin. (Text, the digit strip at y 0x740 and the status icons are decoded: “Bitmap font and text drawing” and “HUD status icons and clock” below, docs 11-10. The card-back quad 0x140151cb0 is (characters − 1 or − 2) · 9 px wide.)