Saving and Loading Game Data in Unity3D and C#
Imagine if you played a game that didn’t have the ability to save and load data between game sessions? Would it even be worth playing if every time you sat down to play, you had to start from the beginning again? I know I wouldn’t want to put in hours and hours of work every time, only to lose it when I shutdown the game. I would find that a horrible experience and I probably wouldn’t play the game ever again because it’s a huge waste of time.
My name is Dave and I’ve developed a powerful course that teaches you the fundemental concepts of locally saving and loading your game data between game sessions.
When I researched the topic for this course, I discovered most websites were overcomplicating the process and explaining things in a way that only advanced game developers would understand. I know when I was still learning how to program, I felt overwhelmed and discouraged if things seemed out of my league. And that is why I developed this powerful yet easy-to-understand course which covers saving and loading game data using techniques such as PlayerPrefs, Text File, Binary Serialization, XML Serialization, and SQLite. Don’t be scared of these unfamiliar words! They aren’t as complicated as they sound, trust me.
I designed this course to give you the most value in the shortest amount of time. There is no need to sit through hours and hours of boring videos or hours and hours of scrolling websites, looking for the right way to save your data. I’ve jam packed this course to give you a solid foundation to start implementing this in your own game – immediately.
Each lesson is structured in a simple, no nonsense way that breaks everything down in easy to understand steps. Firstly, I take you through the key points associated with the specific technique, which includes suitable situations to use that technique. Then I explain and demonstrate step-by-step exactly how the technique is coded, and provide you with a nice simple example at the end. Lastly, I developed a short test to let you know whether you’ve grasped the basic concepts of the lesson… I’ve also attached every script created through this course in each lesson, just in case you get stuck and need a downloadable example.
When you finish this course, you’ll have an understanding of 5 powerful techniques to save and load game data using Unity3D and C#… I only scratch the surface on persisting game data in this course, and you’ll need to do more learning if you want to work for Activision on their next big game… so don’t think you’re going to walk away from this course at the level of a professional game programmer, but in saying that, it does give you a good solid foundation. I’ve specifically left out error handling from this course because the key to learning a complex topics is to break it down into easy to understand steps. Error handling for these techniques is entirely up to you and will require you to put in time and effort to research.
If you’re not passionate about game programming and putting in the effort to learn something new, then please do not take my course. I only want people who are highly motivated and want to advance their knowledge in game programming.
Are you ready to learn 5 powerful techniques to save and load your game data?
If you answered “YES!” then I look forward to seeing you soon!
This is a brief introduction and overview of the course content. By the end of this video, you will have a brief overview of what to and not to expect from this course. If you're watching this video after signing up to the course then I wish you good luck for the rest and have fun! I would also love to hear of your very own implementations using the methods outlined throughout this course.
In this lesson we cover one of the most basic way to persist data between game sessions. PlayerPrefs is a Unity3D specific data handling method that is extremely simple to use. By the end of this video, you will know a few key points to using PlayerPrefs when handling your games' data, as well as how to do the actual saving and loading.
Test your knowledge of the PlayerPrefs Example video tutorial.
In this lesson we look at a customizable way of storing your game data using text files. We cover the basics of string manipulation and creating your own format for saving and loading data in a text file. By the end of this lesson you will have a basic data handling method to save and load your games data between game sessions.
A small test on what you learned in the Textfile lesson.
In this lesson we cover our first serialization topic, binary serialization. Binary serialization is a very common way to persist your data as it provides a decent amount of security. By the end of this lesson you will understand how to save and load your custom data using binary serialization. The content in the video is designed to be type specific as opposed to the XML tutorial where I introduce generics. As the video is type specific, I have included the same method implemented with generics as a downloadable resource for you. I recommend you watch the XML serialization tutorial prior to downloading the generic implementation, so you understand what is happening.
A small test on what you learned in the Binary Serialization tutorial.
In this lesson we look at one of the most favoured ways of persisting data. To implement XML Serialization is very similar to the Binary Serialization tutorial, however, I introduce you to generics. Generics allow us to determine, which type of object gets parsed in and returned from the methods. Generics are a flexible way of writing your code and allow for easy code re-use, as well as improving performance. At the end of this lesson, you will have a basic understanding of the most used XML formats, as well as a generic script to save and load your custom data types.
This basic test contains questions about the XML Serialization tutorial.
In this lesson we cover a more advanced method of persisting your data between game sessions. SQLite is used for manipulating data in databases, and we look at storing and retrieving data using it. This implementation covers SQL queries such as, Update, Insert and Select. More SQL queries are covered in this video, however, those are the main ones. By the end of this lesson you will have a clear and concise method of dealing with data in databases utilizing SQLite. You will also learn how to obtain your own DLL's to use for the project.
A basic test on what you learned from the SQLite tutorial.