In this tutorial we’ll set up save game menus and save points in the world.
Fighting enemies, getting loot and experience – we need to save our progress, or it was all for nought!
Save Game Menus #
Navigate to UI > Save Game Settings, we’ll take a look at the save games and set up the save menus.
Save Game Settings #
These settings handle the number of available save slots (and auto save slots) as well as where the save games are saved.
We’ll stick with the default setup:
- Save Slots
Set to 3.
Save File Settings #
- Save File Type
Select Persistent Data Path.
Save Data Settings #
These settings define which game data will be part of the save game.
We’ll stick with the default setup, which will save most of the data.
File Settings #
Define the name of save files and content included in the file’s information (e.g. game time, area).
We’ll adjust the File Info to include some information about the saved game, the rest will be kept at the default setup.
File Info #
- Name
Set to: <filename> (<time>)
<playername>, Lvl <playerlevel>
<area>
Pause Settings #
You can optionally pause the game while displaying save game menus, we’ll do that.
- Pause Game
Enable this setting. - Freeze Pause
Enable this setting.
This’ll set the time scale to 0, halting all animations, movement, etc.
Save Game Menu #
These settings handle the menu for saving the game.
- UI Box
Select Blue Center Fit. - Add Cancel Button
Select Last.
This’ll add a cancel button as the last input of the menu. - Text (Message Content)
Set to: Select save file
Save Question Dialogue #
We’ll also show a dialogue to confirm saving the game.
- Show Question
Enable this setting. - UI Box
Select Blue Center Fit. - Text (Message Content)
Set to: Save to <filename>? - Use Choice
Enable this setting. - Text (Yes Button)
Set to: Save - Text (No Button)
Set to: Cancel
Load Game Menu #
These settings handle the menu for loading a saved game.
- UI Box
Select Blue Center Fit. - Add Cancel Button
Select Last. - Text (Message Content)
Set to: Select file to load
Load Question Dialogue #
We’ll also show a dialogue to confirm loading the game.
- Show Question
Enable this setting. - UI Box
Select Blue Center Fit. - Text (Message Content)
Set to: Load <filename>? - Use Choice
Enable this setting. - Text (Yes Button)
Set to: Load - Text (No Button)
Set to: Cancel
Save Point Settings #
We’ll use a save point to select saving or loading the game – these settings handle the save point menu’s setup.
- Show Choice
Enable this setting. - UI Box
Select Blue Center Fit.
The default Save Button and Load Button setup is already what we need, but we’ll add a cancel button.
Cancel Button #
- Add Cancel Button
Select Last.
And that’s it for the editor setup – don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.
Save Points #
We’ll now add save points to the World scene (Assets/Scenes/).
There’s already a prefab available we’ll use, we just need to add a Save Point component to it.
Save Point Prefab #
The SavePoint prefab is located in Assets/Tutorial Assets/Prefabs/ – open the prefab and add a Save Point component to it.
Yes, it’s a cute fox statue.
Save Point Component #
The default setup of the save point component is already all we need.
- Save Point Type
Select Save Point.
The save point is also set up to start on interaction.
Adding Save Points #
We’ll add one to the town, e.g. place it near the bridge.
Add another one at the bridge connecting the forest and the swamp.
And another one at the outpost’s entrance.
And a last one at the entrance to the dungeon.
That should be enough – feel free to add more if you want.
Testing #
Hit play, run to a save point and interact with it.
You can now save and load the game!
The start menu now also has the Continue button available after saving the game.
Next, we’ll start setting up menu screens!