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

Replaced Retirement System with Turnover and Retention Module #4101

Merged
merged 115 commits into from
Jun 6, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented May 22, 2024

Turnover & Retention Module

Introduction

This module explores the various ways personnel can depart a campaign that don’t involve a six-foot wooden box. It covers a range of scenarios including CamOps Fatigue, employment contracts, retirement, and resignation, providing a dynamic approach to character exits and transitions.

Employment Contracts

Employment contracts define the formal terms of service for personnel. Characters may reach the end of their contract and choose not to renew, seeking new opportunities or a change in their career path. Or they might desert, choosing to go their own way and abandoning any hope of financial recompense.

Retirement

Retirement is a natural and honorable end to a character's active career. Whether due to age, accumulated wealth, or a desire to settle down, a character may decide to retire from the rigors of battle.

Resignation

Resignation involves a character voluntarily leaving their position. This could be driven by personal reasons, ethical disagreements, or a simple desire for change.

CamOps Fatigue

Fatigue represents the wear and tear on the body and mind that accumulates over time, especially in the high-stress environment of a BattleTech campaign. Based on the rules outline in Campaign Operations, characters may suffer from physical exhaustion, mental burnout, or a combination of both, leading them to step back from active duty. This can be temporary, with the character taking a leave of absence to recover, or it could be the first step toward a permanent exit if the fatigue is too severe.

Documentation

This module is supported by a 13 page document that covers all systems implemented by this module. It can be read, here.

Conclusion

By incorporating these various departure scenarios into our campaigns, we add depth and realism to character development and interactions. Each type of exit offers unique narrative possibilities and challenges, enriching the storytelling experience and reflecting the multifaceted nature of life in the BattleTech universe. Whether through fatigue, contractual changes, retirement, resignation, or defection, the departure of personnel can shape the course of our campaigns in unexpected ways.

Closes

Closes #197
Closes #284
Closes #1299 (or at least, makes it no longer relevant)
Closes #2402
Closes #3738
Closes #3868

IllianiCBT and others added 30 commits May 15, 2024 18:48
Expanded upon the turnover settings in Campaign Options. Multiple retirement related variables are introduced such as turnoverFixedTargetNumber, payoutRateOfficer, etc. Also, several turnover modifiers like useAgeModifiers, useUnitRatingModifiers and others have been introduced to provide more customization.
The commit introduces a new method for determining the base target number for turnover checks in campaign options.
This commit updates the Employee Turnover parameters in the CampaignOptions.java file, changes the dialog text in the CampaignOptionsDialog.properties file, and modifies the RetirementDefectionTracker.java. Changes include adjusting the turnover fixed target number and clarifying the tooltip text for improved user experience. Additional checks and modifiers for personnel departure were also implemented.
…mproving readability

Made a couple of changes, including reordering the checks for modifiers, making certain variables final, and optimizing the way HashSet is populated from an array using java Stream API. Ensured source code alignment with best practices and improved readability.
The commit introduces methods to retrieve all soldiers and uninjured soldiers in a given unit. The change also includes corrections to the RetirementDefectionTracker, whereby only soldiers in a unit commanded by the retiring person are now considered for payouts instead of the active crew. This ensures that only relevant personnel are handled during retirement and defection.
A new option has been introduced to allow soldiers to use their commander's turnover roll. Corresponding changes have been made in the GUI and properties file. Furthermore, methods have been reordered in certain classes and a method name has been updated for clarity.
…rement

The method name in various classes has been changed from getUseRandomRetirement to isUseRandomRetirement to better reflect its boolean nature. This approach provides a more intuitive understanding of the method's functionality, adhering to standard naming conventions for boolean methods.
The Payout initialization within the RetirementDefectionTracker class has been updated. Now, a person's ID is correctly passed to the getPerson method from the campaign, rectifying an issue where an incorrect ID may have been used previously.
The Commit includes the addition of new retirement modifiers like "Skill" and "Mission Status". Moreover, the shares system has been temporarily moved to the Turnover panel. The code has also been cleaned up to fix any logic discrepancies.
Implemented the addition of administrative strain tracking as part of the retirement and defection tracking system. This allows limiting the number of personnel that can be in the unit before incurring a turnover penalty based on admin/HR or admin/Command administration skill. At the same time, removed the usage of leadership modifiers.
The 'skillRatingDescription' variable was defined but not used in the mekhq.campaign.personnel.RetirementDefectionTracker. Therefore, it has been removed to prevent confusion and make the code cleaner.
This commit adjusts the filter used to calculate the non-combatant strain in the RetirementDefectionTracker. This change ensures that only active personnel, who are not civilians, not prisoners, not assigned to a unit, and who are not Astechs or Medics, are considered in the strain calculation.
…mechanics.

