How to Build A Save System in Unity

preview_player
Показать описание
In this video we take a look at how to use the Binary Formatter to build a fast and flexible save system in Unity. We also take a look at how get around some of the limitations by using Serialization Surrogates.

Enjoyed this video? Be sure to SUBSCRIBE and share it!

Socials:
Рекомендации по теме
Комментарии
Автор



Your overall approach should be roughly the same with one of the other serialization methods, so hopefully there's still something useful you can grab from the video.

- Matt.

GameDevGuide
Автор

One of the best save system tutorial I've watched.
Straightforward and Concise.
Good job

jacklaw
Автор

For anybody having the error "Property or indexer 'SaveData.current' cannot be assigned to -- it is read only", this may offer a solution.

In your SaveData class you should currently have the code below:

private static SaveData _current;

public static SaveData current
{
get
{
if(_current == null)
{
_current = new SaveData();
}
return _current;
}
}

Below is an edited version of that, which allows this to have a value assigned to it, which is what we are doing when loading.

private static SaveData _current;

public static SaveData current
{
get
{
if(_current == null)
{
_current = new SaveData();
}
return _current;
}
set
{
if(value != null)
{
_current = value;
}
}
}

And also make sure that the SaveData class has [System.Serializable] above it.

This should hopefully fix the problem.

jensenbradley
Автор

Just dropping a comment to tell you the videos are amazing. I had never heard of the surrogates until I saw this video. I love that you don't hold your viewer's hand, and instead explain quickly and concisely what you're doing and how you go about it.

xenmckinzee
Автор

Oh boy! I'm embarrassed to admit I didn't watch the entire episode for I already have my own save system implemented. But it was pure gold what I missed. Back then I already liked but for anyone there reading this is the best saving system tutorial in unity.
Thanks for sharing!

serj_
Автор

Your tutorials are really straight forward and not those 50 minute videos, which explain useless stuff. Thank you so much for making these.

what-mjkw
Автор

This topic needs a revisit I think. I've spent the last 2 weeks trying to get this to work & have with varying degrees of success for how I wanted it Implemented. After doing my own research there's actually huge chunks of info in this that are skipped over & just not mentioned in order to get it to work/understand it's limitations. I get the idea behind getting viewers to do their own research & learning how to do it on their own, but I think this video is a step to far beyond that and needs to include a few more steps for it to be a tutorial people can actually follow along.

BenanaBoy
Автор

if anyone wants to go above and beyond, I suggest, during the saving process the system should take a snapshot of the current view of the gameplay and save it along with the file. That way, the player can have a screenshot of the state of the save in the menu.

kken
Автор

Just stopping by to say that your video is the only tutorial on saves that deals with objects in a scene and thus, the interesting parts of the whole thing. Nice work.

sealsharp
Автор

Hey there, I just wanted to say I love your funny, straight to the point videos. You deserve a lot more subscribers! Keep being awesome.

BlackDragonBE
Автор

Would love to see you do a dialog system!

IndeedJoe
Автор

Greatest Unity save load tutorial video I can find. Thanks!

jianingzhuang
Автор

Thank you for sharing your system.

I'm just starting out learning Unity and this is the first "system" I've implemented in the game I'm tinkering with. It took me a whole day to get your system working but I see now I've made the right decision in following your solution. Everything updates itself automatically !! Wow, I wasn't actually expecting that when I started, but its turned out fantastic. Thank you :)

kyleme
Автор

With this video i realize that in my game if you die you will never start on a saved level XD . Its hard to make a save system. But the video is awesome men ! You are great Thanks!

Glados
Автор

you and Jason Weimann along with some others have the best unity videos . I want to be able to come up with system like these .this video and the one with tab system helped me a lot

BRSDevlog
Автор

Awesome guides! Built my first save/load system in a similar fashion but this has some improvements my uses arguments to change obj and casting. Like the short conciseness and the speed up of code of your presenting style. Keep it up dude

alexfletcher
Автор

This is exactly the sort of more intermediate channel I was looking for.

ChristopherYabsley
Автор

you actually covered shit that would be an actual concern for a game that's not just a mindless smartphone game - you talk about saving/loading gameobjects and states regarding those game objects, and even go the extra mile of covering the concept of multiple save slots. Very useful.

thunderdraco
Автор

Love the tutorial, it seems like a great save system. Can you please upload the missing steps to really follow along what you do in the video, it's impossible to do so.

Marijenburg
Автор

dude! your tutorials are pretty useful and straightforward. Also, you always try to code in the standard way which makes it reliable. ;)
please create more!

codastudiode