feat(pipeline): add WLDS (Wowee Loading Screen) catalog

63rd open format — replaces LoadingScreens.dbc plus the
per-zone background-image tables. Defines the loading-screen
images shown when the client crosses into a new map /
instance, with optional level-bracket gating and expansion
gating (TBC art only shown if expansion installed).

When multiple screens match the player's current map + level
+ expansion, displayWeight selects randomly between them — a
zone with 3 weighted variants gets a different image roughly
proportional to weight.

4 expansion gates (Classic / TBC / WotLK / TurtleWoW),
isAnimated flag for screens with subtle animation,
isWideAspect flag for 16:9 raid intro art (vs 4:3 standard).

Cross-references with prior formats — mapId points at
WMS.map.mapId (which map triggers this loading screen);
mapId=0 is the catch-all sentinel for screens shown when
no map-specific screen matches.

CLI: --gen-lds (3 base screens — Elwynn level 1-30, Orgrimmar,
GenericFallback level 31-80 catch-all), --gen-lds-instances
(5 WotLK dungeon screens with mapId+expansion cross-refs:
Halls of Lightning/Stone, Utgarde Pinnacle, Violet Hold,
Old Kingdom), --gen-lds-raid (3 raid intro screens —
Naxxramas/Ulduar/ToC at isWideAspect=1 with weight=3),
--info-wlds, --validate-wlds with --json variants. Validator
catches id+name+texture required, expansion 0..3, level range
valid, weight=0 (in pool but never picked), and the practical
catch-all overlap warning when multiple mapId=0 screens share
overlapping level brackets (random pick becomes
non-deterministic).

Format graph: 62 → 63 binary formats. CLI flag count: 847
→ 854.
This commit is contained in:
Kelsi 2026-05-09 20:59:25 -07:00
parent 0574a0f5d8
commit 07137acc89
10 changed files with 672 additions and 0 deletions

View file

