fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

F3 lab is reset after going to options menu

Open jg18 opened this issue 3 years ago • 6 comments

This was a known issue introduced by PR #3512 .

Now when you go from the F3 lab to the options menu and then return to the lab, the lab's state is reset, including dialogs, background, etc.

The reason it worked before was that the LabManager was leaking its renderer/dialogs, so those dialogs shouldn't have even been used.

Fixing this is non-trivial, since LabManager instances were not designed to be retained between visits to the F3 lab.

jg18 avatar Jun 22 '21 04:06 jg18

I would be fine with closing this as won't-fix.

Goober5000 avatar Jun 23 '21 13:06 Goober5000

The only way to solve this cleanly would be by introducing a method to serialize/deserialize the lab state, which I think is unnecessary at this stage but could be a decent project for someone new to the code.

The-E avatar Jun 23 '21 13:06 The-E

Agreed that fixing this is not worth the current team's time but could be a good first issue. Thus I suggest adding the "good first issue" label and leaving it open (or "backlog" if we have that category).

jg18 avatar Jun 24 '21 02:06 jg18

I'm skeptical that this qualifies as a good first issue. I don't imagine saving and restoring the lab's state, and figuring out the game's state transitions, would be simple.

Goober5000 avatar Jun 24 '21 03:06 Goober5000

@Goober5000 when I tried to fix this, the issue wasn't related to game state transitions; the existing ones work fine AFAICT. It was in figuring out how to correctly preserve the lab's state.

Admittedly not super easy, but hopefully easier now that the leaks are plugged 🤞 and way easier than, e.g., fixing Issue #3127. That required understanding how Ship_obj_list and Missile_obj_list are managed, not to mention realizing that the root cause lay there.

jg18 avatar Jun 27 '21 19:06 jg18

Exactly, the lab save/restore code doesn't need to care about FSO's state management - All it needs to do is respond to the lab opening and closing.

The-E avatar Jun 28 '21 06:06 The-E

How relevant is this after the recent Lab upgrade?

MjnMixael avatar Jan 20 '23 21:01 MjnMixael