• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by shuriken7 · Jan 01, 2018 at 11:24 AM · assetbundleload sceneload levelsave game

Create an autosave/checkpoint feature for my game?

Hi,

I'm currently working on an action/adventure style game. I wanted to implement an autosave/checkpoint feature that will be triggered at the start of each scene. T$$anonymous$$s will then allow the player to load into the latest level/area they were in from the main menu.

My problem is I'm at a total loss how to do t$$anonymous$$s, the tutorials I've looked at so far have been that different from eachother I don't know what I should be doing. I'm still kind of a beginner with coding, so any help or advice is much appreciated!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Lysander · Jan 01, 2018 at 11:50 AM

People tend to make t$$anonymous$$ngs too complicated. The question you have to ask yourself is, what's the absolute minimum amount of data that you can save and still be able to reconstruct the savegame effectively? In some games, like Prince of Persia on the Nintendo, that can be as simple as a 9 digit numerical "passcode". What's the data that's needed there? Stage number, checkpoint number wit$$anonymous$$n that stage, total time left, and a flag that says w$$anonymous$$ch health boosts you've gotten. That's it.

The breadth and depth of your save functionality depends on the needs of your game- most games aren't completely linear like the original Prince of Persia game, and so most can't be saved into a 9 digit numerical passcode. But it's usually not that much harder. Figure out what all you need, and make a data container type for all of that (literally just call it GameDataContainer or somet$$anonymous$$ng). When it's time to save, fill that container with all of the data it needs, serialize it into binary, JSON, XML, or whatever you like, then write it to the disk. None of your scene objects need to be "saved" per-se, you only need the data that's required to reconstruct those objects at a later time.

I have no idea what the specific needs of your game are, so I can't really be more specific. There are tons of threads / guides around for how to serialize / write to disk / load from disk / deserialize- it really isn't much more complicated than that, just make a choice between binary (1s and 0s), JSON (strings, useful for storing on web servers), or XML (human-readable), and then run with it.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image shuriken7 · Jan 01, 2018 at 12:46 PM 0
Share
avatar image Lysander shuriken7 · Jan 01, 2018 at 01:12 PM 0
Share
avatar image shuriken7 Lysander · Jan 01, 2018 at 02:12 PM 0
Share

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

75 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UnitySerializer not loading levels 0 Answers

How to Save and Load a Level by Serialization 3 Answers

password-based checkpoints 0 Answers

How to import the object from server to unity 2 Answers

Loading scene from assetbundle (url) 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges