5.8 KiB
Migration from legacy packs
This project is meant to replace legacy .pck or EterPack-style content
delivery gradually, not through a single risky cutover.
Target state
- Linux builds produce
.m2p - the client loads
.m2pfirst - runtime master key delivery is required
- silent fallback to legacy packs is disabled in production
Suggested migration phases
Phase 1: parallel loader
- keep the legacy loader in the client
- add
.m2psupport beside it - verify the new loader against real content sets
- keep fallback only in development if needed
Phase 2: pipeline validation
- build
.m2pfrom the same source tree as legacy packs - run
verifyfor every archive - run
diffbetween the source tree and.m2p - compare in-game behavior between legacy and
.m2p
Phase 3: runtime delivery
- stop embedding a real content key in the client
- deliver the runtime key through launcher, environment, or mapping
- verify startup failure behavior when the runtime key is missing
Phase 4: production cutover
- package only
.m2pfor release clients - disable silent fallback to legacy packs
- remove stale pack generation from release CI
- keep extract/debug tools only for internal use
Recommended checks
- duplicate normalized paths
- invalid relative paths
- case-collision problems on Windows
- decompression failures
- manifest signature failures
- key mismatch by
key_id - runtime smoke against the real client
- scenario gate with known-issues baseline
Practical migration loop
- Pick one legacy pack group.
- Rebuild it as
.m2p. - Verify it.
- Diff it against the source tree.
- Boot the client with runtime keys.
- Run the runtime scenario gate.
- Validate asset loads in logs and in-game.
- Move to the next pack group.
Recommended gate command:
python3 scripts/validate_runtime_gate.py \
--runtime-root /tmp/m2dev-client-runtime-http
For release tightening:
python3 scripts/validate_runtime_gate.py \
--runtime-root /tmp/m2dev-client-runtime-http \
--strict-known-issues
The shared baseline lives in:
known_issues/runtime_known_issues.json
This lets the migration fail only on new regressions while still tracking historical client data problems explicitly.
Confirmed startup-safe pack group
The following startup pack set has already been validated against the real client runtime on the Linux VPS:
rootpatch1patch2season3_eumetin2_patch_snowmetin2_patch_snow_dungeonmetin2_patch_etc_costume1metin2_patch_pet1metin2_patch_pet2metin2_patch_ramadan_costumemetin2_patch_flamemetin2_patch_flame_dungeonlocaleuiscriptuiloadingETCitemeffecticonpropertyterraintreezoneoutdoora1outdoora2outdoorb1outdoorc1outdoorsnow1pcpc2guildnpcmonster2soundsound_msound2monsternpc2texturesetoutdoora3outdoorb3outdoorc3outdoordesert1outdoorflame1outdoorfielddungeon1
Validation method:
- build each pack as
.m2p - remove the matching legacy
.pck - provide the runtime master key through:
M2PACK_MASTER_KEY_HEXM2PACK_KEY_ID=1
- start the Linux-built Windows client with
xvfb-run + wine
Observed result:
PackInitializesucceeded- Python startup succeeded
app.Create(...)succeeded- client reached
MainStream.SetLoginPhase()
For the world, audio, actor, and gameplay-adjacent packs in this list, the current validation level is startup regression smoke only. Full confidence for those packs still requires map-load or in-game coverage.
The repository now also includes a scenario validator for common world packs:
scripts/validate_runtime_scenarios.py
It verifies that selected Outdoor* maps reference valid textureset and
environment assets across pack boundaries.
It also now includes an actor/content validator:
scripts/validate_actor_scenarios.py
On the current real client runtime, the full actor validator reports five data
issues that look like pre-existing content inconsistencies rather than .m2p
loader regressions:
Monster/misterious_diseased_hostmissing25.gr2Monster/skeleton_kingmissing24.gr2Monster/thief2missing03_1.gr2NPC/christmas_treemissingwait.gr2NPC/guild_war_flagmissingwait.gr2
The expanded validator did not find additional breakage in:
.msmbase model references.msmeffect script references.msmdefault hit effect references.msmdefault hit sound references
It also now includes an effect graph validator:
scripts/validate_effect_scenarios.py
On the current real client runtime, the effect validator checks 458 text-based effect files and reports 12 concrete missing references:
effect/background/moonlight_eff_bat*.msemissing threeeffect/pet/halloween_2022_coffin_bat_0{1,2,3}.ddstextureseffect/background/mushrooma_{01,03,04}.msemissing matching.mdemesh fileseffect/background/smh_gatetower01.msemissingeffect/monster2/smoke_dust.ddseffect/background/turtle_statue_tree_roof_light01.msemissingturtle_statue_tree_roof_light01.mdeeffect/etc/compete/ready.msemissingready.DDS
Those current actor and effect findings are also recorded in:
known_issues/runtime_known_issues.json
That file is now the shared runtime baseline used by the validators and the aggregated release gate.
Recommended next pack groups:
- remaining startup-adjacent patch packs
- remaining late-load gameplay content not covered yet
- broader scenario-based validation for actor, effect, and sound content
Risk notes
- Do not mix silent fallback with production security claims.
- Do not ship a client that accepts
.m2pwithout runtime key enforcement. - Do not keep real secret keys inside the repository.