Skip to content

QtFRED Generalized Mission/Campaign Save - #7045

Merged
BMagnu merged 15 commits into
scp-fs2open:masterfrom
MjnMixael:qtfred_generalized_missionsave
Feb 15, 2026
Merged

QtFRED Generalized Mission/Campaign Save#7045
BMagnu merged 15 commits into
scp-fs2open:masterfrom
MjnMixael:qtfred_generalized_missionsave

Conversation

@MjnMixael

@MjnMixael MjnMixael commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

This moves FRED's missionsave.cpp into a common location so that QtFRED can take advantage of the well-tested code. With this in place we can be sure that QtFRED's mission output will be identical to FRED's.

I also took this opportunity to move campaign file saving into its own file and generalize how it works. It requires a little bit more overhead to call but should be UI/application agnostic now. The QtFRED campaign save call sites will be updated once this or #7030 is merged which should trigger a conflict in either PR.

There are a handful of other TODOs here which will be handled in follow-ups or as QtFRED work continues.

One minor upgrade is that campaign names now properly save XSTRs and campaign descriptions are now unlimited length. (The already parsed at a greater length than was allowed to save so this change makes round-tripping a campaign file through the editor work as expected.

EDIT: I should add that I tested round-tripping multiple missions and campaign files (including complex files from mods like BP, JAD, and BtA).

Fixes #7028

@MjnMixael MjnMixael added qtfred A feature or issue related to qtFred. fred A feature or issue related to the FReespace EDitor (FRED) labels Sep 19, 2025
@github-project-automation github-project-automation Bot moved this to Work In Progress (PRs) in qtFRED2 Sep 19, 2025

@TheForce172 TheForce172 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.

missionsave is missing the Guardian Threshold code added in #6989 and potentially other QT Fred only additions. I'm afraid you need to go through QTFred missonsave and see whether there were any more QTFred only additions/changes.

@github-project-automation github-project-automation Bot moved this from Work In Progress (PRs) to In Review (PRs) in qtFRED2 Sep 19, 2025
@MjnMixael

MjnMixael commented Sep 19, 2025

Copy link
Copy Markdown
Contributor Author

missionsave is missing the Guardian Threshold code added in #6989 and potentially other QT Fred only additions. I'm afraid you need to go through QTFred missonsave and see whether there were any more QTFred only additions/changes.

I'm going to assume guardian threshold is the only thing missing as missionsave changes should always have been done to both files for exactly this reason. Given that up until now FRED was the source of truth, I feel safe assuming the guardian threshold code added in the QtFRED PR is the only outlier.

EDIT: Yes, a quick browse of QtFRED's history shows the primary PR authors are myself and Goober who religiously update both files. Checking the other outlying authors as far back as 2023 also show they updated both places. So I'm very comfortable assuming #6989 is the only change needed to port back in.

@MjnMixael
MjnMixael force-pushed the qtfred_generalized_missionsave branch 2 times, most recently from 659cf5e to 9dff8a6 Compare September 21, 2025 21:41

@JohnAFernandez JohnAFernandez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should watch for bugs in mission and campaign save for a while, but otherwise, this is a sensible change. Thanks for taking a look too, theforce

@MjnMixael

MjnMixael commented Sep 25, 2025

Copy link
Copy Markdown
Contributor Author

Agreed. I'm pretty confident in the mission save part of this one as there were almost no changes to that code outside of Clang modernization. Campaign saving had more changes but the community stopped relying on that editor years ago so ymmv.

That said for merging this close to an RC stage I could go either way. On one hand merging means less maintenance with conflicts as people work with the existing mission save files. On the other it could introduce bugs to a critical piece of code at a possibly bad time. I leave it up to SCP to decide.

@MjnMixael
MjnMixael force-pushed the qtfred_generalized_missionsave branch from 647809f to e368514 Compare September 26, 2025 14:27
@MjnMixael

Copy link
Copy Markdown
Contributor Author

Conflicts resolved. This now patches QtFRED's campaign editor to use the new campaign save method.

@MjnMixael
MjnMixael force-pushed the qtfred_generalized_missionsave branch 2 times, most recently from 21fe3b2 to eda8ead Compare October 13, 2025 13:21
@MjnMixael
MjnMixael force-pushed the qtfred_generalized_missionsave branch from eda8ead to 7e2bc94 Compare October 17, 2025 14:24
@MjnMixael
MjnMixael force-pushed the qtfred_generalized_missionsave branch from 7e2bc94 to d3295af Compare October 27, 2025 19:48
@MjnMixael
MjnMixael force-pushed the qtfred_generalized_missionsave branch from d3295af to bcd8430 Compare December 17, 2025 19:32
@wookieejedi

Copy link
Copy Markdown
Member

Just noting, once stable is out, it would be great to have this PR as a priority merge to allow QT FRED updates to continue

@wookieejedi wookieejedi added this to the Release 26.0 milestone Jan 4, 2026
@MjnMixael
MjnMixael force-pushed the qtfred_generalized_missionsave branch from bcd8430 to c02b1f1 Compare January 30, 2026 18:50
@wookieejedi

Copy link
Copy Markdown
Member

As noted on Discord, will plan to merge this over the weekend

@wookieejedi

Copy link
Copy Markdown
Member

Update, some other FSO devs wanted some extra time to look, though nevertheless it remains a priority

@wookieejedi

Copy link
Copy Markdown
Member

Yeah I had seen internal conversations saying that some folks would look over the PR, though my assumptions got the best of me as there was no actual request to postpone the merging. Alas I too hastily commented on the PR in an effort to maintain current and transparent communication. Apologies for unduly muddling the waters on this one! The plan is to indeed merge this over the weekend 🙂

@wookieejedi

Copy link
Copy Markdown
Member

Will merge this in a few hours

@BMagnu
BMagnu merged commit 37df4ba into scp-fs2open:master Feb 15, 2026
20 checks passed
@github-project-automation github-project-automation Bot moved this from In Review (PRs) to Done in qtFRED2 Feb 15, 2026
@MjnMixael
MjnMixael deleted the qtfred_generalized_missionsave branch February 15, 2026 15:20
laanwj pushed a commit to laanwj/fs2open.github.com that referenced this pull request Mar 8, 2026
* Generalize mission save from original FRED

* make qtfred use the new generalized missionsave

* split campaign save into a sister class

* allow unlimited campaign description length to be saved

* have the campaign editor pass the links to save properly

* cleanup

* future todo

* fixes

* more fixes

* cleanup vars

* clang

* add missing guardian threshold and fix var name

* more clang

* conflict resolution error

* update qtfred to use the new campaign save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fred A feature or issue related to the FReespace EDitor (FRED) qtfred A feature or issue related to qtFred.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

QtFRED Mission/Campaign save are outdated

5 participants