The code updates provide additional difficulty settings for turnover checks, allowing tiered difficulty levels. It also includes settings for handling combatant/non-combatant strain and turnover for multi-crewed units.
This change refactors the RetirementDefectionTracker class to improve the method of turnover target number calculation. Handler methods for skill rating are updated to use toString() instead of name(). Additionally, the system now calculates based on average skill value for HR roles, rather than solely on the best individual's skill. This should provide more balanced results when calculating turnover targets in campaigns.
Introduced new functionality for generating an administrative capacity report that displays strain per combined rank in the campaign summary. This will replace the combatant strain and non-combatant strain modifiers, providing a clearer representation of administrative capacity within the game settings.
A functionality has been added to retrieve the fatigue report for a campaign in the campaign summary. A corresponding label has been added to the GUI to display this information. Furthermore, unnecessary report log regarding fatigue level in the campaign process has been removed.
Implemented a new feature to track loyalty of personnel, which can affect their likelihood to stay or leave the unit. Loyalty is randomized for each personnel member, can be hidden or shown in the UI, and can be manually regenerated.
* Removed `awolDays` attribute from Person class
* Modified retirement check for founders in RetirementDefectionTracker class
* Added founder modifier to targetNumber calculation
- Removed founder modifier in RetirementDefectionTracker
- Changed "General Modifier" label to "Custom Modifier" in RetirementDefectionDialog properties
- Adjusted column names in RetirementTableModel
…in RetirementDefectionDialog

- Removed unit theft-related logic in RetirementDefectionDialog
- Simplified unit and payout calculation logic in RetirementTableModel
- Corrected minor issues in Finances properties file
- Replaced the "Misc" modifier label with "Custom" in RetirementDefectionDialog.java
- Enabled additional payment for unassigned units
- Renamed the payment type "Retirement" to "Payout" and adjusted conditions accordingly in Campaign.java
- Updated the relevant unit tests
- Updated finance properties file to reflect the new transaction type ("Payout")
@IllianiCBT IllianiCBT self-assigned this May 30, 2024
@IllianiCBT IllianiCBT added the Personnel Personnel-related Issues label May 30, 2024
IllianiCBT and others added 9 commits May 30, 2024 16:15
…ne.java and CampaignOptionsDialog.properties

- Renamed "Track original unit" to "Track Original Unit"
- Updated tooltip text for track original unit
- Renamed "Treat Aerospace pilots like MechWarriors" to "Pilots Have Units"
- Updated tooltip text for pilots have units
- Moved checkboxes for tracking original unit and pilots have units handling under founder retirement options in CampaignOptionsPane
- Updated function to set and save checkbox settings for tracking original unit and pilots have units.
…ialog

- Added ‘TechConstants’ import utility
- Revisions made to ‘unitAssignmentsComplete’ method to manage edge outcomes
- Updated conditions under which the 'payout' is computed
- Updated the unit assignment enablement logic under 'enableAddRemoveButtons' method
- Modified PersonnelStatus to 'DEFECTED' and 'DESERTED' based on conditions
- Included additional personnel statuses 'POACHED' and 'BURNED_OUT'
- Added logic to handle null 'originalUnit' in 'setOriginalUnit' method
- Adjusted 'bonusMultiplier' calculation to use double instead of int in 'getPayoutOrBonusValue'
- Image size for person’s portrait and force icon in Retirement Table adjusted to 40px from 54px
- Updated 'CustomizePersonDialog' to handle null 'OriginalUnit' selection
… modifier for personnel defection, updated status messaging for turnover and marriage, and added joint departure for couples and children.
* Introduced 'left' status for personnel who left the force for unspecified reasons
* Updated status changes in 'Campaign' class and conditions in 'PersonnelFilter' class
* Tweaked personnel departure conditions and handling for spouses and children
…efection Tracker

- Changed difficulty modifiers in RetirementDefectionTracker
- Altered bonus representation in RetirementDefectionDialog
- Modified Employee Turnover message in Campaign properties
- Revised service contract condition in RetirementDefectionTracker
- Minor tooltip text correction in CampaignOptionsDialog properties
- Removed unnecessary whitespace in Campaign class
# Conflicts:
#	MekHQ/src/mekhq/campaign/Campaign.java
#	MekHQ/src/mekhq/campaign/CampaignOptions.java
#	MekHQ/src/mekhq/utilities/MHQXMLUtility.java
…ameter from unitAssignmentsComplete method call
* Updated crew allocation for administrative strain calculation
* Added fatigue increase on injury during scenarios
* Applied stream method refactoring
* Improved contract breaking logic in retirement defection
* Fixed payout calculation during retirement defection
* Removed unnecessary/dead code and comments
@IllianiCBT IllianiCBT marked this pull request as ready for review June 2, 2024 02:03
@IllianiCBT
Copy link
Collaborator Author

This module is now ready for review. The PR description has been updated accordingly. Currently it's failing due to current issues with the nightly build.

Copy link
Member

@SJuliez SJuliez left a comment

Choose a reason for hiding this comment

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

fwiw, I have two comments from skimming through it. I guess this needs merging and nightly testing.

* Added exception handling for unit selection in CustomizePersonDialog
* Renamed 'filteredPersonnel' to 'undepartedPersonnel' for better clarity in Fatigue class
@IllianiCBT
Copy link
Collaborator Author

Addressed requested changes

@IllianiCBT
Copy link
Collaborator Author

I accidentally pushed a small edit to this branch instead of a child branch. The change introduced a default setting for the Pay Bonus field of the Turnover Dialog.

@SJuliez SJuliez merged commit aa73f42 into MegaMek:master Jun 6, 2024
4 checks passed
@IllianiCBT IllianiCBT changed the title Turnover & Retention Module Replaced Retirement System with Turnover and Retention Module Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Personnel Personnel-related Issues
Projects
None yet
3 participants