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

Add new Scenario features to CustomizeScenarioDialog #3931

Merged
merged 84 commits into from May 13, 2024

Conversation

AaronGullickson
Copy link
Member

@AaronGullickson AaronGullickson commented Mar 29, 2024

This PR addresses issue #3927. It adds a lot of new features to the CustomizeScenarioDialog. Because a lot of features were moved from AtBScenario to Scenario as part of the work on story arcs, you can now do a lot with Scenario but up until now there has been no way to access all of the goodies. With this PR, it should now be possible to set up a variety of things for your game before starting the game, including:

  • maps, either fixed or random parameters from the mapgen directory
  • other bot forces, including behavior, deployment, team, camo, and the ability to set a set of fixed units from a mul or randomized units.
  • player's deployment
  • scenario objectives
  • scenario deployment limits

Now, you can of course, do most of this from the chat lounge as well, so why replicate that here? The first and foremost reasons is that I need this dialog for the story arc editor so that creators can create pre-generated scenarios chock full of good stuff. But I think it can be useful for anyone. I find that with big games, I often goof something up and have to reset and set it all up again in the chat lounge. Having all of this pre-specified in MHQ provides a QoL improvement. It also will integrate nicely with AtB, so that players can tweak their scenarios before entering the chat lounge.

Of course, I didn't want to just replicate the entire functionality of the chat lounge here because that would be insane. So, this dialog does not offer you as much richness in appearance as the chat lounge, but it can still do a lot. Whenever possible I tried to use existing methods from the chat lounge rather than duplicate code, but many of the dialogs there require a lot of assumptions about clients and games that made it difficult in some cases.

Some previews of the dialog. Here is one of the main dialog. I stuffed it pretty full. Future expansions may need to consider tabbing.

Screenshot 2024-05-06 at 2 40 17 PM

Next is a shot of the dialog for customizing deployment position. I based this on the one from MM and it includes the more advanced deployment options.

Screenshot 2024-05-06 at 2 40 22 PM

The map editor has two different looks. If you are using random maps, you will be given a choice of the different random generators in the mapgen directory:

Screenshot 2024-05-06 at 2 40 42 PM

If you are using fixed maps, then you get a display similar to the chat lounge where you can see thumbnail versions of each map (note Scenario does not have the ability currently to combine multiple fixed maps into a single map).

Screenshot 2024-05-06 at 2 41 01 PM

The BotForce dialog includes the ability to load a set of fixed entities from a MUL file. This allows players to use the ChatLounge if they want to get all the details just right and then load the entities here. You can also choose a random generation option using BotForceRandomizer. Note that you can also do both fixed and random.

Screenshot 2024-05-06 at 2 41 18 PM

Scenario objectives are available in the scenario objectives dialog. I based this on the one from the scenario template dialog with a good deal of improvement to its layout and design.

Screenshot 2024-05-06 at 2 41 39 PM

Finally, you can limit scenario deployment as a percent of your total force or total number of units. You can also specify only certain types of units as allowed.

Screenshot 2024-05-06 at 2 41 56 PM

@AaronGullickson AaronGullickson self-assigned this Mar 29, 2024
@AaronGullickson AaronGullickson linked an issue Mar 29, 2024 that may be closed by this pull request
Copy link

codecov bot commented Mar 29, 2024

Codecov Report

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

Project coverage is 10.64%. Comparing base (e7d4f4a) to head (e4518ce).
Report is 9 commits behind head on master.

Files Patch % Lines
.../src/mekhq/gui/dialog/CustomizeScenarioDialog.java 0.00% 204 Missing ⚠️
MekHQ/src/mekhq/campaign/mission/Scenario.java 0.00% 29 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3931      +/-   ##
============================================
- Coverage     10.65%   10.64%   -0.02%     
- Complexity     5535     5536       +1     
============================================
  Files           839      839              
  Lines        114352   114496     +144     
  Branches      17199    17208       +9     
============================================
+ Hits          12187    12189       +2     
- Misses       100934   101077     +143     
+ Partials       1231     1230       -1     

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

@Thom293
Copy link
Contributor

Thom293 commented Mar 29, 2024

This is just a question and Im not trying to create additional work: Is there a way here or already existing to pre-define the bot behaviour (e.g. Sniper, Berserk, Escape, etc.)? If it already exists I havent seen how to do it other than to change manually in the lobby. I presume it exists somehow because some scenarios they are set to flee first, but I dont see where it is actually set.

Again if it doesnt exist Im not trying to suggest additional work for you. I can look at it myself or put up a separate RFE for later. Thank you.

@AaronGullickson
Copy link
Member Author

It's there in bot force and I am planning to allow users to edit it.

@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2024

Codecov Report

Attention: Patch coverage is 0.17376% with 2298 lines in your changes are missing coverage. Please review.

Project coverage is 10.36%. Comparing base (ac01416) to head (86886bd).
Report is 474 commits behind head on master.

Files Patch % Lines
.../src/mekhq/gui/dialog/CustomizeScenarioDialog.java 0.00% 596 Missing ⚠️
.../src/mekhq/gui/dialog/CustomizeBotForceDialog.java 0.00% 457 Missing ⚠️
...q/gui/dialog/CustomizeScenarioObjectiveDialog.java 0.00% 405 Missing ⚠️
...HQ/src/mekhq/gui/dialog/EditMapSettingsDialog.java 0.00% 264 Missing ⚠️
.../gui/dialog/EditScenarioDeploymentLimitDialog.java 0.00% 123 Missing ⚠️
...kHQ/src/mekhq/gui/dialog/EditDeploymentDialog.java 0.00% 111 Missing ⚠️
MekHQ/src/mekhq/gui/model/ObjectiveTableModel.java 0.00% 68 Missing ⚠️
MekHQ/src/mekhq/gui/model/BotForceTableModel.java 0.00% 57 Missing ⚠️
...src/mekhq/campaign/mission/BotForceRandomizer.java 0.00% 51 Missing ⚠️
MekHQ/src/mekhq/Utilities.java 0.00% 45 Missing ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3931      +/-   ##
============================================
- Coverage     10.80%   10.36%   -0.45%     
+ Complexity     5608     5604       -4     
============================================
  Files           841      893      +52     
  Lines        114672   119525    +4853     
  Branches      17235    17760     +525     
============================================
- Hits          12392    12386       -6     
- Misses       101021   105880    +4859     
  Partials       1259     1259              

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

@AaronGullickson AaronGullickson marked this pull request as ready for review May 7, 2024 06:36
@AaronGullickson AaronGullickson added Enhancement Requests for Enhancement GUI labels May 7, 2024
@AaronGullickson
Copy link
Member Author

@HammerGS Conflicts dealt with - should be ready to merge.

@HammerGS HammerGS merged commit 47c5762 into MegaMek:master May 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Requests for Enhancement GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the new Scenario features to CustomizeScenarioDialog
5 participants