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

Remove confusion about SP and MP saves of hybrid campaigns having the same names #8871

Open
Discontinuum opened this issue May 14, 2024 · 5 comments
Labels
Enhancement Issues that are requests for new features or changes to existing ones. MP Issues with multiplayer support or bundled multiplayer content.

Comments

@Discontinuum
Copy link
Contributor

Discontinuum commented May 14, 2024

Describe the desired feature

When a campaign is hybrid (both sp/mp), its saves mix up in the saves folder: they have the same names. If you, let's say, do the campaign with your friend(s) in the MP mode and then do it solo, start-of-scenario saves of an SP run will erase MP ones (as they are named the same way). Because of this right now having a hybdrid campaign is extremely uncomfortable, so I preferred in my hybdrid campaign to make actually two campaigns: one SP only and one MP only, that differ only by their ids and abbreviation, so saves aren't erasing each other anymore.

Maybe we can add some save name distinguisher (like "MP" suffix for mp saves) for hybrid campaigns by default

@Discontinuum Discontinuum added the Enhancement Issues that are requests for new features or changes to existing ones. label May 14, 2024
@knyghtmare knyghtmare added the MP Issues with multiplayer support or bundled multiplayer content. label May 14, 2024
@knyghtmare
Copy link
Member

I wonder if this is viable as a solution:

[campaign]
    #ifdef MULTIPLAYER
    id=Campaign_ID_MP
    abbrev="Campaign_MP"
    #else
    id=Campaign_ID_SP
    abbrev="Campaign"
    #endif
    type=hybrid
[/campaign]

@soliton-
Copy link
Member

That's pretty much what they said they did as a workaround. That should not be necessary. Also we should move away from more reliance on the preprocessor.

@Discontinuum
Copy link
Contributor Author

Discontinuum commented May 15, 2024

I made a bit different way

#define MY_CAMPAIGN TYPE ABBR
[campaign]
id=my_campaign_{TYPE}
type={TYPE}
abbrev={ABBR}
...
[/campaign]
#enddef
{MY_CAMPAIGN sp "ABBR"}
{MY_CAMPAIGN mp "ABBR MP"}

the workaround by knyghtmare seems much less reliable to me. It feels suspicious that a campaign will define itself differently depending on the preprocessor's state.

Maybe we can add an optional parameter abbrev_mp to the [campaign] tag that will apply if it's a hybrid campaign run in MP

@soliton-
Copy link
Member

I think adding a fixed string like the "MP" you mentioned after the abbreviation is enough. If someone wants an entirely different abbreviation then they can make multiple campaigns like you showed. I don't think abbrev_mp is desirable.

@Discontinuum
Copy link
Contributor Author

I thought at first hardcoding the "MP" prefix isn't desirable but prolly it makes sense. As you say, people may define two distinct non-hybrid campaigns if they want to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Issues that are requests for new features or changes to existing ones. MP Issues with multiplayer support or bundled multiplayer content.
Projects
None yet
Development

No branches or pull requests

3 participants