8000 Fix: #7007 Fixed Cancel Deployment Producing Scenario with 0 BV Budget by IllianiBird · Pull Request #7009 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: #7007 Fixed Cancel Deployment Producing Scenario with 0 BV Budget #7009

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

IllianiBird
Copy link
Collaborator

Fix #7007

When a player deploys to a hidden scenario we generate the scenario, including the BV budget of forces assigned to that scenario. However, if the player cancels deployment - at that moment - the budget was getting set to 0 because we were not correctly resetting the scenario. This was due to the conditional that checked for the deployment being canceled was not functioning fully. However, as the force didn't get deployed it gave the impression that it was fully functional.

We fixed this by added a new variable to the deployment wizard that explicitly states whether the deployment was canceled. If that event comes to pass the scenario is reset fully. However, the originally generated force is not, preventing the 0 BV bug.

Design Notes

The cancel deployment bug is a hacky solution to a UX problem and one we should really rethink. However, such a task isn't on my schedule so would need to be picked up by another developer. Basically the problem we have to solve is that players sometimes want to backtrack out of deployment. However, if the player force is 'ambushed' (i.e. the scenario is populated at point of deployment) the player should - at that point - be barred from canceling the deployment as their force has been ambushed.

@IllianiBird IllianiBird self-assigned this May 15, 2025
@IllianiBird IllianiBird requested a review from a team as a code owner May 15, 2025 17:58
@IllianiBird IllianiBird added Bug StratCon Bugs relating strictly to StratCon Severity: High Issues described as high severity as per the new issue form labels May 15, 2025
Copy link
codecov bot commented May 15, 2025

Codecov Report

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

Project coverage is 11.98%. Comparing base (4f3213e) to head (018e8b5).
Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
...src/mekhq/gui/stratcon/StratconScenarioWizard.java 0.00% 7 Missing ⚠️
MekHQ/src/mekhq/gui/StratconPanel.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #7009   +/-   ##
=========================================
  Coverage     11.98%   11.98%           
+ Complexity     6860     6856    -4     
=========================================
  Files          1102     1102           
  Lines        142197   142150   -47     
  Branches      21989    21977   -12     
=========================================
- Hits          17039    17038    -1     
+ Misses       123333   123288   -45     
+ Partials       1825     1824    -1     

☔ 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.

@Sleet01
Copy link
Collaborator
Sleet01 commented May 15, 2025

Does the system support a two-step process:

  1. a scenario is generated, but not added to the mission, when the player starts the deployment.
  2. the generated scenario is added to the mission if and only if the player does not cancel
    or something?

IIRC this is how the MegaMek unit configuration dialog works: the player's changes are recorded in the dialog state itself, but only applied to the unit(s) if the player clicks "OK".

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
Copy link
Collaborator Author
IllianiBird commented May 15, 2025

The Scenario is added to the Mission the moment it's spawned. The issue was around the BV Budget allocated to forces within that scenario.

What we would need to do, to solve the 'backing out of an ambush' problem is have this dialog predate the spawning of the scenario but with sufficient knowledge to know that a scenario will be spawned. The problem is that, insofar as I can see, StratCon was never built with this interaction in mind.

@HammerGS HammerGS merged commit 37b7800 into MegaMek:master May 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Severity: High Issues described as high severity as per the new issue form StratCon Bugs relating strictly to StratCon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] 0.50.06-nightly-2025-05-15 - Manual deployment of force to attack facility on integrated contract has seed BV of 0 in log
3 participants
0