feat(pipeline): add WUMV (Wowee Unit Movement Type) catalog

66th open format — replaces UnitMovement.dbc plus the
movement-modifier portions of CreatureModelData.dbc. Defines
movement speed types (walk / run / swim / flight / fly /
pitch) with their canonical baseline speeds in yards-per-
second, plus the temp speed buffs that stack on top
(Sprint, Aspect of the Cheetah, Travel Form).

12 movement categories cover the canonical surface (Walk /
Run / Backward / Swim / SwimBack / Turn / Flight /
FlightBack / Pitch / Fly / FlyBack / TempBuff). baseSpeed
is yards/second for baseline categories and ignored for
TempBuff entries (which use baseMultiplier instead).
maxMultiplier caps stacking — Sprint capped at 1.4 means
Sprint + Aspect of Cheetah doesn't exceed 1.4× run speed.
stackingPriority resolves conflicts when multiple buffs
of equal multiplier compete (higher wins).

CLI: --gen-umv (4 baseline at canonical WoW vanilla speeds:
Walk 2.5y/s, Run 7.0y/s, Swim 4.7y/s, Turn π rad/s),
--gen-umv-flight (5 flight entries — ground-rail Flight
7y/s, free Fly 14y/s, Pitch 1.5 rad/s, backward variants
at slower 4.5y/s), --gen-umv-buffs (5 temp speed buffs
matching real WoW spell auras with proper durations and
stacking priorities), --info-wumv, --validate-wumv with
--json variants. Validator catches id+name required,
category 0..11, baseMultiplier > 0 (otherwise unit freezes
in place), maxMultiplier >= baseMultiplier (cap below
floor would clamp the base down), baseline categories
need baseSpeed > 0, and Run < 3.0y/s warning (canonical
is 7.0y/s).

Format graph: 65 → 66 binary formats. CLI flag count: 870
→ 875.
This commit is contained in:
Kelsi 2026-05-09 21:18:03 -07:00
parent 626d9e09fa
commit 1ca665150b
10 changed files with 659 additions and 0 deletions

View file

@ -654,6 +654,7 @@ set(WOWEE_SOURCES
src/pipeline/wowee_loading_screens.cpp
src/pipeline/wowee_item_suffixes.cpp
src/pipeline/wowee_combat_ratings.cpp
src/pipeline/wowee_unit_movement.cpp
src/pipeline/custom_zone_discovery.cpp
src/pipeline/dbc_layout.cpp
@ -1462,6 +1463,7 @@ add_executable(wowee_editor
tools/editor/cli_loading_screens_catalog.cpp
tools/editor/cli_item_suffixes_catalog.cpp
tools/editor/cli_combat_ratings_catalog.cpp
tools/editor/cli_unit_movement_catalog.cpp
tools/editor/cli_quest_objective.cpp
tools/editor/cli_quest_reward.cpp
tools/editor/cli_clone.cpp
@ -1594,6 +1596,7 @@ add_executable(wowee_editor
src/pipeline/wowee_loading_screens.cpp
src/pipeline/wowee_item_suffixes.cpp
src/pipeline/wowee_combat_ratings.cpp
src/pipeline/wowee_unit_movement.cpp
src/pipeline/custom_zone_discovery.cpp
src/pipeline/terrain_mesh.cpp

View file

@ -0,0 +1,114 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace wowee {
namespace pipeline {
// Wowee Open Unit Movement Type catalog (.wumv) — novel
// replacement for Blizzard's UnitMovement.dbc plus the
// movement-modifier portions of CreatureModelData.dbc.
// Defines movement speed types (walk / run / swim / flight
// / fly / pitch) and their per-creature multipliers, plus
// the temp speed buffs that stack on top (Sprint, Aspect of
// the Cheetah, Travel Form).
//
// baseMultiplier 1.0 = canonical default (walk = 2.5y/s,
// run = 7.0y/s, swim = 4.7y/s, flight = 7.0y/s, fly =
// 14.0y/s). maxMultiplier caps stacking — Sprint capped at
// 1.4 means even with Sprint + Aspect of the Cheetah you
// don't exceed 1.4× run speed.
//
// Cross-references with previously-added formats:
// None — this catalog is consumed directly by the
// movement subsystem. Spell auras (WSPL) reference
// moveTypeId to know which speed multiplier they modify.
//
// Binary layout (little-endian):
// magic[4] = "WUMV"
// version (uint32) = current 1
// nameLen + name (catalog label)
// entryCount (uint32)
// entries (each):
// moveTypeId (uint32)
// nameLen + name
// descLen + description
// iconLen + iconPath
// movementCategory (uint8) / requiresFlight (uint8) /
// canStackBuffs (uint8) / pad[1]
// baseSpeed (float) — yards per second
// baseMultiplier (float)
// maxMultiplier (float)
// defaultDurationMs (uint32)
// stackingPriority (uint8) / pad[3]
struct WoweeUnitMovement {
enum MovementCategory : uint8_t {
Walk = 0, // baseline walk speed
Run = 1, // baseline run speed
Backward = 2, // backward movement (slower)
Swim = 3, // underwater swim
SwimBack = 4, // backward swim
Turn = 5, // turn rate (radians/sec)
Flight = 6, // ground-level flight (gryphon)
FlightBack = 7, // backward flight
Pitch = 8, // pitch rate (radians/sec)
Fly = 9, // free-flight (drake mount)
FlyBack = 10, // backward free-flight
TempBuff = 11, // temporary speed modifier (Sprint)
};
struct Entry {
uint32_t moveTypeId = 0;
std::string name;
std::string description;
std::string iconPath;
uint8_t movementCategory = Run;
uint8_t requiresFlight = 0; // 1 = needs Flight Master skill
uint8_t canStackBuffs = 1; // 0 = exclusive (replaces existing)
float baseSpeed = 7.0f; // yards / second
float baseMultiplier = 1.0f;
float maxMultiplier = 1.4f; // hard cap
uint32_t defaultDurationMs = 0; // 0 = permanent
uint8_t stackingPriority = 0; // higher wins on conflict
};
std::string name;
std::vector<Entry> entries;
bool isValid() const { return !entries.empty(); }
const Entry* findById(uint32_t moveTypeId) const;
static const char* movementCategoryName(uint8_t c);
};
class WoweeUnitMovementLoader {
public:
static bool save(const WoweeUnitMovement& cat,
const std::string& basePath);
static WoweeUnitMovement load(const std::string& basePath);
static bool exists(const std::string& basePath);
// Preset emitters used by --gen-umv* variants.
//
// makeStarter — 4 baseline movement types (Walk
// 2.5y/s, Run 7.0y/s, Swim 4.7y/s,
// Turn 3.14rad/s) at canonical
// WoW vanilla speeds.
// makeFlight — 5 flight-related entries (Fly free
// flight 14y/s, Flight ground-rail
// 7y/s, Pitch rate, FlyBackward,
// FlightBackward).
// makeBuffs — 5 temporary speed buffs (Sprint
// 1.4×, Aspect of the Cheetah 1.3×,
// Travel Form 1.4×, Crusader Aura
// 1.2×, Wind Walk 1.5×).
static WoweeUnitMovement makeStarter(const std::string& catalogName);
static WoweeUnitMovement makeFlight(const std::string& catalogName);
static WoweeUnitMovement makeBuffs(const std::string& catalogName);
};
} // namespace pipeline
} // namespace wowee

View file

@ -0,0 +1,260 @@
#include "pipeline/wowee_unit_movement.hpp"
#include <cstdio>
#include <cstring>
#include <fstream>
namespace wowee {
namespace pipeline {
namespace {
constexpr char kMagic[4] = {'W', 'U', 'M', 'V'};
constexpr uint32_t kVersion = 1;
template <typename T>
void writePOD(std::ofstream& os, const T& v) {
os.write(reinterpret_cast<const char*>(&v), sizeof(T));
}
template <typename T>
bool readPOD(std::ifstream& is, T& v) {
is.read(reinterpret_cast<char*>(&v), sizeof(T));
return is.gcount() == static_cast<std::streamsize>(sizeof(T));
}
void writeStr(std::ofstream& os, const std::string& s) {
uint32_t n = static_cast<uint32_t>(s.size());
writePOD(os, n);
if (n > 0) os.write(s.data(), n);
}
bool readStr(std::ifstream& is, std::string& s) {
uint32_t n = 0;
if (!readPOD(is, n)) return false;
if (n > (1u << 20)) return false;
s.resize(n);
if (n > 0) {
is.read(s.data(), n);
if (is.gcount() != static_cast<std::streamsize>(n)) {
s.clear();
return false;
}
}
return true;
}
std::string normalizePath(std::string base) {
if (base.size() < 5 || base.substr(base.size() - 5) != ".wumv") {
base += ".wumv";
}
return base;
}
} // namespace
const WoweeUnitMovement::Entry*
WoweeUnitMovement::findById(uint32_t moveTypeId) const {
for (const auto& e : entries)
if (e.moveTypeId == moveTypeId) return &e;
return nullptr;
}
const char* WoweeUnitMovement::movementCategoryName(uint8_t c) {
switch (c) {
case Walk: return "walk";
case Run: return "run";
case Backward: return "backward";
case Swim: return "swim";
case SwimBack: return "swim-back";
case Turn: return "turn";
case Flight: return "flight";
case FlightBack: return "flight-back";
case Pitch: return "pitch";
case Fly: return "fly";
case FlyBack: return "fly-back";
case TempBuff: return "temp-buff";
default: return "unknown";
}
}
bool WoweeUnitMovementLoader::save(const WoweeUnitMovement& cat,
const std::string& basePath) {
std::ofstream os(normalizePath(basePath), std::ios::binary);
if (!os) return false;
os.write(kMagic, 4);
writePOD(os, kVersion);
writeStr(os, cat.name);
uint32_t entryCount = static_cast<uint32_t>(cat.entries.size());
writePOD(os, entryCount);
for (const auto& e : cat.entries) {
writePOD(os, e.moveTypeId);
writeStr(os, e.name);
writeStr(os, e.description);
writeStr(os, e.iconPath);
writePOD(os, e.movementCategory);
writePOD(os, e.requiresFlight);
writePOD(os, e.canStackBuffs);
uint8_t pad = 0;
writePOD(os, pad);
writePOD(os, e.baseSpeed);
writePOD(os, e.baseMultiplier);
writePOD(os, e.maxMultiplier);
writePOD(os, e.defaultDurationMs);
writePOD(os, e.stackingPriority);
uint8_t pad3[3] = {0, 0, 0};
os.write(reinterpret_cast<const char*>(pad3), 3);
}
return os.good();
}
WoweeUnitMovement WoweeUnitMovementLoader::load(
const std::string& basePath) {
WoweeUnitMovement out;
std::ifstream is(normalizePath(basePath), std::ios::binary);
if (!is) return out;
char magic[4];
is.read(magic, 4);
if (std::memcmp(magic, kMagic, 4) != 0) return out;
uint32_t version = 0;
if (!readPOD(is, version) || version != kVersion) return out;
if (!readStr(is, out.name)) return out;
uint32_t entryCount = 0;
if (!readPOD(is, entryCount)) return out;
if (entryCount > (1u << 20)) return out;
out.entries.resize(entryCount);
for (auto& e : out.entries) {
if (!readPOD(is, e.moveTypeId)) {
out.entries.clear(); return out;
}
if (!readStr(is, e.name) || !readStr(is, e.description) ||
!readStr(is, e.iconPath)) {
out.entries.clear(); return out;
}
if (!readPOD(is, e.movementCategory) ||
!readPOD(is, e.requiresFlight) ||
!readPOD(is, e.canStackBuffs)) {
out.entries.clear(); return out;
}
uint8_t pad = 0;
if (!readPOD(is, pad)) { out.entries.clear(); return out; }
if (!readPOD(is, e.baseSpeed) ||
!readPOD(is, e.baseMultiplier) ||
!readPOD(is, e.maxMultiplier) ||
!readPOD(is, e.defaultDurationMs) ||
!readPOD(is, e.stackingPriority)) {
out.entries.clear(); return out;
}
uint8_t pad3[3];
is.read(reinterpret_cast<char*>(pad3), 3);
if (is.gcount() != 3) { out.entries.clear(); return out; }
}
return out;
}
bool WoweeUnitMovementLoader::exists(const std::string& basePath) {
std::ifstream is(normalizePath(basePath), std::ios::binary);
return is.good();
}
WoweeUnitMovement WoweeUnitMovementLoader::makeStarter(
const std::string& catalogName) {
WoweeUnitMovement c;
c.name = catalogName;
auto add = [&](uint32_t id, const char* name, uint8_t category,
float baseSpeed, const char* desc) {
WoweeUnitMovement::Entry e;
e.moveTypeId = id; e.name = name; e.description = desc;
e.iconPath = std::string("Interface/Icons/Ability_") +
name + ".blp";
e.movementCategory = category;
e.baseSpeed = baseSpeed;
e.canStackBuffs = 0; // baseline speeds don't stack
c.entries.push_back(e);
};
add(1, "WalkSpeed", WoweeUnitMovement::Walk, 2.5f,
"Canonical walk speed — 2.5 yards / second.");
add(2, "RunSpeed", WoweeUnitMovement::Run, 7.0f,
"Canonical run speed — 7.0 yards / second.");
add(3, "SwimSpeed", WoweeUnitMovement::Swim, 4.7f,
"Canonical swim speed — 4.7 yards / second underwater.");
add(4, "TurnRate", WoweeUnitMovement::Turn, 3.14f,
"Canonical turn rate — π radians / second (180°/s).");
return c;
}
WoweeUnitMovement WoweeUnitMovementLoader::makeFlight(
const std::string& catalogName) {
WoweeUnitMovement c;
c.name = catalogName;
auto add = [&](uint32_t id, const char* name, uint8_t category,
float baseSpeed, uint8_t requiresFlight,
const char* desc) {
WoweeUnitMovement::Entry e;
e.moveTypeId = id; e.name = name; e.description = desc;
e.iconPath = std::string("Interface/Icons/Ability_Mount_") +
name + ".blp";
e.movementCategory = category;
e.baseSpeed = baseSpeed;
e.requiresFlight = requiresFlight;
e.canStackBuffs = 1; // flight buffs stack
c.entries.push_back(e);
};
add(100, "Flight", WoweeUnitMovement::Flight,
7.0f, 1,
"Ground-rail flight speed — 7.0y/s, used by gryphon "
"taxi rides.");
add(101, "Fly", WoweeUnitMovement::Fly,
14.0f, 1,
"Free-flight cruise speed — 14.0y/s base on a flying "
"mount.");
add(102, "FlyBack", WoweeUnitMovement::FlyBack,
4.5f, 1,
"Backward flight — slower (no mount can reverse fast).");
add(103, "FlightBack", WoweeUnitMovement::FlightBack,
4.5f, 1,
"Backward ground-rail flight (taxi node reverse).");
add(104, "Pitch", WoweeUnitMovement::Pitch,
1.5f, 1,
"Pitch rate while flying — 1.5 radians/second (≈86°/s).");
return c;
}
WoweeUnitMovement WoweeUnitMovementLoader::makeBuffs(
const std::string& catalogName) {
WoweeUnitMovement c;
c.name = catalogName;
auto add = [&](uint32_t id, const char* name, float multiplier,
float maxMultiplier, uint32_t durationMs,
uint8_t priority, const char* desc) {
WoweeUnitMovement::Entry e;
e.moveTypeId = id; e.name = name; e.description = desc;
e.iconPath = std::string("Interface/Icons/Ability_") +
name + ".blp";
e.movementCategory = WoweeUnitMovement::TempBuff;
e.baseSpeed = 0.0f; // multiplier-only entry
e.baseMultiplier = multiplier;
e.maxMultiplier = maxMultiplier;
e.defaultDurationMs = durationMs;
e.canStackBuffs = 1;
e.stackingPriority = priority;
c.entries.push_back(e);
};
add(200, "Sprint", 1.40f, 1.40f, 15000, 100,
"Rogue sprint — 40% movement speed for 15 seconds.");
add(201, "AspectCheetah", 1.30f, 1.30f, 0, 50,
"Hunter aspect — 30% movement speed permanently. "
"Breaks on damage.");
add(202, "TravelForm", 1.40f, 1.40f, 0, 50,
"Druid travel form — 40% speed, persists until "
"shifted out.");
add(203, "CrusaderAura", 1.20f, 1.20f, 0, 30,
"Paladin aura — 20% mounted speed for the party.");
add(204, "WindWalk", 1.50f, 1.50f, 12000, 80,
"Shaman ghost-wolf style buff — 50% speed for "
"12 seconds.");
return c;
}
} // namespace pipeline
} // namespace wowee

View file

@ -200,6 +200,8 @@ const char* const kArgRequired[] = {
"--gen-crr", "--gen-crr-defensive", "--gen-crr-spell",
"--info-wcrr", "--validate-wcrr",
"--export-wcrr-json", "--import-wcrr-json",
"--gen-umv", "--gen-umv-flight", "--gen-umv-buffs",
"--info-wumv", "--validate-wumv",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",

View file

@ -101,6 +101,7 @@
#include "cli_loading_screens_catalog.hpp"
#include "cli_item_suffixes_catalog.hpp"
#include "cli_combat_ratings_catalog.hpp"
#include "cli_unit_movement_catalog.hpp"
#include "cli_quest_objective.hpp"
#include "cli_quest_reward.hpp"
#include "cli_clone.hpp"
@ -243,6 +244,7 @@ constexpr DispatchFn kDispatchTable[] = {
handleLoadingScreensCatalog,
handleItemSuffixesCatalog,
handleCombatRatingsCatalog,
handleUnitMovementCatalog,
handleQuestObjective,
handleQuestReward,
handleClone,

View file

@ -68,6 +68,7 @@ constexpr FormatMagicEntry kFormats[] = {
{{'W','L','D','S'}, ".wlds", "ui", "--info-wlds", "Loading screen catalog"},
{{'W','S','U','F'}, ".wsuf", "items", "--info-wsuf", "Item random-suffix catalog"},
{{'W','C','R','R'}, ".wcrr", "stats", "--info-wcrr", "Combat rating conversion catalog"},
{{'W','U','M','V'}, ".wumv", "stats", "--info-wumv", "Unit movement type 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

@ -1657,6 +1657,16 @@ void printUsage(const char* argv0) {
std::printf(" Export binary .wcrr to a human-editable JSON sidecar (defaults to <base>.wcrr.json)\n");
std::printf(" --import-wcrr-json <json-path> [out-base]\n");
std::printf(" Import a .wcrr.json sidecar back into binary .wcrr (accepts ratingKind int OR name string; pointsAtLN default to canonical WoW values)\n");
std::printf(" --gen-umv <wumv-base> [name]\n");
std::printf(" Emit .wumv starter: 4 baseline movement types (Walk 2.5y/s / Run 7.0y/s / Swim 4.7y/s / Turn π rad/s)\n");
std::printf(" --gen-umv-flight <wumv-base> [name]\n");
std::printf(" Emit .wumv 5 flight entries (Flight ground-rail / Fly free / FlyBack / FlightBack / Pitch rate) requiring flight skill\n");
std::printf(" --gen-umv-buffs <wumv-base> [name]\n");
std::printf(" Emit .wumv 5 temp speed buffs (Sprint 1.4× / Aspect Cheetah 1.3× / Travel 1.4× / Crusader 1.2× / Wind Walk 1.5×)\n");
std::printf(" --info-wumv <wumv-base> [--json]\n");
std::printf(" Print WUMV entries (id / category / baseSpeed / multipliers / duration / priority / flight+stack flags / name)\n");
std::printf(" --validate-wumv <wumv-base> [--json]\n");
std::printf(" Static checks: id+name required, category 0..11, baseMultiplier > 0, max >= base, baseline categories need baseSpeed > 0\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

@ -90,6 +90,7 @@ constexpr FormatRow kFormats[] = {
{"WLDS", ".wlds", "ui", "LoadingScreens.dbc", "Per-zone loading screen catalog"},
{"WSUF", ".wsuf", "items", "ItemRandomProperties + Suffix", "Item random-suffix bonus catalog"},
{"WCRR", ".wcrr", "stats", "gtCombatRatings.dbc + curves", "Combat rating conversion catalog"},
{"WUMV", ".wumv", "stats", "UnitMovement.dbc + speed mods", "Unit movement type / speed catalog"},
// Additional pipeline catalogs without the alternating
// gen/info/validate CLI surface (loaded by the engine

View file

@ -0,0 +1,254 @@
#include "cli_unit_movement_catalog.hpp"
#include "cli_arg_parse.hpp"
#include "cli_box_emitter.hpp"
#include "pipeline/wowee_unit_movement.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 stripWumvExt(std::string base) {
stripExt(base, ".wumv");
return base;
}
bool saveOrError(const wowee::pipeline::WoweeUnitMovement& c,
const std::string& base, const char* cmd) {
if (!wowee::pipeline::WoweeUnitMovementLoader::save(c, base)) {
std::fprintf(stderr, "%s: failed to save %s.wumv\n",
cmd, base.c_str());
return false;
}
return true;
}
void printGenSummary(const wowee::pipeline::WoweeUnitMovement& c,
const std::string& base) {
std::printf("Wrote %s.wumv\n", base.c_str());
std::printf(" catalog : %s\n", c.name.c_str());
std::printf(" types : %zu\n", c.entries.size());
}
int handleGenStarter(int& i, int argc, char** argv) {
std::string base = argv[++i];
std::string name = "StarterMovementTypes";
if (parseOptArg(i, argc, argv)) name = argv[++i];
base = stripWumvExt(base);
auto c = wowee::pipeline::WoweeUnitMovementLoader::makeStarter(name);
if (!saveOrError(c, base, "gen-umv")) return 1;
printGenSummary(c, base);
return 0;
}
int handleGenFlight(int& i, int argc, char** argv) {
std::string base = argv[++i];
std::string name = "FlightMovementTypes";
if (parseOptArg(i, argc, argv)) name = argv[++i];
base = stripWumvExt(base);
auto c = wowee::pipeline::WoweeUnitMovementLoader::makeFlight(name);
if (!saveOrError(c, base, "gen-umv-flight")) return 1;
printGenSummary(c, base);
return 0;
}
int handleGenBuffs(int& i, int argc, char** argv) {
std::string base = argv[++i];
std::string name = "MovementBuffs";
if (parseOptArg(i, argc, argv)) name = argv[++i];
base = stripWumvExt(base);
auto c = wowee::pipeline::WoweeUnitMovementLoader::makeBuffs(name);
if (!saveOrError(c, base, "gen-umv-buffs")) 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 = stripWumvExt(base);
if (!wowee::pipeline::WoweeUnitMovementLoader::exists(base)) {
std::fprintf(stderr, "WUMV not found: %s.wumv\n", base.c_str());
return 1;
}
auto c = wowee::pipeline::WoweeUnitMovementLoader::load(base);
if (jsonOut) {
nlohmann::json j;
j["wumv"] = base + ".wumv";
j["name"] = c.name;
j["count"] = c.entries.size();
nlohmann::json arr = nlohmann::json::array();
for (const auto& e : c.entries) {
arr.push_back({
{"moveTypeId", e.moveTypeId},
{"name", e.name},
{"description", e.description},
{"iconPath", e.iconPath},
{"movementCategory", e.movementCategory},
{"movementCategoryName", wowee::pipeline::WoweeUnitMovement::movementCategoryName(e.movementCategory)},
{"requiresFlight", e.requiresFlight},
{"canStackBuffs", e.canStackBuffs},
{"baseSpeed", e.baseSpeed},
{"baseMultiplier", e.baseMultiplier},
{"maxMultiplier", e.maxMultiplier},
{"defaultDurationMs", e.defaultDurationMs},
{"stackingPriority", e.stackingPriority},
});
}
j["entries"] = arr;
std::printf("%s\n", j.dump(2).c_str());
return 0;
}
std::printf("WUMV: %s.wumv\n", base.c_str());
std::printf(" catalog : %s\n", c.name.c_str());
std::printf(" types : %zu\n", c.entries.size());
if (c.entries.empty()) return 0;
std::printf(" id category baseSpeed baseMul maxMul dur(ms) prio flight stack name\n");
for (const auto& e : c.entries) {
std::printf(" %4u %-11s %7.2f %5.2f %5.2f %5u %3u %u %u %s\n",
e.moveTypeId,
wowee::pipeline::WoweeUnitMovement::movementCategoryName(e.movementCategory),
e.baseSpeed, e.baseMultiplier, e.maxMultiplier,
e.defaultDurationMs, e.stackingPriority,
e.requiresFlight, e.canStackBuffs,
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 = stripWumvExt(base);
if (!wowee::pipeline::WoweeUnitMovementLoader::exists(base)) {
std::fprintf(stderr,
"validate-wumv: WUMV not found: %s.wumv\n", base.c_str());
return 1;
}
auto c = wowee::pipeline::WoweeUnitMovementLoader::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.moveTypeId);
if (!e.name.empty()) ctx += " " + e.name;
ctx += ")";
if (e.moveTypeId == 0)
errors.push_back(ctx + ": moveTypeId is 0");
if (e.name.empty())
errors.push_back(ctx + ": name is empty");
if (e.movementCategory > wowee::pipeline::WoweeUnitMovement::TempBuff) {
errors.push_back(ctx + ": movementCategory " +
std::to_string(e.movementCategory) + " not in 0..11");
}
if (e.baseMultiplier <= 0.0f) {
errors.push_back(ctx +
": baseMultiplier " +
std::to_string(e.baseMultiplier) +
" <= 0 (would freeze unit in place)");
}
if (e.maxMultiplier < e.baseMultiplier) {
errors.push_back(ctx + ": maxMultiplier " +
std::to_string(e.maxMultiplier) +
" < baseMultiplier " +
std::to_string(e.baseMultiplier) +
" (cap below floor — base would be clamped down)");
}
// Baseline movement (Walk/Run/Swim/Turn) should have
// a positive baseSpeed — TempBuff entries are
// multiplier-only and may have baseSpeed=0.
bool isBaseline =
e.movementCategory >= wowee::pipeline::WoweeUnitMovement::Walk &&
e.movementCategory <= wowee::pipeline::WoweeUnitMovement::FlyBack;
if (isBaseline && e.baseSpeed <= 0.0f) {
errors.push_back(ctx +
": baseline movement category with baseSpeed " +
std::to_string(e.baseSpeed) + " <= 0 — unit "
"won't move on this category");
}
// Run speed below walk speed is suspicious — flag.
// Run is ~7.0y/s, walk is ~2.5y/s in canonical WoW.
if (e.movementCategory == wowee::pipeline::WoweeUnitMovement::Run &&
e.baseSpeed < 3.0f) {
warnings.push_back(ctx +
": Run baseSpeed " +
std::to_string(e.baseSpeed) +
" unusually slow (canonical 7.0y/s) — verify intent");
}
for (uint32_t prev : idsSeen) {
if (prev == e.moveTypeId) {
errors.push_back(ctx + ": duplicate moveTypeId");
break;
}
}
idsSeen.push_back(e.moveTypeId);
}
bool ok = errors.empty();
if (jsonOut) {
nlohmann::json j;
j["wumv"] = base + ".wumv";
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-wumv: %s.wumv\n", base.c_str());
if (ok && warnings.empty()) {
std::printf(" OK — %zu movement types, all moveTypeIds unique, all multipliers consistent\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 handleUnitMovementCatalog(int& i, int argc, char** argv,
int& outRc) {
if (std::strcmp(argv[i], "--gen-umv") == 0 && i + 1 < argc) {
outRc = handleGenStarter(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--gen-umv-flight") == 0 && i + 1 < argc) {
outRc = handleGenFlight(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--gen-umv-buffs") == 0 && i + 1 < argc) {
outRc = handleGenBuffs(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--info-wumv") == 0 && i + 1 < argc) {
outRc = handleInfo(i, argc, argv); return true;
}
if (std::strcmp(argv[i], "--validate-wumv") == 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 handleUnitMovementCatalog(int& i, int argc, char** argv,
int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee