Arsenal editor input, skill card panel, screen frame and the aura card
Three things a playtest found wrong, read
from PDUWP.exe 1.3.25854.2 and the
arsenaledit menu script. Confidence
per part. Corrections made elsewhere in this
file by this run: the HUD space paragraph and
the slot centre line of “Battle HUD”, the “long
description” remark of “Skill card”, and item
types 8 / 9 / 12 / 14 / 16 / 17 of the menu
engine’s type table.
Arsenal editor, skill lists and the card panel
Which screens have a card (H, from
the scripts’ item creation): the
arsenal editor (arsenaledit, menu
id 64), the laboratory stock, and the shop’s buy
and sell lists each create one item of type 8
(detail panel) and one of type 9 (skill card).
The versus menu, the versus arsenal pick
(livearsel), the shop front, the
arsenal shop, the laboratory front and the trade
screen create neither.
No button, no page, no scroll
(H). Each tick the editor’s tick
functions read the highlighted skill id
(built-in 0x5018 = editor object
[0x1404bec08] + 0xb48; −1 on a
button) and write it into field 9 (the selected
row, item + 0x12) of the panel and the card
item. Both are drawn every frame. So the
description is the card’s own text and follows
the cursor at once; the d-pad only moves the
cursor.
Edit scene items (design units, 640×480):
| Item | Type | Position | Size | What |
|---|---|---|---|---|
| 1 | 17 | (48, 32) | the grid of 30 places + 3 buttons (11 row strings) | |
| 0 | 16 | (48, 72) | arsenal name header | |
| 12 | 1 | (60, 112) | 230×120 | list window |
| 8 | 2 | (350, 60) | 230×32 | text box |
| 3 | 8 | (198, 319), or (188, 324) with style | 0x100 when built-in 0x5077 (editor + 0xb58) = 1 | 162×56 | detail panel |
| 4 | 9 | (350, 324) | card | skill card of the highlighted skill |
| help | 3 | (0, 374) | 640×104 | help bar (help scene) |
Draw order of the native items: 15, 1, 4 (variants add 8, 9, 13).
Grid input (type 17, 0x140248b50; H for the routing, M for the move table). Editor mode at + 0xb34: 0 = grid (handler 0x140159310), 1 = stock list (handler 0x140159ba0). A / Start raise event 5 (cue 0; cue 2 when the result code + 0xb38 is 10), B / Back event 6 (cue 1), X event 8, Y event 9.
Grid cursor (0x14016fee0; cursor at object + 0x220, repeat word + 0x228; cue 3 per move; no move while any of pad mask 0x33f0 is pressed). Places 0..29 are 3 columns of 10 rows (row = index mod 10); 30, 31, 32 are the buttons.
| Press | From | To |
|---|---|---|
| up | row > 0 | −1 |
| up (fresh press only) | 0 or 10 | 32 |
| up (fresh press only) | 20 | 31 |
| up | 30 / 31 / 32 | 9 / 29 / 30 |
| down | row < 9 | +1 |
| down | 9 or 19 / 29 | 30 / 31 |
| down | 30 | 32 |
| down (fresh press only) | 31 / 32 | 20 / 0 |
| left | ≥ 10 | −10 |
| left (fresh press only) | < 10 | +20 |
| left | 31 | 30 |
| left (fresh press only) | 30 | 31 |
| right | < 20 | +10 |
| right (fresh press only) | 20..29 | −20 |
| right | 30 | 31 |
| right (fresh press only) | 31 | 30 |
“Fresh press only” = not on auto-repeat (wraps stop a held direction). On a place: A opens the stock list on the tab of that skill’s type (record + 0x0E), Y adds another copy of the same skill (0x140159db0), X replaces it with an aura card. Buttons: 30 → result code 3, 31 → leave check (0x140159520 compares the sorted decks: code 5 unchanged, 7 changed), 32 → sort.
Stock list cursor (0x140171390; M): 8 visible
rows of 24 px; tab at editor + 0x278, a 24-byte
{row, …, top} record per tab from + 0x27c. Up /
down ±1 (a fresh press wraps top ↔︎ last,
auto-repeat stops at the ends); LT / RT
page by 8; left / right change the
skill type tab 0..6 (wrap on a fresh press; in
modes ≤ 1 of [+0x12d8] empty tabs
are skipped); cue 3. A adds the skill (result
codes 8, and 10 = copy limit), B returns to the
grid.
Skill card callers, text lookup and the aura card
Card routine 0x140168410(object, skill id, x, y, flags, –, brightness, style, frame):
- flags (arg 5; 0x4000, 0x2000, 0x100000, 0x80000, 0x40000, 0x20000, 0x8000): which parts are scaled by the brightness (arg 7).
- style > 0 (arg 8) adds a strip below the card: rectangle at (x, y + 0x60), 0xeb × 0x16, colour 0xff001e1a; the skill’s number (record + 0x02, three digits) at (x + 0xa, y + 0x62) in 0xff5cac95; rarity marks (record + 0x08: below 5 → value + 1 copies of the sprite handle at object + 0x2a8, 5 and up → one of + 0x2ac) from x + 0xd2 leftwards, 0x10 apart, at y + 0x61.
- frame (arg 9) only adds the
window frame (0x14016cf30; size from the sprite
record
- 0x34 / + 0x38, height + 0x16 with the strip).
- The description is drawn by every caller (H): shadow at (x + 3, y + 0x2e) in 0xff858881, text at (x + 2, y + 0x2d) in 0xff3e3e3e, 7×14 glyphs, wrap width 0xe5.
- Skill id −1 (M): a one-character placeholder name at (x + 0x6e, y + 3), no school icon, no description, type colour index 7 (138, 138, 138).
Menu item type 9 calls it with flags 0, style = item + 0x1c and frame 1; the battle HUD with style 0 and frame 0.
Text lookup (H).
gsdata loader 0x14017dcb0:
| File offset | Field |
|---|---|
| 0x00 | file size |
| 0x04 | table size |
| 0x08 | record count (753 in the 1.3 English file) |
| 0x0C | table size (copy) |
| 0x10 | not identified (0x8c) |
| 0x14 | highest card id (374; the deck check uses it) |
| 0x18 | records, 0x90 bytes each |
| 0x34004 | text header: {size, entry count (393), table size}; 12-byte entries {index, name offset, description offset} from 0x34018 |
The loader makes the text offsets entry-relative pointers and **rewrites every record’s
- 0x00 from the file’s text index to the position of the entry with that index, or 0 when there is none** — a record without text shows entry 0’s text in the game. The card’s name and description are that entry’s two strings; there is no second, longer text.
The aura card is skill record 0 (H). The battle deck build (0x14014f830) counts cards per skill id, skips −1 and ids above the highest card id, then sets count[0] = 30 − counted cards. Record 0 has type 0, cost 0, register word (+ 0x04) 0 and text index 301. It is the record a held aura capsule and an aura card in the editor show. There is no per-level text.
Converter fault found (fixed in this run,
skilldata.py): the record loop ran
over (text start − records start) / 0x90 = 1479
slots instead of the header’s 753, and required
the register word of a usable skill, which
record 0 does not have. Record 0 was dropped,
and a slot of the following table (slot 1451)
that happened to pass the filter came out as the
only type-0 “skill”, with another skill’s text
index (99) and cost 10. That is the wrong aura
description. The fix reads the count from the
header (GsHeader) and always keeps
record 0 (AURA_RECORD); the real
file now gives 386 skills, one aura record (id
0, record 0, text index 301, cost 0). (uifix
build 11-14) With records without a text
entry given the table’s first entry (as the
loader does, text_entry()), two
more usable records come out (both with ids
above the highest card id, so no deck holds
them): 388 skills.
Screen frame, aspect and the 2-D space
The frame (H: code and constant). 0x140021e70 computes the game area (globals 0x1404baf90 x, + 4 y, + 8 width, + 0xc height) from the window (0x1404bad70…): with K = 1.7770833 (0x1402f7e70, = 853 / 480),
- window aspect ≥ K: W = h · K, H = h, X0 = (w − W) / 2 (bars left and right);
- else: W = w, H = w / K, Y0 = (h − H) / 2 (bars above and below, e.g. on 16:10).
0x140021710 maps every design viewport into
it: sx = X0 + x · W / 640, sy = Y0 + y · H / 480
(a wide override when [0x1404baf6c]
≠ 0). The 3-D view uses the same frame;
0x140291570 is the perspective builder (aspect
853 / 480 when wider than tall).
The 2-D space (M: title section and the HUD’s x < 0 values agree). 853.25 × 480 units, the 640-wide design area centred (visible x from −106.625 to 746.375), drawn over the whole frame: screen x = X0 + (x + 106.625) · H / 480, screen y = Y0 + y · H / 480. The 2-D viewport setter 0x14028dbc0(0, 0, 640, 480) also hands the rectangle (24, 12, 616, 468) (0x1402f8660) to the device (vtable + 0x168; not identified, L: a safe-area scissor).
| Window | Scale (px per unit) | X0, Y0 | Ours today (HUD: h / 480 from y = 0; menus: min(w/640, h/480) centred) |
|---|---|---|---|
| 1920×1080 | 2.2505 | 0.2, 0 | 2.25: same within half a pixel |
| 1280×720 | 1.5003 | 0.1, 0 | 1.5: same |
| 1280×800 (Deck) | 1.5006 | 0, 39.9 | 1.6667 from y = 0: 11 % too large and not letterboxed |
At 1280×800 this moves every element (top-left corners, screen px, game → ours): status panel (71, 125) → (8, 95); deck box (1065, 94) → (1112, 60); aura ring (921, 556) → (952, 573); clock (104, 682) → (45, 713); skill card (858, 337) → (882, 330). Menus at 1280×800 use scale 1.6667 (the 640×480 area fitted by height) instead of 1.5006.
Slot icons, cost numbers and name text
Inside the ring routine (0x140151f90; base (bx, by) = the ring’s layout position from table 0x1402f1500). M (read in the code; not checked against footage frame by frame).
| Slot index | Position on the ring | Capsule icon top-left | Name text | Plate y |
|---|---|---|---|---|
| 0 | top | (bx + 19, by − 18) | left edge bx + 0x2f, y = by − 0x10 | by − 0x11 |
| 1 | left | (bx − 18, by + 18) | right-aligned: starts at bx + 0xe − 7 · characters… (see below), y = by + 0x14 | by + 0x13 |
| 2 | right | (bx + 55, by + 18) | left edge bx + 0x51, y = by + 0x14 | by + 0x13 |
| 3 | bottom | (bx + 19, by + 57) | left edge bx + 0x2f, y = by + 0x3b | by + 0x3a |
- Slot index ↔︎ button by pad geometry (M): top Y, left X, right B, bottom A.
- Icon sprite by skill type through table 0x1402f1278; tint white, or the brightness value when flag bit (4 << slot) of + 0x208 is set.
- Cost number: black (0xff000000), 8×16 cells, plain decimal, centred on icon x + 9, at icon y + 2.
- Name glyph width 7 (the 7×14 set). The left slot’s text ends near the icon and grows leftwards; its start is computed from the character count (the exact constant pair was not resolved, L). Plate pieces sit at plate y − 2 with caps at −0x1b / + 5 / −0x21 around the text width (L).
- Table 0x1402f1418 (22 int32 offsets) belongs to the overlay part and was not followed.
Against ours (pd_hud.gd SOCKETS,
centres → top-lefts (21, 61) bottom, (59, 20)
right, (−19, 21) left, (21, −18) top): off by
(+2, +4), (+4, +2), (−1, +3) and (+2, 0) design
units; the cost is drawn white, smaller and 2
units lower.
Not decoded
- The name plate piece arithmetic and the left slot’s exact text start (0x140152b09).
- The rectangle (24, 12, 616, 468) handed to the device by the 2-D viewport setter.
- (The lock reticle’s size pick and projected point are decoded: “Lock-on marker”, docs 11-15 lockring.)
- The versus arsenal pick’s contents view (no card item: what it shows of an arsenal).
- The eight label entries of the type 8 detail panel (0x14016f2c0) and types 12 / 14 / 16 drawing (0x1401710a0, 0x140173650, 0x14015c280).
- Whether the card’s placeholder branch for id −1 is ever reached in battle.
Implementation notes for the rebuild
(uifix build 11-14: 1, 2, 3 and 5 are
implemented — PdFrame in
scripts/pd_frame.gd, the
re-converted skills.json with
PdHud.aura_record(),
skilldata.py text_entry(), the
decoded slot anchors in pd_hud.gd;
4 natively in arsenal_builder.gd,
see PLACEHOLDERS.md for what is still
ours.)
- One screen frame for
everything. A shared function returns
the 853:480 frame for the window (rule above);
HUD (
pd_hud.gd space()), menus (pd_menu.gd _fit()), title and the 3-D viewport all use it; bars are black. 2-D origin = frame corner + 106.625 units. - Re-convert the skills with
the fixed
skilldata.py; the aura card is skill id 0 / record 0.pd_hud.gdshould take id 0 directly instead of “the first type-0 record”. - A record whose text index has no entry shows entry 0’s text (the converter currently writes empty strings): decide in the converter, by position, not in Godot.
- Arsenal screen: either run
arsenalediton the interpreter (needs group 0x50 built-ins and item types 8, 9, 12, 16, 17) or, as a first step, give the current builder the game’s behaviour: 3 × 10 grid with the move table above, the card of the highlighted place at (350, 324) drawn by the HUD’s card code with style 1 (number strip, rarity marks) and the frame, updated every tick; stock list of 8 rows, LT / RT page, left / right type tabs. - Slot icons at the four decoded corners, cost in black 8×16 at icon (+ 9 centred, + 2); name text at the decoded anchors, left slot right-aligned.