Use the surviving CGS code for Escorpion Imperio diplomacy data - #507
Open
HammerGS wants to merge 1 commit into
Open
Use the surviving CGS code for Escorpion Imperio diplomacy data#507HammerGS wants to merge 1 commit into
HammerGS wants to merge 1 commit into
Conversation
The Escorpion Imperio (CEI) and Scorpion Empire (SE) faction files were consolidated into CGS, which renders as "Escorpion Imperio" from 3080 and "Scorpion Empire" from 3141 through its nameChanges. CEI survives only as an alias so that old campaign saves keep resolving; it should not appear in current data. Two of these entries were not merely out of date, they were wrong once CEI is understood to mean CGS: - "CEI contains CGS" becomes Clan Goliath Scorpion contained within itself. Contract generation counts a faction once for itself and again for each faction contained inside it, so this made CGS roughly twice as likely to be drawn as an employer from 3080 on. - The Hanseatic Crusade listed both CEI,HL and CGS,HL as warring parties, which is the same war between the same two factions declared twice. Both are removed. The three genuine containments - Nueva Castile, the Umayyad Caliphate and the Hanseatic League inside Scorpion space - now name CGS as the host and keep their existing fractions. The legacy factionhints.xml gets the identical changes, so it stays in parity with the factionDiplomacy YAML. Without that, MekHQ's legacy-XML comparison would report a difference and wrongly tell every player their factionhints.xml had been customised. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What this fixes
In any campaign from 3080 onward, Clan Goliath Scorpion was about twice as likely as it should be to
come up as a contract employer, and the Hanseatic Crusade was declared twice over as a war.
Both come from the same cause: this data still used
CEI, the retired faction code for the EscorpionImperio.
Why the old code is a problem
The Escorpion Imperio (
CEI) and Scorpion Empire (SE) faction files were consolidated intoCGS.That one file now covers the whole lineage, and renders as "Escorpion Imperio" from 3080 and "Scorpion
Empire" from 3141 through its
nameChanges.CEIsurvives only as an alias, so that old campaignsaves and other data we cannot go back and edit keep resolving to the surviving faction. It is a
compatibility shim, not a spelling we should still be writing into current data.
Once you read
CEIas meaningCGS, two of these entries stop making sense:Goliath Scorpion contained inside itself. The file said the Escorpion Imperio has Clan Goliath
Scorpion living inside its borders. That was true when they were two separate factions - but they are
one faction now, so the line reads "Goliath Scorpion contained within Goliath Scorpion". Contract
generation counts each faction once for itself, then again for every faction living inside it, so CGS
got counted twice and its odds of being drawn as an employer roughly doubled.
The same war, twice. The Hanseatic Crusade listed both
CEI,HLandCGS,HLas warring parties.Those are now the same two factions, declared at war with each other in duplicate.
Changes
CEIcontainsCGSentry. After the consolidation the Goliath Scorpions are the hosthere, not something contained within the host.
CEI,HLwar party line from the Hanseatic Crusade.Scorpion space - now name
CGSas the host and keep their existing fractions (0.3, 0.3 and 0.5).CGSand why there is deliberately no CGS-inside-CGS entry,so this does not get "helpfully" restored later.
The legacy
factionhints.xmlgets the identical changes. That part is not optional: MekHQ compares thelegacy XML against the
factionDiplomacyYAML to detect a player's customised XML, so if the two driftedapart every player would be told their
factionhints.xmlhad been customised when it had not.Files Changed
data/universe/factionDiplomacy/3080-present_escorpionImperio.ymldata/universe/factionDiplomacy/3141-3142_hanseaticCrusade.ymldata/universe/factionhints.xmlTesting
factionhints.xmlstill parses as well-formed XML; both edited YAML files still parse.CEIreference remains anywhere in the diplomacy data - the only remaining mentionsare the explanatory comments.
legacy-XML comparison checks.
Playtested in MekHQ with this data staged. The diplomacy data loads with no faction errors:
Two things that matters:
Invalid faction code ... CEIerrors are gone fromlogs/mekhq.log, in both thefactionhints.xmlform and the[FactionDiplomacy] ... in 3080-present_escorpionImperio.ymlform.YAML still agree. That was the riskiest part of this change - had only the YAML been updated, the two
would have drifted and every player would have been wrongly told their
factionhints.xmlhad beencustomised. They still match.
What is NOT proven yet
RandomFactionGenerator- it merges a weight for the faction, then again for each faction containedwithin it - not by comparing contract generation before and after. The reasoning is solid, but
confirming the 2x effect would need many contract draws and a tally, so the fix is verified while
the original magnitude is not.
time; either one alone would have silenced the log errors. The parity result above, however, is
specific to this PR.
Factions.getFaction()does not resolve faction aliasesat all, so retired codes in other places - campaign saves, planetary ownership, RAT availability
tables - still fall through to the placeholder faction. That is fixed separately in
Resolve retired faction codes through their aliases (CEI, SE) mekhq#9739. The two can merge in either order and neither blocks the other.