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

New Campaign Selector, enhanced support for campaign mods (and campaign balance mods) #3688

Merged
merged 51 commits into from
Mar 21, 2024

Conversation

past-due
Copy link
Member

@past-due past-due commented Mar 16, 2024

Add a brand-new campaign selector UI, which lets you easily pick between the Original Campaign and (newly-packaged) additional campaigns.

Newly-packaged campaign mods can all be placed inside mods/campaign, and the new selector screen lets you pick which to load when starting a new game.

Once you've selected an overall campaign, you'll be able to configure:

  • Difficulty
  • Balance (for Original Campaign)
  • The starting campaign (ex. Alpha, Beta, or Gamma for the original campaign)
  • "Tweak Options"

Tweak Options provide additional toggles that can be configured to customize the campaign experience, such as:

  • Timer Power Bonus
    • Grant power based on the remaining level timer, so there's no need to wait out the clock.
  • Classic Timers
    • Alter / disable timers on specific levels, like the original release. (Allows power-cheating.)
  • 40 Unit Limit
    • Lower the player's unit limit to 40, matching the original PS1 release.
  • Autosaves-Only
    • Disable the ability to manually save / quick-save, limit autosaves to the beginning of each level.

Alternate campaign mods can provide their own custom tweak options as well.

Campaign mods now provide a mod-info.json file which contains important information, including compatibility.

Remaining TODOs:

  • Implement support for the built-in tweak options in the base original campaign scripts
  • Implement core support for the "autosaves-only" tweak option
  • Package and include the "classic balance" mod

Possible Future TODOs:

  • Display version number for alternate campaigns

@past-due past-due force-pushed the 2024_02_campaign_config_1 branch 2 times, most recently from 4355c5a to 8e122d5 Compare March 16, 2024 03:50
@ManManson ManManson self-requested a review March 16, 2024 10:02
@Chewbakka-Wakka
Copy link

This is pretty cool, I quite like these:

Timer Power Bonus
Grant power based on the remaining level timer, so there's no need to wait out the clock.

40 Unit Limit
Lower the player's unit limit to 40, matching the original PS1 release.

@past-due past-due added this to the 4.5.0-beta1 milestone Mar 18, 2024
@past-due past-due force-pushed the 2024_02_campaign_config_1 branch 2 times, most recently from 923cbea to 78b592d Compare March 19, 2024 00:40
past-due added 20 commits March 19, 2024 18:41
The campaign number gets set by scripts on init or load.
- Calculate the ideal position so that the dropdown appears *overtop* of the currently-selected item (i.e. in-place)
- Display shadow and highlight of parent dropdown widget area, to make it clearer which parent item was clicked
Enable the ability to scroll a ScrollableListWidget by child Paragraph line(s).
Set the DropdownItemWrapper geometry in addItem() to ensure that every wrapper widget gets a size. (Previously this was only done by DropdownWidget::geometryChanged(), so items would only receive their proper dimensions if the DropdownWidget was resized after they were added.)
The widget framework now implements its own mouse drag handling, and provides consumable events.

`WIDGET` subclasses can override `capturesMouseDrag()` and return `true` if they wish to capture mouse drag events on mouse down. The widget that captured the mouse down will then have its `mouseDragged()` override called to process mouse drag events. It will also always receive a `released()` call when the mouse button is released (regardless of whether the mouse was released over the widget).
Fixes non-responsive slider drag when sliders are on overlay screens.
past-due and others added 20 commits March 20, 2024 15:46
- Add support for new campaign mod packages that contain mod-info.json, compatibility info, tweak options, and more
- Add new campaign selector UI, which display both original campaign balance mods and alternate campaigns, plus lots of options
- Improve loading campaign mods, and on-demand loading of campaign mods with saveload

See: doc/CampaignMods.md
Not sure if correct but I do see values that look right at a glance.
Co-Authored-By: KJeff01 <[email protected]>
@past-due past-due force-pushed the 2024_02_campaign_config_1 branch from 0ea839d to 39f3784 Compare March 20, 2024 19:53
src/titleui/campaign.cpp Outdated Show resolved Hide resolved
src/titleui/campaign.cpp Outdated Show resolved Hide resolved
@ManManson
Copy link
Member

ManManson commented Mar 20, 2024

Really nice UI for the campaign selection, thanks!

I only have a single technical concern about the PR. Wouldn't it be easier and cleaner to completely separate original remastered and original classic campaign modes by having a distinct set of JS scripts for each?

I see a lot of if (camBalanceClassic()) stuff here and there in the scripts and IMHO it would be much nicer not to share the same scripts for both modes.

But, maybe I'm missing something here. What do you think, @past-due and @KJeff01 ?

Also had a couple of minor nitpicks, but, other than that, the PR is just fine 🙂

@past-due
Copy link
Member Author

past-due commented Mar 20, 2024

I only have a single technical concern about the PR. Wouldn't it be easier and cleaner to completely separate original remastered and original classic campaign modes by having a distinct set of JS scripts for each?

I see a lot of if (camBalanceClassic()) stuff here and there in the scripts and IMHO it would be much nicer not to share the same scripts for both modes.

Because classic campaign mode is largely just a variation on what's already there (with stats changes of course), and the script changes are fairly minor to support research differences (and a few other small things), this seemed preferable (also from an ongoing maintenance standpoint). It also makes it easy for anyone to quickly check what the differences actually are between the two modes, IMHO, because they can just search for camBalanceClassic().

EDIT:

Also we want to set a certain example: For campaign balance mods to have the best chance of continuing to work in future versions, they should be as limited as possible. (And, ideally, stats and only the most minimal script changes that are absolutely needed.)

Since with the way mods work, if a campaign balance mod includes an edited cam-whatever.js, that’s always the version that gets loaded. And if the base one diverges or has fixes, the balance mod will not pick them up (without someone manually going in and rebasing / updating the packaged files in the mod).

Whereas, if a campaign balance mod is just stats files, it’s almost guaranteed to work long into the future, even if we make various other tweaks / fixes to the core campaign scripting.

@past-due past-due merged commit 893a553 into Warzone2100:master Mar 21, 2024
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants