Skip to content

feat(merge): new merge engine with id remapping - #6

Merged
Zorkats merged 5 commits into
mainfrom
merge-engine
Nov 12, 2026
Merged

Zorkats merged 5 commits into
mainfrom
merge-engine

Conversation

@Zorkats

@Zorkats Zorkats commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Adds the new merge engine as a pure library under RPGModder.Core/Merge. Nothing in the app calls it yet: the UI still deploys through the 1.x engine, and wiring it in is the next step after this merges.

What to review first

  1. Composer.cs: how per-mod change sets combine, what counts as a clash, and which clashes block a deploy.
  2. IdRemapPlanner.cs and IdRemapper.cs: which added map and map event ids move when two mods add the same one, and how references follow the move.
  3. The golden cases in RPGModder.Tests/Merge/Golden: each folder is a vanilla base, two mods and the expected result.

Commits

Commit What it adds
4c7001f Three-way merge for data files, maps, plugins.js, new files and config saves
daf4d19 Golden cases and contract suites written from the rule text
2fdd0c6 Remapping of added map events and maps before composition
4a622cf Remapped map ids capped by engine: 2000 on MZ, 999 on MV or an unknown engine; map events at 999 (checked in the MZ 1.10.0 editor)
81cdf89 A base mismatch blocks the deploy until the player accepts the mod

Out of scope

  • No UI change and no change to how the app deploys today.
  • Remapping of database records, switches and variables comes in later steps.
  • Nothing emits a base mismatch yet; the check for a mod's required vanilla files is not built.

Checks

  • dotnet test RPGModder.Tests/RPGModder.Tests.csproj: 607 passed, 1 skipped (the Linux updater script test, skipped on Windows).
  • Only adds files: 145 files, no existing file changed except one new diagnostic code in Operations/DiagnosticCodes.cs.
  • CI passes on Windows and Ubuntu.

…iles and config saves

Change sets per mod, composition with collisions and resolutions, and merged file writing for database files, System.json, maps and events, js/plugins.js with an order leaf, opaque and new files, and the MV and MZ config saves. Adds merge diagnostic codes.
IdRemapPlanner decides which added map event and map ids move, from the reference table, free text, plugin files, recorded entries and DeployedMods. IdRemapper rewrites one mod's change set. Compose takes the remap plan, lists Remap on the clashes an offer settles and adds the plan's diagnostics. Adds rules.remap_target_taken.
IdRemapPlanner.Plan takes the game's engine. A remapped map id may reach 2000 on MZ and 999 on MV or an unknown engine; map events stay at 999. The limits were checked in the MZ 1.10.0 editor.
…the mod

BaseMismatch now blocks and has no default resolution; Accept and DisableMod stay the choices.
@Zorkats
Zorkats merged commit daff015 into main Nov 12, 2026
4 checks passed
@Zorkats
Zorkats deleted the merge-engine branch November 12, 2026 04:53
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