SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
Loading...
Searching...
No Matches
gen_sdt_from_regulation Namespace Reference

Detailed Description

gen_sdt_from_regulation.py — extract Sekiro (SDT) param values, event flag ids and
shipped English display names from a local Sekiro install into db_sdt/ tables.

NAME CORRECTION — READ FIRST
    This file is called gen_sdt_from_REGULATION, and Sekiro has no regulation.bin.
    Not loose and not inside the archives: that is a DS3/Elden Ring file. Sekiro's
    params are /param/gameparam/gameparam.parambnd.dcx. The name is kept only because
    renaming it would break the /sekiro-data command that calls it; read every mention
    of "regulation.bin" below as that path instead. See CLAUDE.md and the memory
    sekiro-regulation-unpack for the unpack route (UXM-Selective-Unpack has the Sekiro
    RSA keys; BinderTool ships DS3's and will NOT open these archives unmodified).

WHY THIS EXISTS
    Paramdex ships PARAMDEFs (field layouts) and Names (id -> annotation) but NOT
    param VALUES. Every event flag id the analyzer needs lives in the game's own
    param binder. Paramdex SDT/Names are also machine-translated Japanese dev
    strings ("Rough temple", "Protagonist_arm_prosthesis") — the shipped English
    names live in msg/engus/*.msgbnd.dcx as FMG entries. So: defs from Paramdex,
    values from the param binder, display names from FMG.

FORMAT NOTES (reconciled against JKAnderson/SoulsFormats)
    - Sekiro's regulation.bin is NOT encrypted. SoulsFormats has
      DecryptDS3Regulation / DecryptERRegulation / DecryptAC6Regulation and no
      Sekiro equivalent; SDT regulation is a plain DCX-wrapped BND4.
    - PARAM header: Format2D lives at 0x2C (legacy name, real offset 0x2C).
      LongDataOffset (0x04) -> 24-byte row entries; OffsetParamType (0x80) ->
      param type is a string at an offset rather than inline.
    - FMG: Sekiro uses the DarkSouls3 ("wide") variant — 64-bit string offsets.

USAGE
    python3 tools/gen_sdt_from_regulation.py \
        --game-root "/path/to/Sekiro" \
        --paramdex  "/path/to/Paramdex" \
        --out       "db_sdt" \
        --report    "db_sdt/_extract_report.md" \
        [--strict]

EXIT CODES
    0 ok · 2 bad input/paths · 3 parse failure · 4 acceptance gate failed (--strict)