-
Notifications
You must be signed in to change notification settings - Fork 174
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
Updated StratCon Sector Sizes & Added Persistent OpFor #5230
Conversation
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.
Removed redundant scenario generation checks and refactored pre-deployment probability calculations. Simplified conditionals in StratconRulesManager, and integrated scenario odds computation into StratconContractInitializer. This enhances code clarity and consistency in scenario management.
Modified scenario generation to include an option for allowing scenarios to spawn on top of player-allied facilities. Updated function signatures and added logic to accommodate this new parameter, ensuring that scenarios can now be placed more flexibly based on provided configurations.
Refactored the calculation of scenario odds for better readability and maintainability. Also added a new method to handle daily movement processing for scenarios in each track. Expanded pre-deployment logic and cleaned up code to enhance functionality.
Updated the copyright years to 2024 and revised the license information for consistency and accuracy. This ensures the codebase reflects the correct legal information and adheres to the project's licensing guidelines.
Changed the visibility of the seedPreDeployedForces method to private and added a detailed Javadoc comment explaining its functionality. Removed redundant comments from the initializeTrackState method to improve code readability.
Made `seedPreDeployedForces` method public to allow seeding of pre-deployed forces in StratCon tracks. Also added logic to handle pre-deployment for garrison and pirate hunting contract types.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5230 +/- ##
============================================
- Coverage 10.52% 10.49% -0.03%
+ Complexity 6047 6041 -6
============================================
Files 957 957
Lines 134523 134760 +237
Branches 19545 19620 +75
============================================
- Hits 14154 14147 -7
- Misses 119018 119256 +238
- Partials 1351 1357 +6 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
PreSeeded enemy force count is now based on enemy quality and faction.
Introduced a new method, `processMassRout`, in `StratconRulesManager` to handle scenarios without deployment dates. Integrated this method into `AtBContract` to ensure these scenarios are removed and updated appropriately.
Ensured that mass rout processing in AtBContract only occurs when StratCon is enabled in campaign options. This change prevents unnecessary operations and aligns with the intended functionality of user-defined campaign options.
For anyone curious: The number of enemy forces spawned is based on enemy faction, quality, and contract type. We start with a baseline value determined by enemy faction: A Clan Cluster (11 Stars), an IS Battalion (14 Lances), or a ComStar Level IV (18 Level IIs). Note that these values have all been reduced by half. At a later date we plan to have friendly forces appear in the AO too, at which point this artificial reduction will be removed. We then consult the following table: We adjust this value by the contract type: These values are then used as a modifier to adjust the initial value (rounded up) Example A That means Commander Romanova can expect Clan Ghost Bear to deploy 9 forces of varying sizes (11 * 0.75). This might seem like a lot, but it's important to note that these forces do not all need to be fought, and certainly not all at the same time. Example B That means Commander Rogers can expect the DCMS to deploy 14 forces of varying sizes (14 * (1 * 1)). Example C That means Star Colonel Fury can expect Clan Wolf to deploy 54 forces of varying sizes (18 * (1.5 * 2)). This is going to be a tough fight! |
Updated isOffensive method to include planetary assaults, modified processMassRout to streamline parameters, and adjusted seeding logic with revised multipliers. This enhances the clarity and efficiency of the StratCon campaign state management and scenario processing.
Modified `getUnoccupiedAdjacentCoords` method to include an optional boolean parameter `weightPlayerForces` which prioritizes player-allied forces and facilities when determining suitable adjacent coordinates. Updated `StratconRulesManager` to leverage this new parameter for enhanced scenario deployment logic.
Updated the condition to exclude strategic objectives when checking for null deployment dates in scenarios. This ensures that only relevant scenarios get new coordinates, preventing strategic objectives from being relocated erroneously.
Shouldn't example B be 7 forces because it's a Garrison Duty? (14 * (1 * 0.5)) |
Yes |
Improved the morale calculation and routing logic when handling contracts, especially garrison duties. Updated methods to factor in enemy skill, weapon reliability, and included a more sophisticated approach to determining balance of power. Minor refactoring was also done for code clarity and efficiency.
Pushed an update to fill in a couple of holes:
Closes #4565 |
We have a lot of plans for StratCon in 2025, so consider this an early Christmas present.
This PR updates the size of StratCon Sectors (Tracks) to be tied to the size of the planet, rather than the number of lances required by the contract.
We also do some under-the-hood changes and expansions to the utility methods used to add scenarios to StratCon maps. These were lifted from the upcoming Logistics Module. A bunch of additional
null
safeguards were put in place, too. So, hopefully, there shouldn't be any major issues.Finally, I have implemented a persistent OpFor. Now, when you arrive on contract each Sector is pre-seeded with enemy forces. These forces will explore the StratCon map, engaging your forces and facilities. When defeated, each pre-seeded force is permanently removed, though there is the chance that new enemy forces will be redirected into your AO to counter your advance - based on Morale.
Speaking of Morale, while still based on a dice roll, morale is significantly impacted by the number of enemy forces exploring your AO. So you want to make sure to get rid of them quick!
You will still face weekly scenarios as normal.
Scouting no longer spawns enemy forces, so an area already cleared will stay cleared (barring new forces entering the area).
Hype aside, this is a very basic implementation and one designed to be expanded on throughout 2025. Right now enemy forces blindly bumble about the AO until they hit something. The next step will be adding a heat map.