8000 Improvement: Updated Faction Starting Location Logic for Mercenary and Pirate Campaigns by IllianiBird · Pull Request #7301 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Updated Faction Starting Location Logic for Mercenary and Pirate Campaigns #7301

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

Conversation

IllianiBird
Copy link
Collaborator

Earlier in the 50.07 dev cycle I introduced some logic to allow pirate campaigns to start on any playable faction's capital. The intent was for this to introduce a degree of randomness to a play start. However, I really wasn't happy with the code and it didn't really work as I intended.

So I went ahead and updated the logic, improved it for robustness and extended the random start logic to mercenary campaigns.

The logic is thus:

  • If the campaign isn't mercenary or pirate start on the relevant faction capital
  • If the campaign is mercenary, start on the mercenary capital 33% of the time, otherwise start on a random playable faction's capital (excluding Clan factions and those in the Deep Periphery). No weighting.
  • If the campaign is pirate, start in the Tortuga Dominions capital 33% of the time (if TD is around, otherwise start on the Mercenary capital), otherwise start on a random playable faction's capital as before, only this time with additional weighting for periphery (non-deep periphery) nations.

Combined with the new faction standing system, this should help give individual campaigns more character. Especially mercenary campaigns, as it means campaigns will now start embedded in nations other than the Lyran Commonwealth.

@IllianiBird IllianiBird self-assigned this Jul 6, 2025
@IllianiBird IllianiBird requested a review from a team as a code owner July 6, 2025 04:09
@IllianiBird IllianiBird added the Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature label Jul 6, 2025
Copy link
codecov bot commented Jul 6, 2025

Codecov Report

Attention: Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.

Project coverage is 12.68%. Comparing base (6e47b9e) to head (628c3b3).
Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/campaign/Campaign.java 0.00% 39 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7301      +/-   ##
============================================
- Coverage     12.70%   12.68%   -0.02%     
  Complexity     7575     7575              
============================================
  Files          1166     1171       +5     
  Lines        149038   149172     +134     
  Branches      22867    22890      +23     
============================================
- Hits          18939    18929      -10     
- Misses       128067   128213     +146     
+ Partials       2032     2030       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator
@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

LGTM

@IllianiBird IllianiBird merged commit 95eb458 into MegaMek:master Jul 7, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0