feat: allow per-hub model inheritance override for merged states#8
Draft
feat: allow per-hub model inheritance override for merged states#8
Conversation
Extends the merge config format to support per-hub inheritance overrides.
Users can now specify which original state's hub province (city, port,
farm, mine, wood) the merged state should inherit, instead of always
using the default "keep diner's hub or fall back to first food's hub"
behavior.
New extended format (backward-compatible JSON):
"STATE_A": {
"merge": ["STATE_B", "STATE_C"],
"city": "STATE_B",
"port": "STATE_C"
}
Old list format still works unchanged.
Co-authored-by: ShabbyGayBar <115197764+ShabbyGayBar@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate town selection for newly merged states
feat: allow per-hub model inheritance override for merged states
Mar 19, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merged states currently inherit hub models (city, port, farm, mine, wood) from whichever source state happens to provide them first, causing hubs to cluster inside the original target state's territory with no user control.
Changes
merge_states.jsonvalues can now be either the existing list (backward-compatible) or a dict with a"merge"key plus optional per-hub override keys. Both formats can coexist in the same file.{ "STATE_A": { "merge": ["STATE_B", "STATE_C"], "city": "STATE_B", "port": "STATE_C" }, "STATE_D": ["STATE_E"] }cli.py— Addedload_merge_config()that normalises both formats into(merge_dict, hub_overrides).state_regions.py—StateRegion.merge_states()— Acceptshub_overrides. Snapshots all referenced hub province IDs before any merging (food states are removed after merge), then applies overrides to the diner state after all its foods are merged.state_merger.py— Threadshub_overridesthroughStateMerger.__init__()→merge_state_data()→map_data.merge_states().merge_loc_data()now preferentially searches the override source state for hub name localization before falling back to the food list.Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.