Working on Save System

This is a dev diary from a student designer (Crane Benson) who was assigned to work on a save system for pots and mementos. It is a work in progress.

I’ve made some updates:

Issue: For whatever reason, the saving works when you quit and reload, but some parts do not work when you restart instead.

  • Instead of saving an array of pot positions and an array of memento positions, the save game now saves an array of instances of a PotSaveData struct for each pot in the scene, which contains:
    • The pot’s own transform
    • The transforms of all the mementos attached to that pot
    • The pot’s list of missing items, so when we reload, we can tell which quest items are no longer missing.

Here is the new blueprint for saving the pot save data:

And here is the new blueprint for loading the pot save data:

Crane Benson09 Jun 2025 11:57

The save system has had its bugs worked out, so we are successfully saving player position, pot positions, and memento positions. It is all contained in one function of the BP_SaveManager just called “Save.”

The SaveManager object has references to the pot manager and the current SaveGame object. It passes this SaveGame into the pot manager’s save pot positions function, which also saves the mementos. It also passes it into the player character’s save function, which has remained the same.

The SaveManager then loads at OnBeginPlay, running similar load functions in both the pot manager and player character.

We are not yet saving the data of which quests are complete. This data is stored within the pots as well as the quest items themselves, and it is populated in the pot’s OnBeginPlay event. The issue with saving the data is that we can’t be sure whether the pots’ or the SaveManager’s OnBeginPlay will run first, and if the SaveManager tries to tell the pots which items from MissingItems to keep and which to remove before MissingItems has even been populated at all, we will likely encounter errors. 

Some ways to potentially get around this:

  • Call the SaveManager’s load function immediately after the pots have been initialized
    • May have to move pot data’s initialization to an event/function call from the pot manager
  • Change the pot’s data population to a function/event in the pot manager that is called from the save manager in the load function before the pot’s data is loaded.
    • This function should most likely be called in the save manager’s OnBeginPlay before it branches off into Load and Create Save Game, since the pot data needs to be initialized before either case.
  • Somehow indicate in the storage in SaveGame which quest items belong to which pot, and populate the pots’ MissingItems fields with that data.
    • This could potentially be accomplished by creating a struct or object type that just contains one pot’s array of MissingItems, and then giving SaveGame an array of those objects (essentially creating an array containing various different-sized arrays)
    • In contrast to the other solutions, which rely on adding all a pot’s quest items to its MissingItems array and then removing them if they are not in SaveGame’s large collection of all missing items, this solution could allow you to only add the required items to MissingItems from the beginning.

This was a dev diary by student Crane Benson.

Leave a Reply

Your email address will not be published. Required fields are marked *