Skip to content

feat(warps): the warp list and its move rules as data, with a Warp List editor - #177

Open
Mosch0512 wants to merge 13 commits into
mainfrom
feat/warp-list-data
Open

Mosch0512 wants to merge 13 commits into
mainfrom
feat/warp-list-data

Conversation

@Mosch0512

@Mosch0512 Mosch0512 commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

The M window's warp list (and /move, /warp) is data now: src/bin/Data/Maps/Warps.json replaces the movereq_<lang>.bmd files, the move rules that were hard-coded are fields of each warp, and MuEditor gets a Warp List window. The client also saves the key configuration as it changes and before every warp.

What it does

  • Warps.json: the 37 warps in M-window order, with their names per language (en, pt, es), the /move name, level, zen and gate. The four movereq bmd files are removed (also the unused Japanese Data/Local/Movereq.bmd). The max level is dropped: neither the client nor OpenMU checks it.
  • Rules as data (one check for the M window, the shown level, /move and the control socket):
    • class level discount: Magic Gladiator, Dark Lord and Rage Fighter need 2/3 of the level; noClassDiscount on Swamp of Calmness (33) replaces the old "level 400" check;
    • needsOneOf / notWith: single items, item tags (with except) or any wings. Icarus (23) needs wings or a flying mount and not Horn of Uniria or a transformation ring except panda/skeleton; Atlans (11-13) not Horn of Uniria or Dinorant;
    • pvpServersOnly and gensOnly (Vulcanus 42);
    • blockedMessage: which text a blocked /move shows; the two old messages stay, a new general text covers other warps;
    • new: minMasterLevel and minResets (0 = none); the Level column adds "ML n" / "R n" when set.
  • Names follow the UI language like monster names, English fallback, renamed at once when the language changes.
  • Warp List window (Windows > Warp List): list in M-window order with add, copy, remove, move up/down; every field and rule; class discount section; a Translations tab with the names of all UI languages (the names grid of Monster Translations), the details keep the English name; Undo/Redo, Save/Revert; changes show in the M window at once. Data Checks: unknown items or tags, duplicate index, missing English name, spaces in names (they break /move), unknown message keys, odd values.
  • Key configuration (skill and potion keys, auto attack, whisper sound, slide help, chat box): sent as each setting changes, so a crash or a lost connection doesn't lose it, and before every warp. IsTheMapInDifferentServer is removed.
  • Docs: docs/warp-list.md rewritten; links from dev-editor, map-data, item-data, translation-system.

OpenMU's WarpListExtended still overrides level and zen, as before; a warp that is also in the data file keeps its rules. The new WarpRequirementsExtended (C2 F5 0B, MUnique/OpenMU#1547) also sets master level and resets for the server's warps; the server's list wins for them like for level and zen.

How it was checked

  • Comparison before removal (D50):
    • the JSON list against the old bmd reader for en, pt and es, every warp and field;
    • the new rules against a copy of the old logic: 3.49 million cases (all warps, a merged server list, every class, level/zen/PK limits, PvP or not, Gens or not, every helper, wing and ring with broken and whole durability, and the chat texts with their messages), 0 differences.
  • Tests: map_data_tests 40/40 in Release (reader/writer, rules, master level and resets, UI-language rename, the Warp List window, Data Checks); every new test fails under a mutation.
  • Checks: clang-format (scripts/check_format.sh) and cppcheck with the CI flags on the changed files pass.
  • In game: the Release editor build, tried by the owner; also against OpenMU with feat(warps): attribute requirements for warps, sent to the open source client MUnique/OpenMU#1547 (a warp needing 1 reset and one needing master level 1 are greyed out with "R 1" / "ML 1" for a level 400 character).

What players see change (each in its own commit)

  • The key configuration is saved as it changes and before every warp.
  • Warp names follow the UI language.
  • /move Icarus with wings and a Panda or Skeleton ring works, as the M window already allowed.
  • The Icarus, Atlans and Vulcanus rules now apply in every language. The old checks compared the data-language name with the UI-language text and only matched when both were English.