@ -191,6 +191,8 @@ const char* const kArgRequired[] = {
"--gen-rune", "--gen-rune-blood", "--gen-rune-frost",
"--info-wrun", "--validate-wrun",
"--export-wrun-json", "--import-wrun-json",
"--gen-lds", "--gen-lds-instances", "--gen-lds-raid",
"--info-wlds", "--validate-wlds",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",

View file

@ -98,6 +98,7 @@
#include "cli_pvp_catalog.hpp"
#include "cli_bags_catalog.hpp"
#include "cli_runes_catalog.hpp"
#include "cli_loading_screens_catalog.hpp"
#include "cli_quest_objective.hpp"
#include "cli_quest_reward.hpp"
#include "cli_clone.hpp"
@ -237,6 +238,7 @@ constexpr DispatchFn kDispatchTable[] = {
handlePVPCatalog,
handleBagsCatalog,
handleRunesCatalog,
handleLoadingScreensCatalog,
handleQuestObjective,
handleQuestReward,
handleClone,

View file

@ -65,6 +65,7 @@ constexpr FormatMagicEntry kFormats[] = {
{{'W','P','V','P'}, ".wpvp", "pvp", "--info-wpvp", "PvP honor rank + arena tier catalog"},
{{'W','B','N','K'}, ".wbnk", "items", "--info-wbnk", "Bag / bank slot catalog"},
{{'W','R','U','N'}, ".wrun", "spells", "--info-wrun", "Death Knight rune cost catalog"},
{{'W','L','D','S'}, ".wlds", "ui", "--info-wlds", "Loading screen catalog"},
{{'W','F','A','C'}, ".wfac", "factions", nullptr, "Faction catalog"},
{{'W','L','C','K'}, ".wlck", "locks", nullptr, "Lock catalog"},
{{'W','S','K','L'}, ".wskl", "skills", nullptr, "Skill catalog"},

View file

@ -1615,6 +1615,16 @@ void printUsage(const char* argv0) {
std::printf(" Export binary .wrun to a human-editable JSON sidecar (defaults to <base>.wrun.json)\n");
std::printf(" --import-wrun-json <json-path> [out-base]\n");
std::printf(" Import a .wrun.json sidecar back into binary .wrun (accepts spellTreeBranch int OR name string)\n");
std::printf(" --gen-lds <wlds-base> [name]\n");
std::printf(" Emit .wlds starter: 3 base loading screens (Elwynn / Orgrimmar / GenericFallback catch-all)\n");
std::printf(" --gen-lds-instances <wlds-base> [name]\n");
std::printf(" Emit .wlds 5 WotLK dungeon loading screens (Halls of Lightning / Stone / UP / Violet Hold / Old Kingdom)\n");
std::printf(" --gen-lds-raid <wlds-base> [name]\n");
std::printf(" Emit .wlds 3 raid intro screens (Naxxramas / Ulduar / Trial of the Crusader) with isWideAspect=1\n");
std::printf(" --info-wlds <wlds-base> [--json]\n");
std::printf(" Print WLDS entries (id / mapId / level range / display weight / expansion / animated+wide flags / name)\n");
std::printf(" --validate-wlds <wlds-base> [--json]\n");
std::printf(" Static checks: id+name+texture required, expansion 0..3, level range valid, weight=0 warning, catch-all overlap\n");
std::printf(" --gen-weather-temperate <wow-base> [zoneName]\n");
std::printf(" Emit .wow weather schedule: clear-dominant + occasional rain + fog (forest / grassland)\n");
std::printf(" --gen-weather-arctic <wow-base> [zoneName]\n");

View file

@ -87,6 +87,7 @@ constexpr FormatRow kFormats[] = {
{"WPVP", ".wpvp", "pvp", "honor / arena rank tables", "PvP honor rank + arena tier catalog"},
{"WBNK", ".wbnk", "items", "ItemBag.dbc + bank slots", "Bag / bank / special slot catalog"},
{"WRUN", ".wrun", "spells", "RuneCost.dbc + ChrPowerType DK", "Death Knight rune cost catalog"},
{"WLDS", ".wlds", "ui", "LoadingScreens.dbc", "Per-zone loading screen catalog"},
// Additional pipeline catalogs without the alternating
// gen/info/validate CLI surface (loaded by the engine

View file

@ -0,0 +1,255 @@
#include "cli_loading_screens_catalog.hpp"
#include "cli_arg_parse.hpp"
#include "cli_box_emitter.hpp"
#include "pipeline/wowee_loading_screens.hpp"
#include <nlohmann/json.hpp>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <string>
#include <vector>
namespace wowee {
namespace editor {
namespace cli {
namespace {
std::string stripWldsExt(std::string base) {
stripExt(base, ".wlds");
return base;
}
bool saveOrError(const wowee::pipeline::WoweeLoadingScreen& c,
const std::string& base, const char* cmd) {
if (!wowee::pipeline::WoweeLoadingScreenLoader::save(c, base)) {
std::fprintf(stderr, "%s: failed to save %s.wlds\n",
cmd, base.c_str());
return false;
}
return true;
}
void printGenSummary(const wowee::pipeline::WoweeLoadingScreen& c,
const std::string& base) {
std::printf("Wrote %s.wlds\n", base.c_str());
std::printf(" catalog : %s\n", c.name.c_str());
std::printf(" screens : %zu\n", c.entries.size());
}
int handleGenStarter(int& i, int argc, char** argv) {
std::string base = argv[++i];
std::string name = "StarterLoadingScreens";
if (parseOptArg(i, argc, argv)) name = argv[++i];
base = stripWldsExt(base);
auto c = wowee::pipeline::WoweeLoadingScreenLoader::makeStarter(name);
if (!saveOrError(c, base, "gen-lds")) return 1;
printGenSummary(c, base);
return 0;
}
int handleGenInstances(int& i, int argc, char** argv) {
std::string base = argv[++i];
std::string name = "InstanceLoadingScreens";
if (parseOptArg(i, argc, argv)) name = argv[++i];
base = stripWldsExt(base);
auto c = wowee::pipeline::WoweeLoadingScreenLoader::makeInstances(name);
if (!saveOrError(c, base, "gen-lds-instances")) return 1;
printGenSummary(c, base);
return 0;
}
int handleGenRaidIntros(int& i, int argc, char** argv) {
std::string base = argv[++i];
std::string name = "RaidIntroLoadingScreens";
if (parseOptArg(i, argc, argv)) name = argv[++i];
base = stripWldsExt(base);
auto c = wowee::pipeline::WoweeLoadingScreenLoader::makeRaidIntros(name);
if (!saveOrError(c, base, "gen-lds-raid")) return 1;
printGenSummary(c, base);
return 0;
}
int handleInfo(int& i, int argc, char** argv) {
std::string base = argv[++i];
bool jsonOut = consumeJsonFlag(i, argc, argv);
base = stripWldsExt(base);
if (!wowee::pipeline::WoweeLoadingScreenLoader::exists(base)) {
std::fprintf(stderr, "WLDS not found: %s.wlds\n", base.c_str());
return 1;
}
auto c = wowee::pipeline::WoweeLoadingScreenLoader::load(base);
if (jsonOut) {
nlohmann::json j;
j["wlds"] = base + ".wlds";
j["name"] = c.name;
j["count"] = c.entries.size();
nlohmann::json arr = nlohmann::json::array();
for (const auto& e : c.entries) {
arr.push_back({
{"screenId", e.screenId},
{"mapId", e.mapId},
{"name", e.name},
{"description", e.description},
{"texturePath", e.texturePath},
{"iconPath", e.iconPath},
{"attribution", e.attribution},
{"minLevel", e.minLevel},
{"maxLevel", e.maxLevel},
{"displayWeight", e.displayWeight},
{"expansionRequired", e.expansionRequired},
{"expansionRequiredName", wowee::pipeline::WoweeLoadingScreen::expansionGateName(e.expansionRequired)},
{"isAnimated", e.isAnimated},
{"isWideAspect", e.isWideAspect},
});
}
j["entries"] = arr;
std::printf("%s\n", j.dump(2).c_str());
return 0;
}
std::printf("WLDS: %s.wlds\n", base.c_str());
std::printf(" catalog : %s\n", c.name.c_str());
std::printf(" screens : %zu\n", c.entries.size());
if (c.entries.empty()) return 0;
std::printf(" id map levels wt exp anim wide name\n");
for (const auto& e : c.entries) {
std::printf(" %4u %4u %3u-%3u %3u %-7s %u %u %s\n",
e.screenId, e.mapId,
e.minLevel, e.maxLevel,
e.displayWeight,
wowee::pipeline::WoweeLoadingScreen::expansionGateName(e.expansionRequired),
e.isAnimated, e.isWideAspect, e.name.c_str());
}
return 0;
}
int handleValidate(int& i, int argc, char** argv) {
std::string base = argv[++i];
bool jsonOut = consumeJsonFlag(i, argc, argv);
base = stripWldsExt(base);
if (!wowee::pipeline::WoweeLoadingScreenLoader::exists(base)) {
std::fprintf(stderr,
"validate-wlds: WLDS not found: %s.wlds\n", base.c_str());
return 1;
}
auto c = wowee::pipeline::WoweeLoadingScreenLoader::load(base);
std::vector<std::string> errors;
std::vector<std::string> warnings;
if (c.entries.empty()) {
warnings.push_back("catalog has zero entries");
}
std::vector<uint32_t> idsSeen;
for (size_t k = 0; k < c.entries.size(); ++k) {
const auto& e = c.entries[k];
std::string ctx = "entry " + std::to_string(k) +
" (id=" + std::to_string(e.screenId);
if (!e.name.empty()) ctx += " " + e.name;
ctx += ")";
if (e.screenId == 0)
errors.push_back(ctx + ": screenId is 0");
if (e.name.empty())
errors.push_back(ctx + ": name is empty");
if (e.texturePath.empty())
errors.push_back(ctx + ": texturePath is empty "
"(screen has no image to display)");
if (e.expansionRequired > wowee::pipeline::WoweeLoadingScreen::TurtleWoW) {
errors.push_back(ctx + ": expansionRequired " +
std::to_string(e.expansionRequired) + " not in 0..3");
}
if (e.minLevel > e.maxLevel) {
errors.push_back(ctx + ": minLevel " +
std::to_string(e.minLevel) + " > maxLevel " +
std::to_string(e.maxLevel));
}
if (e.displayWeight == 0) {
warnings.push_back(ctx +
": displayWeight=0 (screen is in pool but never picked)");
}
// mapId=0 means catch-all — flag if there are
// multiple catch-all screens in the same level
// bracket, since the random pick becomes ambiguous.
if (e.mapId == 0 && c.entries.size() > 1) {
uint32_t conflicts = 0;
for (size_t m = 0; m < c.entries.size(); ++m) {
if (m == k) continue;
const auto& other = c.entries[m];
if (other.mapId != 0) continue;
// Overlap level brackets count as conflicts.
if (other.minLevel <= e.maxLevel &&
other.maxLevel >= e.minLevel) {
++conflicts;
}
}
if (conflicts > 0) {
warnings.push_back(ctx +
": catch-all screen (mapId=0) overlaps " +
std::to_string(conflicts) +
" other catch-all in same level bracket "
"— random pick is non-deterministic");
}
}
for (uint32_t prev : idsSeen) {
if (prev == e.screenId) {
errors.push_back(ctx + ": duplicate screenId");
break;
}
}
idsSeen.push_back(e.screenId);
}
bool ok = errors.empty();
if (jsonOut) {
nlohmann::json j;
j["wlds"] = base + ".wlds";
j["ok"] = ok;
j["errors"] = errors;
j["warnings"] = warnings;
std::printf("%s\n", j.dump(2).c_str());
return ok ? 0 : 1;
}
std::printf("validate-wlds: %s.wlds\n", base.c_str());
if (ok && warnings.empty()) {
std::printf(" OK — %zu screens, all screenIds unique, no overlap conflicts\n",
c.entries.size());
return 0;
}
if (!warnings.empty()) {
std::printf(" warnings (%zu):\n", warnings.size());
for (const auto& w : warnings)
std::printf(" - %s\n", w.c_str());
}
if (!errors.empty()) {
std::printf(" ERRORS (%zu):\n", errors.size());
for (const auto& e : errors)
std::printf(" - %s\n", e.c_str());
}
return ok ? 0 : 1;
}
} // namespace
bool handleLoadingScreensCatalog(int& i, int argc, char** argv,
int& outRc) {
if (std::strcmp(argv[i], "--gen-lds") == 0 && i + 1 < argc) {
outRc = handleGenStarter(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--gen-lds-instances") == 0 && i + 1 < argc) {
outRc = handleGenInstances(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--gen-lds-raid") == 0 && i + 1 < argc) {
outRc = handleGenRaidIntros(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--info-wlds") == 0 && i + 1 < argc) {
outRc = handleInfo(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--validate-wlds") == 0 && i + 1 < argc) {
outRc = handleValidate(i, argc, argv); return true;
}
return false;
}
} // namespace cli
} // namespace editor
} // namespace wowee

View file

@ -0,0 +1,12 @@
#pragma once
namespace wowee {
namespace editor {
namespace cli {
bool handleLoadingScreensCatalog(int& i, int argc, char** argv,
int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee