Save System Questions Involing Dialogue System, Playmaker, and Easy Save 3

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lcn_mc
Posts: 57
Joined: Wed Jun 29, 2022 1:56 pm

Save System Questions Involing Dialogue System, Playmaker, and Easy Save 3

Post by lcn_mc »

I've been experimenting with Easy Save 3 / Dialogue System / Playmaker in my project, and I've got some questions / run into some issues, and would like to get some input. In no particular order:
  • I've noticed that Easy Save 3's Autosave functionality doesn't seem to capture any data from the Dialogue System, such as variables, actor names, and so on. The Autosave function lets you select components beneath a game object to save (such as transform, active status, layer, etc.), but nothing I've picked beneath the Dialogue Manager game object lets ES3's autosave capture its data. Any thoughts?
  • Relatedly, is there any way to load the Dialogue Database through Playmaker without triggering a full 'load action,' as if I used the 'Load Game' or 'Apply Savegame Data' actions?
  • The 'Enabled Saver' component says that it 'Saves the enabled/disabled state of a component', but when I add this component to a game object, I'm only able to select other game objects from the 'Component To Watch' field, and when a game object is selected, it seems to default to that game object's transform component. Is this the intended functionality? I was hoping to be able to, for example, pick a game object that has multiple Playmaker FSM components, and have the Enabled Saver component watch one or more of them.
  • Is there any way to customize the Auto Save / Load component (from the Dialogue System's Save System), or are the options for that component a 'what you see is what you get' situation?
Thank you all for the help, as always.
User avatar
Tony Li
Posts: 22137
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System Questions Involing Dialogue System, Playmaker, and Easy Save 3

Post by Tony Li »

> I've noticed that Easy Save 3's Autosave functionality doesn't seem to capture any data from the Dialogue System, such as variables, actor names, and so on. The Autosave function lets you select components beneath a game object to save (such as transform, active status, layer, etc.), but nothing I've picked beneath the Dialogue Manager game object lets ES3's autosave capture its data. Any thoughts?

I'd need to dig into ES3's Autosave code. Does it have a hook to add more data (i.e., from the Dialogue System's save system), or can you save from the Dialogue System's save system to an ES3 key at the same time that you do an autosave?


> Relatedly, is there any way to load the Dialogue Database through Playmaker without triggering a full 'load action,' as if I used the 'Load Game' or 'Apply Savegame Data' actions?

Sorry, I don't follow. Do you want to do something similar to the Apply Savegame Data action? Or, if you don't want to do something as extensive as Apply Savegame Data, what do you want to do / not do?


> The 'Enabled Saver' component says that it 'Saves the enabled/disabled state of a component', but when I add this component to a game object, I'm only able to select other game objects from the 'Component To Watch' field, and when a game object is selected, it seems to default to that game object's transform component. Is this the intended functionality? I was hoping to be able to, for example, pick a game object that has multiple Playmaker FSM components, and have the Enabled Saver component watch one or more of them.

Drag the component's title in the inspector into the Enabled Saver's target field.


> Is there any way to customize the Auto Save / Load component (from the Dialogue System's Save System), or are the options for that component a 'what you see is what you get' situation?

You can duplicate the script, give your duplicate a new name, and change whatever behavior you want in the code.
lcn_mc
Posts: 57
Joined: Wed Jun 29, 2022 1:56 pm

Re: Save System Questions Involing Dialogue System, Playmaker, and Easy Save 3

Post by lcn_mc »

Tony,

Appreciate the quick reply as always.

1. I can only speak partially to what ES3's Auto Save system does, and it allows you to select various components on each game object for it to 'save' when you trigger an autosave action, but I don't know exactly what data it's saving. (For example, if I tell it to save a Playmaker FSM component on a game object, it's smart enough to save the currently active State.) Here's a link to ES3's official page about it, but it's a bit thin on data: https://docs.moodkie.com/easy-save-3/es ... hout-code/

2. To clarify my second question, I was asking about whether it's possible to load savegame data to the Dialogue Database only without doing a full Load Game action, through Playmaker actions. Per this note on the Playmaker Actions page (in the Save/Load section): "Save Game and Load Game are the same as Record & Apply Savegame Data with a Save System" it didn't seem possible, which is what prompted my question.

I ended up (seemingly) solving this an hour or two after I posted, by creating a custom Playmaker action that mostly just copies the code of the Dialogue System's 'Load Game' Playmaker action, but swapping some lines of code to have it trigger the ApplySavedGameData() function instead.

3. Ah, I just need to drag the component's title into that field vs. trying to select it? Got it, thanks.

4. Thanks for the suggestion regarding adjusting the existing Auto Save / Load component. I'll do some experiments with that this week.

No further questions for now, Tony, but let me know if there's any side experiments / things I can try related to ES3's Auto Save system and the Dialogue System.

Cheers!
User avatar
Tony Li
Posts: 22137
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System Questions Involing Dialogue System, Playmaker, and Easy Save 3

Post by Tony Li »

Hi,

It's a bit confusing, but the Dialogue System has two "save game" actions:

Pixel Crushers -> Record Saved Game Data: Saves all "saver" components, including the DialogueSystemSaver component which saves the Lua environment (e.g., variable values and quest states).

Dialogue System -> Record Savegame Data: Saves only the Lua environment.

Either is fine to use. They both store their result in a string that you can later restore using the corresponding Apply Saved Game Data action.

Part of the reason for this is historical. The Dialogue System originally only had Dialogue System -> Record Savegame Data. But many devs requested more save functionality, so the Pixel Crushers Save System was added. Some devs are only interested in the Lua environment, so they use Dialogue System -> Record Savegame Data. Other devs want the whole deal, so they use Pixel Crushers -> Record Saved Game Data.

The major difference between Easy Save and the Pixel Crushers Save System is that the focus of Easy Save is to save data values (e.g., the currently active State variable value), whereas the focus of the Pixel Crushers Save System is to save actual states and processes. For example, Easy Save will record and restore the variable values of a component, but it won't record and restore which processes and coroutines are running, since those are very specific to each type of component. Easy Save is easier to set up for components that don't need to restore processes, only variable values. Unfortunately, the ES3AutoSaveMgr doesn't have event hooks to allow the Pixel Crushers Save System to inject its own data. To do this, you'd need to directly modify ES3AutoSaveMgr.cs.

Instead, I recommend continuing what you're already doing, or use this process:

1. Assuming the player selects a "Quit To Desktop" button or something similar to exit the game, configure this to use Pixel Crushers -> Record Saved Game Data to record to a PlayMaker string.

2. Configure your ES3 auto save settings to save that PlayMaker string.

--

When resuming a saved game, use Pixel Crushers -> Apply Saved Game Data to apply the string to the Dialogue System. You should do this at a point at which you know ES3AutoSaveMgr has already restored its own data.
lcn_mc
Posts: 57
Joined: Wed Jun 29, 2022 1:56 pm

Re: Save System Questions Involing Dialogue System, Playmaker, and Easy Save 3

Post by lcn_mc »

That's useful context, Tony; thanks.

The steps you've outlined below (using the Record Saved Game Data action to capture a string, which ES3 then saves) is what I was using initially when I first started trying out the save/load actions in Playmaker/Dialogue System/ES3, but without using ES3's autosave/autoload functionality.

With the adjustments I mentioned in my earlier post (about making a custom Playmaker action that just applies the saved data to the Dialogue Database), I think my planned approach will be sufficient.

I'll also do some spelunking on the ES3 Feature Request forum to see if having Autosave hook into the Dialogue System/Pixel Crushers Save System is something others are asking for.

Thanks, as always.
User avatar
Tony Li
Posts: 22137
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System Questions Involing Dialogue System, Playmaker, and Easy Save 3

Post by Tony Li »

You might just make it a generalized request for ES3AutoSaveMgr to invoke C# events at the beginning and end of saving and loading. It needn't be Dialogue System-specific. I'm sure other users would appreciate having those event hooks, too.
Post Reply