Decided by me

  1. File Data/Maps/Warps.json; the key is name per language, as Monsters.json.
  2. Item references as in Buffs.json: {"item": {"group": 13, "number": 2}}.
  3. Rules match an item in any equipment slot (checked: flying mounts and horns are pet-slot items, transformation rings ring-slot items); needsOneOf counts only items that are not broken.
  4. Blocked message keys come from a small table (WarpMessages): the game texts have no lookup by key.
  5. A server-only warp has no rules; a server list that changes warp 33's level keeps it without discount.
  6. Kept quirks in the chat check: the first warp whose name is in the text counts, and only the equipment rules are checked there (the server checks the rest).
  7. Editor texts in en, de and pl; a new warp gets the smallest free index and the name "Warp".

Not done here

Size

About 5.3k added lines in 13 commits.

The server keeps the potion keys (Q, W, E, R), auto attack, whisper sound,
slide help and the chat box size and transparency with the key configuration.
The client sent them only at an exit (menu, window close, a map server
change), so a crash, a killed game or a lost connection dropped every change
since the last exit. Skill keys were already saved as they change; the other
settings now are too, through SaveOptionsIfInGame(), which sends only in game
and after the server's configuration arrived. Setting a potion key that is
already set sends nothing.
A warp saved the key configuration only for warps the code knew to lead to
another game server (warps 24 and 44, or leaving Battle Castle or the United
Market Place). A server with another layout lost the changes since the last
save when the warp ended the session. The warp window, the warp chat command
and the control socket's warp now save before every warp, and
IsTheMapInDifferentServer is gone.
The M window's warp list (and /move, the warp chat command) came from
Data/Local/<lang>/movereq_<lang>.bmd, one file per data language. It now comes
from Data/Maps/Warps.json, one list with the names per language
({"en", "es", "pt"}), "command" (the old sub name /move takes), level, zen
and gate, in the order the M window shows them. The file has a reader,
writer and checks (an index two warps have is fatal, a name longer than the
game holds a warning), a table (g_WarpDatabase) and Load/Save/Revert, as the
map object sounds have.

