Compound Goals aren't saved
As of 1.6.0.0, Compound Goals aren't saved (look for Story.CompoundGoalTracker).
Quick explanation of what compound goals are:
- A
CompoundGoalis aStoryGoalthat will be triggered only after a precise list of other story goals are completed. - This list is known as preconditions
- When the
CompoundGoalis triggered, it is removed from theCompoundGoalTrackerlist of "available" compound goals, therefore it won't be triggered once again.
Therefore, each time you restart the server, your client has its list of compound goals full once again (it's filled by default and then little by little the goals are triggered and removed from the list), so they will be triggerede once again, which we don't want.
A quick fix for this issue would be to modify the current patch StoryGoal_Execute_Patch to do the following:
- check if the triggered goal class is an instance of
CompoundGoalin which case we want to notify the server - thus add a parameter to the
StoryEventSendto tell if it's a compound goal or not - Then save the list on server-side and do the client restitution during initial sync
Can probably set this to "easy"
If we save the list on the server and during initial sync do the client restitution. Why do we need to check if triggered goals are instances of CompundGoal? Is this part of the initial sync?
If we save the list on the server and during initial sync do the client restitution. Why do we need to check if triggered goals are instances of CompundGoal? Is this part of the initial sync?
Looked at the code once again and what we're actually missing is inside of StoryGoalInitialSyncProcessor.
Just as we're triggering this inside of SetGoalUnlocks :
StoryGoalManager.main.onGoalUnlockTracker.NotifyGoalComplete(...);
we should be adding the following line to SetCompletedStoryGoals :
StoryGoalManager.main.compoundGoalTracker.NotifyGoalComplete(StoryGoalManager.main.completedGoals);
But it might change with next subnautica version so we should wait for it to make the changes.
PS: I think that the current state of StoryGoalManager syncing is really bad and should be overhauled sooner or later. (for example, nothing about ItemGoalTracker in initialsync. I shall myself give it a look while reworking aurora and sunbeam sync.
Will be fixed by #1967