feat(editor): WBRD JSON round-trip closure

Adds --export-wbrd-json / --import-wbrd-json. battlegroundName
emitted as informational field; battlegroundId int is
authoritative. All 3 presets (av/wsg/ab) byte-identical binary
roundtrip OK including the AB preset's weekly bonus quest token
binding.

Live-tested incentive-inversion validator: hand-mutated WSG
bracket 6 (rewardId 15) to swap winHonor and lossHonor — loss
becomes 750, win becomes 375. Validator correctly errored:
"lossHonor=750 > winHonor=375 — losing rewards more than winning
(no win incentive)". Catches the class of reward-config bugs
where misordered fields would silently flip the optimal player
strategy from "play to win" to "AFK and lose for max XP/hour".

CLI flag count 1461 -> 1463.
This commit is contained in:
Kelsi 2026-05-10 05:27:03 -07:00
parent a10497a026
commit a2f0055a4d
3 changed files with 128 additions and 0 deletions

View file

@ -2723,6 +2723,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WBRD entries (id / bg / bracket / minPlayers / win+loss honor / markId / win+loss marks / bonusItem)\n");
std::printf(" --validate-wbrd <wbrd-base> [--json]\n");
std::printf(" Static checks: id+battlegroundId required, bracketIndex 1..6 (vanilla), minPlayersToStart > 0 (else queue would never start a match), no duplicate rewardIds, no duplicate (bgId,bracket) pairs (runtime reward-lookup tie), bonusItemCount > 0 requires bonusItemId; CRITICAL: lossHonor <= winHonor (else losing rewards more than winning, no incentive to play to win). Warns on winMarks=0 with markItemId set (vanilla wins always granted at least 1 mark)\n");
std::printf(" --export-wbrd-json <wbrd-base> [out.json]\n");
std::printf(" Export binary .wbrd to a human-editable JSON sidecar (defaults to <base>.wbrd.json; battlegroundName field is informational; battlegroundId int is authoritative)\n");
std::printf(" --import-wbrd-json <json-path> [out-base]\n");
std::printf(" Import a .wbrd.json sidecar back into binary .wbrd (battlegroundName ignored; bgId int authoritative — round-trips per-bracket reward tables byte-identical)\n");
std::printf(" --catalog-pluck <wXXX-file> <id> [--json]\n");
std::printf(" Extract one entry by id from any registered catalog format. Auto-detects magic, dispatches to the per-format --info-* handler internally, then prints just the matching entry. Primary-key field is auto-detected (first *Id field, or first numeric)\n");
std::printf(" --catalog-find <directory> <id> [--magic <WXXX>] [--json]\n");