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

The Great Campaign Option Cull - Relationships #5861

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Jan 22, 2025

This is the first phase of an attempt to reduce the sheer volume of campaign options. It is focused on trimming down some of the more niche options that have minimal impact. This is going to be an iterative process over the next few versions.

Removed (Marriage)

  • Enable Manual Marriages - Now permanently enabled
  • Enable Clan Marriages - Now permanently enabled
  • Enable Prisoner Marriages - Now permanently enabled
  • Minimum Ancestors Depth - Now permanently set to 4 (the previous default)
  • Log Name Changes - Now permanently enabled
  • Enable Random Prisoner Marriages - Now permanently disabled
  • Random Marriage Age Band - Now permanently set to 10 (the previous default)

Removed (Divorce)

  • Enable Manual Divorce - Now permanently enabled
  • Enable Manual Clan Divorce - Now permanently enabled
  • Enable Manual Prisoner Divorce - Now permanently enabled
  • Use Random Opposite Sex Divorce - Now permanently enabled if random divorce is enabled.
  • Use Random Same Sex Divorce - Now permanently enabled if random divorce is enabled.
  • Use Random Clan Divorce - Now permanently enabled if random divorce is enabled.
  • Use Random Prisoner Divorce - Now permanently enabled if random divorce is enabled.

Removed (Procreation)

  • Enable Manual Procreation - Now permanently enabled.
  • Enable Clan Procreation - Now permanently enabled. Random Clan procreation still has a separate option.
  • Enable Prisoner Procreation - Now permanently disabled
  • Determine Father at Birth - Now permanently disabled
  • Display True Due Date - Now permanently disabled
  • Log Procreation - Now permanently enabled
  • Use Relationshipless Random Procreation - users can disable this by setting the relationshipless procreation chance to 0.

Removed redundant manual options for marriage, divorce, and procreation from CampaignOptions and related classes. Adjusted logic to streamline features relying on only random methods while maintaining existing functionality. Cleaned up associated resources and XML serialization/deserialization.
Eliminated obsolete code related to marriage, divorce, and procreation options, such as mutual ancestor checks and specific toggles for random actions. These removals streamline the codebase and reduce maintenance of unused features, enhancing overall clarity and efficiency.
Removed redundant mock setups and unused assertions in several test files for divorce, procreation, and marriage handling. Streamlined `canProcreate` and `canMarry` test methods to clarify failure conditions and ensure concise execution paths.
@IllianiCBT IllianiCBT added For New Dev Cycle Campaign Options Relates to, or includes, campaign option changes labels Jan 22, 2025
@IllianiCBT IllianiCBT self-assigned this Jan 22, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.22%. Comparing base (3fc188d) to head (1ad46f5).
Report is 19 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5861      +/-   ##
============================================
- Coverage     10.28%   10.22%   -0.06%     
+ Complexity     6132     6063      -69     
============================================
  Files          1039     1039              
  Lines        139404   138945     -459     
  Branches      20650    20583      -67     
============================================
- Hits          14341    14211     -130     
+ Misses       123647   123324     -323     
+ Partials       1416     1410       -6     

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

Copy link
Collaborator

@rjhancock rjhancock left a comment

Choose a reason for hiding this comment

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

Just some nitpicks. Nothing serious.

@@ -342,7 +327,7 @@ void testApplyBothSpaceYours() {

@Test
void testApplyHyphenYours() {
when(mockCampaignOptions.isLogMarriageNameChanges()).thenReturn(false);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit Pick: Don't need the extra white space.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same throughout the file....

Comment on lines +122 to 124

assertNull(mockProcreation.determineFather(mockCampaign, mother));

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: Remove the extra blank lines.

# Conflicts:
#	MekHQ/src/mekhq/campaign/personnel/marriage/AbstractMarriage.java
#	MekHQ/src/mekhq/campaign/personnel/procreation/AbstractProcreation.java
#	MekHQ/unittests/mekhq/campaign/personnel/marriage/AbstractMarriageTest.java
#	MekHQ/unittests/mekhq/campaign/personnel/procreation/AbstractProcreationTest.java
Removed checks and test cases related to clan and prisoner-specific marriage and procreation rules. These changes simplify the handling of marriage and procreation, focusing on random cases and removing unused configuration options.
@IllianiCBT IllianiCBT closed this Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Campaign Options Relates to, or includes, campaign option changes For New Dev Cycle Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants