MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
131 stars 169 forks source link

Company Generator does not generate units properly when a custom faction with attendant force generator files is assigned in Campaign Options #3448

Closed sldfgunslinger2766 closed 2 years ago

sldfgunslinger2766 commented 2 years ago

Environment

    MekHQ v0.49.9-SNAPSHOT
Build Date: 2022-08-29T01:09:49.410546700
Today: 2022-09-05
Origin Project: MekHQ
Java Vendor: Eclipse Adoptium
Java Version: 11.0.16
Platform: Windows 10 10.0 (amd64)
System Locale: en_US
Total memory available to MekHQ: 2 GB

Description

I have made changes to data/forcegenerator/2780.xml, data/forcegenerator/factions.xml and data/unitroles.txt that allow for a custom faction with custom units available for use with the RAT/Formation/Force generator in Megamek. I have also made changes to data/universe/factions.xml within MehHQ to create a custom playable faction. When using Manage Campaign/GM Tools Dialogue/RAT Roller, I am able to see the included custom units. However, when attempting to use Manage Campaign/Company Generator, it appears that the Company Generator is not pulling units from the proper custom faction and is instead pulling from its parent faction. When attempting to generate said companies within the Company Generator, I am making no setting changes other than maxing out the number of Companies/Lances/Mechs per Lance in order to eliminate this potentially being an RNG issue.

Included are all relevant files to duplicate my current test set up, including two save games: One being the base save and another after generating a sample maxed out unit and advancing one day in order to show the units generated (which in this instance appear to be from the Terran Hegemony parent faction).

After discussion with Windchild and confirming that the current Company Generator code uses many elements of the RAT Roller and that this is unexpected behavior, I am opening this issue and posting these files at his request

RAT Roller Company Generator 1 Company Generator 2
sldfgunslinger2766 commented 2 years ago

Custom Faction Company Generator Test Files.zip

sldfgunslinger2766 commented 2 years ago

Addendum: Disabling 'Randomize Origins and/or Randomize Dependents' in the company generator 'solves' this issue as the generator populates the custom units in the generated company.

Windchild292 commented 2 years ago

After further investigation we discovered that this is working as intended. There will be a few new options added based on this idea, however.