Building a save system for level objects in Unity Pt1 - Checkpoints
As the player moves along in a game and interacts with different objects in the world, the aim is to reflect his actions in the game by changing the state of objects permanently. For example, a door is opened or some first experience guidance does not need to be displayed anymore.
Objectives
- Save and restore states of objects in the scene according to the progress of the player.
- These objects may be are interconnected. (A door opens when pulling a level/ defeating an enemy)
- Let level design decide and modify which objects need to have their state changed when.
Used programming concepts
- JSON serialization https://unity3d.com/learn/tutorials/topics/scripting/loading-game-data-json
Checkpoints
Step 1 - Checkpoints
- This checkpoint needs an ID to be identifiable for saving and restoring.
- This checkpoint also needs something that can be fired off when the checkpoint was reached.
Step 2 - Reaching Checkpoints
Step 3 - CheckpointController
- all the checkpoints in the scene and
- who to talk to make the state persistent on the disk.
Great success!
Recommended resources
Game Engines
Unreal Engine 5 Best Practices
Amazon · Book
Written by multi-award-winning Unreal generalist Tyson J. Butler-Boschma, Founder and Creative Director of Toybox Games Studios, this book addresses common challenges you face when advancing your expertise in lighting, environment design, and cinematic storytelling.
GameDev.net may earn a commission if you purchase through these links. This helps fund the site at no extra cost to you.
Related Tutorials
Balancing Game Development and Creative Direction in Indie Production
A practical look at how indie developers can balance creative direction with hands-on game development. This article co…
My Unreal Engine Development Process: From Core Idea to Playable Build
A practical overview of my Unreal Engine development process, covering how I move from a core game idea to a playable b…
Introducing LaneGraph: The Ultimate Road Network Solution for Unity
Discover the power of LaneGraph, a lightweight and flexible lane-based navigation system for Unity. LaneGraph makes it…
Retargeting Mixamo Characters with Root Motion In Unreal Engine 5.4.
I have always found Retargeting Mixamo Characters To have Root Motion is a serious lengthy Tast, Recently I stumbled up…
How To Make A SIMPLE Main Menu In Unity
In this tutorial for unity, i go over how to make a simple main menu for unity, it's an unlisted video because i do not…
Guide to Gameplay Balance
A perspective on competitive gameplay balance, from a background of "shooter" sandbox design.
Discussion