Skip to content

Add Hardcore Mode with Save/Load Restrictions - #64

Open
chaserli wants to merge 8 commits into
CnCNet:mainfrom
chaserli:feature/nosave
Open

chaserli wants to merge 8 commits into
CnCNet:mainfrom
chaserli:feature/nosave

Conversation

@chaserli

@chaserli chaserli commented Mar 4, 2026 •

Copy link
Copy Markdown
Member

Description

Adds a Hardcore Mode for campaign missions.

When enabled, Hardcore Mode prevents the player from saving or loading the game during a mission, and changes the mission flow to better fit a no-save challenge.

Features

  • Disables Save, Load, and Delete Game during the mission.

  • Replaces the normal mission failure prompt with a Hardcore-specific Retry / Leave prompt.

  • Displays a Hardcore indicator on the loading screen.

    • Uses hardcorelogo.shp when available.
    • Falls back to the TXT_HARDCORE_MODE CSF string.
  • Updates the mission end dialog to use an appropriate exit option.

  • Forces campaign scenarios using Hardcore Mode to end the game normally instead of allowing them to continue through the regular save/load flow.

Configuration

Enable Hardcore Mode with:

[Settings]
DisableSaveLoad=true

in spawn.ini

Additional CSF strings can be provided for localization:

TXT_HARDCORE_MODE
TXT_HARDCORE_FAILURE
GUI:CantSave
GUI:CantLoad

@chaserli
chaserli marked this pull request as draft March 4, 2026 04:17
@github-actions

github-actions Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Coronia added a commit to Phobos-developers/Phobos that referenced this pull request Jul 25, 2026
ported from CnCNet/yrpp-spawner#64 since this is
more of a standalone function than a part of disabling save, and is less
relevant to Spawner

- A timer can be displayed to show how many time has passed since game
starts.
- The timer will be shown in the format of `TXT_GAMETIME hh:mm:ss`. For
localization add `TXT_GAMETIME` into your `.csf` file.
- This will show the ingame time by default. It can also be set to show
real time by [real time timers](#real-time-timers)
- `ShowGameTime.BoardOpacity` can be used to set the opacitiy of
background for game time display.
- Observer can't see this timer since they've already gotten one on the
top of sidebar.

In `RA2MD.INI`:
```ini
[Phobos]
ShowGameTime=false             ; boolean
ShowGameTime.BoardOpacity=40   ; integer
```

original by Trsdy
@chaserli
chaserli marked this pull request as ready for review August 3, 2026 02:49
@chaserli chaserli changed the title option : disable savegame Add Hardcore Mode with Save/Load Restrictions Sep 3, 2026
Comment thread src/Misc/NoSaveLoadMode.cpp Outdated
@SadPencil
SadPencil requested a review from Belonit September 3, 2026 14:08
@Belonit

Belonit commented Sep 5, 2026

Copy link
Copy Markdown
Member

I'm not sure that spawner should introduce such features. Perhaps this should be in Phobos?
@Metadorius Any thoughts?

@chaserli

chaserli commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

I'm not sure that spawner should introduce such features. Perhaps this should be in Phobos?

This is similar to the existing “Custom Mission” feature. It is originally designed around one game session launching one mission, then the mission ends and the session ends.

This also comes with the same constraints. For example, implementing it requires hard-patching certain addresses, which can break if the game proceeds to another mission. Putting the UI toggles in the vanilla launcher is both difficult, inappropriate, and unnecessary. RA2MD.ini is not the right place for this either, etc.

In Spawner, however, it fits naturally through spawn.ini, works seamlessly with the DTA client. The spawner skips the cumbersome procedures before starting the mission, which could avoid those shitty ass problems.

It also complements the " Custom Mission " feature a bit.

FYI original PR in Phobos Phobos-developers/Phobos#1402

@SadPencil

Copy link
Copy Markdown
Member

Can this PR be merged? Or what else @chaserli needs to do

@SadPencil

Copy link
Copy Markdown
Member

any updates on this PR? can it be merged?

@Belonit Belonit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made my own edits, and the original commits of chaserli were left as is. My changes are added on top of them in separate commits:

  • added the current main to the PR thread.
  • brought NoSaveLoadMode.cpp to a more readable form.
  • replaced own Fetch_CSF_Text with StringTable::TryFetchString with the same fallback texts.
  • added IsDisableSaveLoadEnabled() which checks both Spawner::Enabled and DisableSaveLoad. Mode hooks no longer access missing configuration when the spawner is disabled. The EndOfGame setting condition is also protected by the Enabled check.
  • replaced a patch that damaged the save function,
    explicit termination via Debug::FatalErrorAndExit with recording of the reason in the log. Intentional crash when trying to save saved. Moved mode patches from Spawner.Hook.cpp to NoSaveLoadMode.cpp.
  • disabled periodic autosaves with DisableSaveLoad=yes.
    Before this, the standard autosave could get into the save ban and end the game without user action.

@chaserli, I still have questions about ScenarioClass_ReadMapINI_SetEndOfGame, could you please explain:

  • Why should DisableSaveLoad force EndOfGame=true? According to ASM, this includes the campaign ending path: if CampaignIndex is non-zero, the game tries to play CampaignClass::FinalMovie, then calls the credits from CREDITSMD.TXT to show. This changes how the campaign plays out, although no saves are required for the ban itself.
  • Why force SkipScore=false by overriding the map setting? Is a mandatory results screen required in this mode?
  • For CustomMissionID the EndOfGame setting is already in Spawner::StartGame() after loading the script. Need to clarify
    Why install it additionally when reading a map and force the results screen to turn on. If the goal is to complete a standalone mission without an ending video or credits, the current path requires separate consideration.

Changes require in-game testing.

I'll try to test it today, if I don't have time, then within 3 days

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.

3 participants