The names follow the data language, as the bmd files did (Eng -> en,
Por -> pt, Spn -> es; English for one the client doesn't know). Max level is
dropped: nothing read it. OpenMU's WarpListExtended merge works as before on
the entries built from the file.

A one-time test compares the list of the old bmd reader with the one built
from the JSON for en, pt and es: every warp in order with its index, name,
sub name, level, zen and gate.
The warp list comes from Data/Maps/Warps.json since the last commit, which
the one-time comparison test showed to give the same list in every language.
The bmd files (Eng, Por, Spn and the Japanese Data/Local/Movereq.bmd, which
nothing read), their reader and the comparison test are gone, with the
files' entries in Data/Maps/Files/Shared.json.

Left out of the old code because it changes nothing:
- BuxConvert (the files' XOR) and the 84-byte entry layout;
- the max level of each warp (MOVEREQINFO::m_iReqMaxLevel), which nothing
  read;
- Script_Movereq, an unused copy of the entry.
What a character needs to warp was code that matched warps by their
translated names: the 2/3 level of Magic Gladiators, Dark Lords and Rage
Fighters except for a level of 400, wings or a flying mount for Icarus, no
Horn of Uniria or Dinorant for Atlans, Vulcanus closed on non-PvP servers and
warp 42 for Gens members on PvP servers. Data/Maps/Warps.json has them now:

- "classLevelDiscount" (top level): the classes that need less level, as
  numerator/denominator, computed in float and cut as before;
- per warp "noClassDiscount" (warp 33), "pvpServersOnly" and "gensOnly"
  (warp 42), "needsOneOf" and "notWith" (lists of items, item tags with an
  "except" tag, or any wings; Icarus 23, Atlans 11-13) and "blockedMessage",
  the key of the game text the chat shows when the equipment blocks a warp;
  empty is the new general text "You can't warp there with your
  equipment.", in every language of the game texts;
- "minMasterLevel" and "minResets" (0 = none; no warp sets them): the M
  window's level column adds " ML n" / " R n" when set.

One evaluation (GameLogic/Warps/WarpRules) serves the M window (the strife
mark, the warps it greys out and the shown level), the chat's /move and warp
word, and the control socket's warp (which uses the window's check). A warp
takes its rules from the data entry with its index; a warp only the server
sends has none, as no name rule matched those.

A needed item counts when it is not broken (durability above 0), as the
flight check did; an item of a rule matches in any equipment slot, which
gives the same results because the item data puts every flying mount and
horn in the pet slot and every transformation ring in the ring slots (a
test checks this).

The game texts have no lookup by key, so the texts a warp may name are
listed in Data/GameData/MapData/WarpMessages (the two old messages and the
general one); an unknown key or item tag is a warning for now.

Kept as it was in the chat check (IsIllegalMovementByUsingMsg):
- the warp a text names is the first of the list whose shown name is in
  the text, or whose /move name is in it in any case;
- the warp word is searched in the text in capitals, so a warp word in
  small letters (English "/warp") never triggers the check;
- only the equipment rules apply there (level, zen and the others are the
  server's), and an "except" of a rule does not: the chat blocked Icarus
  with the panda and skeleton rings too, the M window doesn't.

A one-time test runs a copy of the old code against the rules with the
shipped items and warps, English texts and names: every warp of the data
list and of a merged server list x every class x level and zen limits x PK
x PvP or not x Gens or not, every pet, wing and ring (also broken), and
/move and warp word texts with horns, wings and rings: no difference in
3.5 million cases.
The M window, the chat's /move and warp word and the control socket's warp
use the rules of Data/Maps/Warps.json since the last commit, which the
one-time comparison test showed to give what the old code gave. The test
(with its copy of the old code) and CChangeRingManager's
CheckBanMoveIcarusMap, which only the old Icarus check used, are gone.

Left out of the old code because it changes nothing:
- the matching of warps by their translated names (I18N::Game::Icarus,
  Atlans as a prefix, Vulcanus): the rules belong to the warp's index;
- the fixed strife index 42 and the level 400 that had no class discount:
  "gensOnly" and "noClassDiscount" in the data;
- the per-slot item checks (helper type, CheckBanMoveIcarusMap's two ring
  slots, HasFlightEquipment's helper and wing slot): the rules look at
  every equipment slot, and the item data allows these items in only one;
- the chat check's three flags (can't fly, can't swim, transformation
  ring), worked out for every text even without /move;
- the unused local "a = gMapManager.WorldActive" of SettingCanMoveMap.
The M window named the warps in the data language (Eng, Por, Spn), as the
movereq files did, so a German or Polish UI showed English names and a
Portuguese UI with English data English ones. The names now follow the UI
language, as the monster names do: the language of I18N::GetCurrentLocale()
when the list loads, and again whenever it changes (a locale observer), with
the English name where a warp has none in that language (Warps.json has
en, es and pt).

A change renames the list the window shows at once: the warps of the data
files, and of a server's list (OpenMU) the ones it has from the data files,
with the server's levels and costs; a warp only the server has keeps the
server's name. /warp and /move take the shown name and the English /move
name ("command") as before.

CMoveCommandData::GetWarpNameLocale (data language -> locale) is gone with
its test; nothing else used it.
…tems

The checks of Data/Maps/Warps.json (ValidateWarps) warn now also about
what the reader takes but is probably wrong:
- a name or /move name with a space (/move takes the name as one word);
- a class level discount with numerator 0 (no level needed) or above its
  denominator (more level than the warp asks);
- an entry of "needsOneOf" or "notWith" that the list has before, and a
  tag entry whose "except" is its own tag (it matches no item);
- a blocked message of a warp without equipment rules (never shown).

An item a rule names that the item list does not have is an error
(ValidateWarpItems, with the game's item list ValidateWarpItemsInGame):
the entry matches no item. The game logs it at start, after the item list.

The largest level, gate and discount part the reader takes are named in
WarpsJson.h for the editor's fields.
Windows > Warp List shows the warps of the M window in its order: a search
and the list ("index name") on the left, the picked warp on the right with
its index, its names in every language of the UI (English required, the
others falling back to it), /move name, level, zen, gate (the server's
landing spot, which the client doesn't use), no class discount, master
level and resets (0 = none) and its rules: Needs one of and Not with
(items with their names, item tags with the number of items they match,
listed on hover, and "except" for Not with, or any wings), PvP servers
only, Gens members only and the blocked message (the general one or a
warp message, with its text). The class level discount of all warps is
the collapsing section at the bottom.

The game takes each change at once (the warp table and the M window's
list); Save writes the file through WarpStorage, the same text the file
has when nothing changed, Revert reads it again. Add warp, Copy, Remove,
Move up and Move down and every field are steps of the editor bar's Undo
and Redo ("Add Warp7", "Icarus: Level"), as in the Server List window. An
index another warp has stays with that warp.

Data Checks has an area for the warps: the list as the game and the
window have it, read back as the file would be (unknown item tags and
message keys, an index two warps have, a missing English name, a name or
/move name with a space), and its items checked against the item list; a
click opens the Warp List.

The editor texts are in English, German and Polish, as the other tools'.
The chat's check of /move and the warp word (CheckChatWarp) left out the
"except" of a rule entry, as the old code did: wings with a Panda or
Skeleton transformation ring could not /move to Icarus although the M
window allowed it. The check now applies the same equipment rules as the
M window, and IsEquipmentAllowed lost its applyExcept parameter, which
only the chat used.
…st window

docs/warp-list.md describes the warp list file now: every key with Icarus
(23), Swamp of Calmness (33) and Vulcanus (42) as examples, the order, the
names per UI language with the English fallback and the live rename, the
/move name, the gate as information, the class level discount and
noClassDiscount, needsOneOf/notWith (item, tag with except, wings),
pvpServersOnly, gensOnly, minMasterLevel/minResets with the " ML n" and
" R n" column text, the blocked message keys and the general text, how
OpenMU's WarpListExtended still overrides the list, the chat's /move check
and the quirks it keeps, the key configuration saved before every warp and
as it changes, the file's problems, the Warp List window and its Data
Checks area.

The editor guide lists the Warp List window, its Undo and Redo and its Data
Checks area; the map data, item data (flight equipment) and translation
docs link the page.
…its warp list

OpenMU sends WarpRequirementsExtended (C2 F5 0B) right after WarpListExtended
(F5 09): the minimum master level and resets of the listed warps which need
one of them, and nothing when no warp does. The client reads it next to the
warp list and applies it to the server's list.

Like level and zen, the master level and resets are the server's while its
list applies: a warp of the server's list without an entry needs neither,
even if Data/Maps/Warps.json sets minMasterLevel or minResets for it. Because
the message is left out when no warp has a requirement, the data file's
values can't be kept until it arrives: a new F5 09 starts at 0/0 and F5 0B
sets the values of its entries. An F5 0B without a server list is ignored
(its indexes are the ones of that list), an entry for a warp the list
doesn't have changes nothing, and of entries with the same index the first
counts, as with the warps. RestoreDataFileWarpList goes back to the data
file's values, together with its list.

The list entry (MOVEREQINFO) now carries the master level and resets like
level and zen, so EvaluateWarp and GetRequiredLevelText take the entry: the
M window greys out a warp and adds " ML n" / " R n" from the list's values,
which also gives a warp only the server has its requirements.
The warp names of all UI languages move to a Translations tab of the Warp List window, the names
grid of the Monster Translations window: one column per language, search, Missing in. The warp
details keep the English name. A name edit is an undo step and reaches the M window at once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant