Data Management
Generic Type for Saving Data
The games required a save data system for storing the players progress throughout the world, such as the last position the player, the combat status of the main bosses encountered, as well as the abilities and skills the player has unlocked.
To facilitate the saving of all types of data to a reliable and consistent data directory, a generic type save data singleton was created to ensure all classes that required save data could access the save and load data functions globally (Refactoring.Guru, n.d.).
Extension of Save Data to other classes
The SaveManager responsible for processing the saving and loading of required data types throughout the games was used extensively by other classes. For example, the Player Character had abilities unlockable throughout the game upon defeating the bosses and enabling the player to progress in the main game.
Therefore, the unlocking of abilities was tied to the CombatTracker class for which, on the event occurring when the associated enemy boss was defeated, it called the save data to save not only the defeated stats of the enemy, but to also flag as unlocked in the player save data the relevant ability to be unlocked. It furthermore enabled and flagged a Respawn Point as the last players save position and the saved the players' progress.
This example highlights the flexible and on-demand usage the SaveManager script provided in one frame of gameplay.
Figure One: Use of the save manager save function across the project.
Scriptable Objects
A new technique that was learnt in the process of ensuring that there was existing persistent and immutable data was the use of Scriptable Objects. These enabled for the values that represent the players and enemy AI starting values on game load, such as health, damage and stamina etc, to be stored within the application. Due to their immutable nature, it ensures that the values are also retrievable and unchanging on game load (Unity Technologies, n.d.).
Furthermore, due to the flexible nature of Scriptable Objects, multiple versions can be generated allowing for quick prototyping during the design process when testing out the enemy balancing within the games combat.
References
Unity Technologies (n.d.) ScriptableObject. Available at: https://docs.unity3d.com/6000.1/Documentation/Manual/class-ScriptableObject.html (Accessed: 25 May 2025).
Refactoring.Guru (n.d.) Singleton. Available at: https://refactoring.guru/design-patterns/singleton (Accessed: 25 May 2025).