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

RATGen/force generator role handling updates #5527

Merged
merged 12 commits into from
Jun 1, 2024

Conversation

SuperStucco
Copy link
Collaborator

@SuperStucco SuperStucco commented May 30, 2024

The role handling for converting the force generator XMLs to RAT tables/generating random forces has a few holes that need patching, mostly around infantry roles and non-combat units. There were also a few errors, such as limiting MINELAYER/MINESWEEPER to Mechs (rather than ground vehicles) and infantry.

closes #5286

Role/unit type validation:

  • adds missing SR_FIRE_SUPPORT and MIXED_ARTILLERY roles to unit type validations
  • updates role/unit type validations to properly account for all unit type/role combinations
  • organize and comment for readability (enum integer-equivalent less/greater than comparisons are pretty hard to follow at a glance unless you know all the values by heart)

Availability value modifications by role:

  • adds missing roles for when specific roles are requested, mostly infantry but a few standard ones as well
  • more extensive handling of non-combat roles (not needed now, but will be useful later)
  • replace array index calls with named variables for readability
  • relax application of role modifiers when no roles are called for, while still filtering out non-combat units
  • organize and comment for readability

Non-combat/support unit identification:

  • simplifies identification of non-combat support and civilian units

Role parser:

  • adds missing MIXED_ARTILLERY role to string parser

Help file is updated to list the full set of roles, along with valid unit types and typical uses.

SuperStucco added 12 commits May 28, 2024 08:17
…y - less-than/greater-than comparisons on enum int equivalents are not always clear.
…mostly infantry-related. General readability improvements, such as re-sequencing switch bock to group related roles, replacing array index calls with named variables, and descriptive commenting. Updated tests to better reflect current range of units and capabilities.
… be easily excluded from use in combat roles.
…ts without the direct FIRE_SUPPORT or SR_FIRE_SUPPORT role
@IllianiCBT IllianiCBT self-requested a review May 30, 2024 04:23
Copy link
Collaborator

@IllianiCBT IllianiCBT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to see any issues here. Glad to see some of the missing roles added and our coverage expanded.

@IllianiCBT
Copy link
Collaborator

Never mind, I got so excited I failed to notice the PR is still in Draft. >_>

@IllianiCBT IllianiCBT self-requested a review May 30, 2024 04:25
@HammerGS HammerGS added Data Hammertime. Create Random Army Issue Any issue related to any part of the Create Random Army tabs. labels May 30, 2024
@SuperStucco SuperStucco marked this pull request as ready for review May 31, 2024 00:18
@SuperStucco
Copy link
Collaborator Author

Just making sure there isn't any last minute changes prompted by a round of data changes, now ready for review.
This should fix #5286

Copy link
Collaborator

@IllianiCBT IllianiCBT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (for real this time)

@IllianiCBT
Copy link
Collaborator

Just making sure there isn't any last minute changes prompted by a round of data changes, now ready for review. This should fix #5286

If you add 'closes #5286' somewhere in your PR description, GitHub will link the two PRs. :)

@Sleet01 Sleet01 merged commit c7611e2 into MegaMek:master Jun 1, 2024
4 checks passed
@SuperStucco SuperStucco deleted the RATGen-role-handling-updates branch July 11, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Create Random Army Issue Any issue related to any part of the Create Random Army tabs. Data Hammertime.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RAT generator is not adjusting relative frequencies for conventional infantry roles
4 participants