Dismissed leader / Game freezes after mission completion

Discussion of our XCOM 2 mods
Post Reply
adamsan
Posts: 3
Joined: Tue Feb 23, 2016 8:09 am

Dismissed leader / Game freezes after mission completion

Post by adamsan »

Hello, LWS!

I foolishly choose a pretty standard sniper build Sharpshooter as my first Leader and immediately regretted it given the range of the Leader's powers and the natural trailing distance a sniper operates compared to the rest of the team.

I decided it best to dismiss the soldier in question and train up my Specialist as a leader instead.

On the very next mission (happens to be the grounded UFO), at mission completion the game hangs. The 'end of mission' music chops at first but the screen goes dark other than the cursor, then the music drops, and then Windows gives the 'game is not responding' dialogue. I never got to the Skyranger cabin at all. It hangs immediately after hitting the continue button from the end of mission scoreboard.

I noticed this other bug which seemed similar:
https://www.reddit.com/r/Xcom/comments/ ... mod_crash/

And thought I'd post my situation here. I have beaten the game before (no mods) and have never had stability/crash problems other than the final mission in which I had something like 18 enemies on the screen at once and some corpses wouldn't stop ragdolling.

I believe from what I've read that the Leader mod may be to blame here. Any ideas on saving my game thusfar?

Thanks,
A
User avatar
johnnylump
Site Admin
Posts: 1261
Joined: Wed Nov 11, 2015 4:12 am

Re: Dismissed leader / Game freezes after mission completion

Post by johnnylump »

Thanks for the report. We *really* need a savegame from before the crash so we can see what is going on. Do you have one?
adamsan
Posts: 3
Joined: Tue Feb 23, 2016 8:09 am

Re: Dismissed leader / Game freezes after mission completion

Post by adamsan »

I do, but the files aretoo large to attach. Please contact me via the e-mail address tied to my account or provide me with yours at your earliest convenience.

Also, do you want the save right at the moment of the crash or when the game was stable before I dismissed my leader? I have both.

- A
adamsan
Posts: 3
Joined: Tue Feb 23, 2016 8:09 am

Re: Dismissed leader / Game freezes after mission completion

Post by adamsan »

Update: went back to the prior Savegame that still had the original leader. He was in training for the level two leader stuff at the time.

Last time, I interrupted his training and then dismissed him while in the armory. Then the game crashes no matter what at the end of the following mission.

This time, I interrupted his training but did not dismiss him. The same UFO mission came up next, and I completed it without event. No crashing.

Dismissing a leader (from my very specific and single instance, other than my prior link to another person) seems to be related to the problem.

Again, I'm still in possession stable and *right* before crash savegame files. Just tell me how/where to send them, thanks.

- A
Amineri

Re: Dismissed leader / Game freezes after mission completion

Post by Amineri »

Thank you for the savefiles. It's been an interesting ride trying to figure out what is going on here.

What seems to be the case is that the LWOfficer gamestate component (attached to the Unit component) isn't getting marked for removal when its parent gamestate is. In theory this is okay, since the officer component is only ever accessed from the unit state, but it ends up setting off the following chain of events :

1) Unit gets dismissed. Unit State bRemoved is set true, but the LWOfficer component bRemoved remains false.
2) At some point, Unit State gets obliterated from History
3) During History validation (when switching from tactical to Avenger map), an assertion is thrown because there is a component with a reference to a parent that doesn't exist. The assertion triggers program exit.

In theory deleted units should be hanging around with just their bRemoved flag set, so the past states can be accessed, but it gets destroyed. When you force a load of the tactical save without the Officer mod, the LWOfficer component can't be deserialized, so it gets discarded from History, thus preventing the assertion from triggering and halting execution. I was able to get the same result without removing the mod by adding the following to Game.ini

Code: Select all

+TransientTacticalClassNames=XComGameState_Unit_LWOfficer
This forces a purge of all LWOfficer components from History on the end of tactical missions, which happens before the validation code that triggers the assertion. Unfortunately, this isn't a viable "fix" because it also wipes all officer-related data -- so all officers would lose their ranks, etc.

However, searching the History at the point of the tactical save fails to find the officer component that is still hanging around, so I can't really patch up saves that have gotten to that point. The native accessor in XComGameStateHistory apparently can't find a component gamestate whose parent has been obliterated. However, if I search History just after Dismissing a unit, I can find the Officer component, and can verify that the component bRemoved flag is not set, but that its owning Unit parent's bRemoved flag is set. So, looks like I'll have to garbage collect my own components, which is kind of a pain...

Anyhow, thanks very much for the savefiles, they definitely helped me figure out what's going on :)
Post Reply