Save game thoughts for Unity




There's a lot of ways Unity could be improved for savegames. here's some of my thoughts on that. 

I think the big one is to save a scene (and reload it) during playback. It's clear the editor has this power in some fashion already, and it would be hugely useful for many types of games. 

But I know that's no small task. So, besides that, there's a ton that Unity could include, like: 

More data types for PlayerPrefs. The abllity to save arrays, for example. See EasySave on the asset store for a good third party solution for this.

Unique GameObject IDs that are static. When you save data associated with an object, you need to uniquely identify the object. GetInstanceID is a unique id for each object, but they can change every time you load the scene. I came up with a simple hack for powerups, but there should be a better way, especially since Unity's own way of saving data (PlayerPrefs) requires unique keys. 

An automated way to load and save a script's current properities. Right now, you need to write your own saver and loader for every single variable in your script. Add a variable? Add some code to saver. And don't forget your loader.  This is error-prone, and this should be automated. It's clear that the property editor has automated access to all the script's variables, so why not give us a way to bundle it up and save it and load it? It wouldn't have to work for everything (I understand the problems with saving transforms and whatnot) but just letting us save all integers, floats, and strings would save a ton. 

And if not that, at least give us a way to walk through them ourselves so we could roll our own autmated saver that doesn't require me hand-adding variables to save every time I change my script. There would still be the need for special-casing things, but this would be a great head start.

Summary

I know there's no way for Untiy Technologies to make the perfect SaveMyGame() feature that would work for every game out there, but really Unity needs more than what it has at the moment. It's almost non-existant.  In other game development environments, I'd have the tools to say "these variables are going to be saved." and then that's the end of it. 

Currently, for any game this isn't dead simple, SaveGame is one of the first things I need to think about -- and think hard about -- before I do any fundimental development.  And that's typically not what Unity's about. Unity is about focusing on your game, and not your engine. 





Feedback - 10 responses

Displayed newest to oldest. Leave a comment.
thesis writing service wrote:   
It is so much pleasurable blog. Because it is always refreshing to read.
sam wrote:   
This is error-prone, and this should be automated. It's unqualified that the conception Testking 70-293 application has automatic admittance to all the Testking 1Y0-A16 playscript's variables, so why not cerebrate us a way to packet it up and foreclose it and headache it
acting classes los angeles wrote:   
You're right to say that its easier said than done to make these changes, but you have a totally valid point. The save game feature is essential to any moderately complicated game, and Unity's current function isn't comprehensive enough. While it wouldn't be simple for them to make changes, they really should do it anyway, or they are going to lose users.
womens dresses wrote:   
This post is exactly what I've been trying to find: excellent, informative and extremely useful
yacht charter wrote:   
it is an unique approach. I am really impressed! Maybe you should update it somehow.
proactive wrote:   
You sure have great save game ideas for unity. But we all know that these things are easier said than done. Game development requires intense planning but Unity can surely use some of those tips.

Stacie D. Clark
Essay writing wrote:   
I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.
Buy Assignment | Coursework | Dissertation Service UK | university essay writing service | Statistics Help
Wife Status wrote:   
I was just in lookup of this info for some time. subsequent to half-dozen hrs of constant Googleing, at final I obtained it as portion of your internet site. I question what's the deficiency of yahoo and google system that tend not to rank this form of educational internet online websites in best with the list.
Calgary cleaning wrote:   
I will try to follow your tips. I am sure that I will have excellent results.
Marty Plumbo wrote:   
That "no arrays in playerprefs" thing has always irked me. I can understand not wanting to muck with playerprefs lest they break something all these years, but leaving arrays out is practically sadistic.

Leave a comment

Name:
Website:
Comment:

Email:
Captcha:
Choose the hand-held radio image from below:

           

           

 

This site is mostly about

Video Game Design

User Interface Design

Creative & fun stuff

 

Your Host

I'm Hanford Lemoore. My parking skills are unparalleled.

I make things. From consumer electronics, to video games, to theme park attractions. Perhaps I can make things for you! Check out my portfolio.

When I'm not making things for other people, I'm usually experimenting.

 

Contact

Follow me on Twitter.

Message me on Facebook.

Email me using my contact form.

 

RSS 2.0

 

maquettegame.com

tikiroom.com

junkyardclubhouse.com

monolux.com

 

   


Copyright 2012 Hanford Lemoore | Blog | About | Portfolio | Contact
Powered by Olark