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

Reworked StratCon Sector Sizes & Initialize State #5229

Closed
wants to merge 5 commits into from

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Nov 20, 2024

This PR does a couple of things.

First it adds more robust checks and balances to the method added in 50.01 that allows easy addition of new scenarios to a StratCon Track (aka sector). It also adds the ability to insert hidden scenarios into a StratCon Track. This is taken from the in-dev Logistics Module.

Previously the size of a StratCon Track was determined by the number of lances required by the contract. Now Tracks are sized according to the surface area of the planet the contract is based on. This substantially increases the size of Tracks by design. This is in preparation for a major 2025 project that we're not ready to discuss at this time. Developers, if you're not aware of what this alludes to, and want to know, ask in the Developer chat. :)

Finally, using the new method that allows us to add non-objective scenarios to the StratCon Track, we now seed enemy forces on Tracks prior to the players' arrival. These are fixed hidden scenarios (i.e. they will always be there until found and resolved). The number of hidden enemy forces is based on the size of the Track and the type of contract:

Garrison or Pirate Hunting: None
Raid or Guerrilla Warfare: Track Size / 10
Planetary Assault: Track Size / 5
Other: Track Size / 20

These values are then modified by the scenario spawn chance for the contract.

These pre-seeded fixed forces are also required for the 2025 project.

Added the calculation of planetary diameter to the initialization of StratconTrackState. This allows the track size to be set proportionally based on the planet's surface area, ensuring more realistic and varied gameplay environments.
Added null checks throughout Stratcon scenario generation methods to handle potential null scenarios. Created new methods and updated existing ones to ensure robust error handling and to return null if scenario creation fails.
Implemented a `getSize` method to calculate the track size based on width and height. This change enhances the functionality by providing a straightforward way to retrieve the total size of the track. Additionally, minor formatting adjustments were made for code consistency.
Added logic to seed sectors with hidden forces based on contract type in StratconContractInitializer. Differentiated scenario creation between garrison, raid, pirate hunting, and planetary assault contracts.
Modified contract generation to prevent full-scale invasions for pirate hunting contracts. Adjusted multiplier settings to treat guerrilla warfare similarly to raid types. These changes enhance the accuracy and realism of mission deployment scenarios.
@IllianiCBT IllianiCBT added the StratCon Bugs relating strictly to StratCon label Nov 20, 2024
@IllianiCBT IllianiCBT self-assigned this Nov 20, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.50%. Comparing base (907de4f) to head (127d15d).
Report is 7 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5229      +/-   ##
============================================
- Coverage     10.52%   10.50%   -0.02%     
+ Complexity     6044     6041       -3     
============================================
  Files           957      957              
  Lines        134523   134593      +70     
  Branches      19545    19565      +20     
============================================
- Hits          14153    14145       -8     
- Misses       119021   119095      +74     
- Partials       1349     1353       +4     

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


🚨 Try these New Features:

@IllianiCBT IllianiCBT marked this pull request as draft November 21, 2024 00:09
@IllianiCBT IllianiCBT closed this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
StratCon Bugs relating strictly to StratCon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants