MegaMek / MegaMek/mm-data

Force Generator: CEI/SE era faction nodes never load, tech-mix tuning discarded for Clan Goliath Scorpion (3078-3160)

Open
#489 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Module Management System
Stars
3
Forks
72
Avg merge
11h 8m
Merged PRs (30d)
36

Description

Summary

Nine <faction> era nodes in data/forcegenerator/ are keyed CEI and SE. Neither is a live faction key any more - both were consolidated into CGS (data/universe/factions/CGS.yml declares aliases: {3080: CEI, 3141: SE}). The era loader does not resolve aliases, so all nine nodes are discarded at load and the tech-mix tuning they carry never takes effect.

This does not break generation. Unit availability is unaffected (see "What is not affected" below). The impact is limited to the equipment-mix targets for Clan Goliath Scorpion in the Escorpion Imperio / Scorpion Empire eras.

Evidence

From megamek.log on a current build:

RATGenerator.loadEra(RATGenerator.java:1651) - Faction CEI not found in data\forcegenerator\3078.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction CEI not found in data\forcegenerator\3082.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction CEI not found in data\forcegenerator\3085.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction CEI not found in data\forcegenerator\3100.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction CEI not found in data\forcegenerator\3131.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction SE not found in data\forcegenerator\3131.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction SE not found in data\forcegenerator\3145.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction SE not found in data\forcegenerator\3150.xml
RATGenerator.loadEra(RATGenerator.java:1651) - Faction SE not found in data\forcegenerator\3160.xml

Root cause

Two different lookup paths, only one of which resolves aliases:

  • Availability codes (CEI:4, SE:8, ...) go through RATGenerator.getFaction(key), which falls back to the alias map. These resolve to CGS correctly.
  • Era <faction> nodes go through factions.get(fKey) directly in RATGenerator.loadEra() (RATGenerator.java:1647), with no alias fallback, so the node is dropped and an error logged at line 1651.

Effect

getPctTech() returns null for CGS in these eras and falls back through fallBackFactions: [CLAN.HW], which has no era node of its own in the affected years, so generic Clan values are used instead of the authored numbers.

The discarded node in 3131.xml:

<faction key='CEI'>
    <pctOmni>0,0,20,50,80</pctOmni>
    <pctClan>10,10,60,70,90</pctClan>
    <pctSL>90,90,40,30,10</pctSL>
    <pctClan unitType='Vehicle'>10,10,33,33,33</pctClan>
    <pctSL unitType='Vehicle'>90,90,65,65,65</pctSL>
    <techMargin>12</techMargin>
    <salvage pct='10'>CHH:1,CW:2,HL:2</salvage>
</faction>

So the omni / Clan / SL proportions per rating level, the tech margin, and the isorla split (Hell's Horses, Wolf, Hell) are all currently generic for the Goliath Scorpion lineage from 3078 onward.

What is not affected

Worth stating explicitly, because this has been reported and closed as working more than once:

  • Unit availability resolves correctly. In 3131.xml alone roughly 340 CEI:* and 330 SE:* availability codes all resolve to CGS through the alias path.
  • Force generation for Clan Goliath Scorpion produces the right units in these eras. Only the composition targets are ungoverned.

Affected files

File Node(s) Note
data/forcegenerator/3078.xml CEI already has a CGS node - needs merging
data/forcegenerator/3082.xml CEI
data/forcegenerator/3085.xml CEI
data/forcegenerator/3100.xml CEI
data/forcegenerator/3131.xml CEI, SE two nodes - needs merging
data/forcegenerator/3145.xml SE
data/forcegenerator/3150.xml SE
data/forcegenerator/3160.xml SE

No era file from 3082 onward currently has a loadable node for this faction lineage.

Possible fixes

  1. Data side (this repo). Retag the nine nodes to key='CGS'. 3078.xml and 3131.xml need their values merged with the node already present rather than a straight rename. Self-contained and verifiable by re-reading the log.
  2. Code side (megamek). Change loadEra() to use getFaction(fKey) instead of factions.get(fKey) so era nodes honour the same alias map the availability path already uses. One line, and it covers any future faction consolidation - the same trap will otherwise recur the next time a faction is merged.

These are not mutually exclusive; option 2 alone would make the existing data load as authored.

Verification

After either fix, megamek.log should contain no Faction CEI not found / Faction SE not found lines on startup.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the CEI and SE nodes in the eight affected files under data/forcegenerator/, comparing the existing CGS nodes in 3078.xml and 3131.xml. Check RATGenerator.loadEra() at RATGenerator.java:1647 if evaluating the code-side option; done means the authored tech-mix values load and startup logs contain no missing CEI or SE faction lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
xml
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.