Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force generator updates - C/SL/O and mixed weight class handling #6394

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

SuperStucco
Copy link
Collaborator

There are three updates in this PR.

First is a minor tweak to whether the C/SL/O (Clan/Star League/Omni) percentages are used to adjust weights in the RAT table. The previous update had some bad logic with role checking. Now it simply skips the adjustment if any roles are used, on the basis that specific force types are probably not going to conform and trying to force them are more likely to generate off-kilter results.

Second is applying a similar gate/filter to the weight class proportion adjustment. Previously, when more than one weight class was used to generate the RAT it would adjust the random selection weights by weight classes using faction data. Fine for combat units, although they are almost always generated with a single weight class and would skip this part anyways. For other units such as non-combat/civilian, which are generated across all weight classes due to limited numbers, this unnecessarily distorts the table values. The weight balancing now includes similar filters to the C/SL/O adjustments where it is only performed on Meks, vehicles, and aerospace (no infantry, DropShips/large craft, etc.), and only when no roles are used.

Third is a minor adjustment in how C/SL/O percentages are read from faction data. Previously they incorporated a fallback, automatically using Mek data if vehicle or aerospace data was not provided. With few (if any) Clan vehicles or aerospace fighters made available to IS factions, these unit types will never have the same proportions as Mek forces causing significant changes as it attempted to change ratios to values that could not be met. Now with the fallback removed, if there is no specific vehicle or aerospace C/SL/O rating provided when processing those units types it leaves the availability values as they are.

Copy link

codecov bot commented Jan 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.60%. Comparing base (3993930) to head (b219c6b).
Report is 17 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6394      +/-   ##
============================================
+ Coverage     28.57%   28.60%   +0.02%     
+ Complexity    14090    14088       -2     
============================================
  Files          2785     2784       -1     
  Lines        273288   273073     -215     
  Branches      48408    48379      -29     
============================================
- Hits          78103    78099       -4     
+ Misses       191203   190994     -209     
+ Partials       3982     3980       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HammerGS HammerGS merged commit a25c7ae into MegaMek:master Jan 13, 2025
6 checks passed
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.

2 participants