Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 MrMcKinle · Jun 13, 2013 at 10:32 PM · gamesaveloadneed

Save Game - What do I need?

I know this question is asked a lot. I've seen numerous posts asking how to make a Save Game function and they're always answered with "Its complicated (blah blah) no single answer (blah blah)."

What I'm asking is: what are the basic components (like Serialization, arrays, etc.) of a simple Save/Load feature?

That way, you can tell me WHAT I need and I can go learn it myself. So, please, don't answer with "It's complicated and it would take too long to explain" because I've heard it a thousand times.

Comment
Add comment · Show 1
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 robertbu · Jun 15, 2013 at 06:46 AM 0
Share

Look into:

Unity Serializer

PlayerPrefs

1 Reply

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

Answer by Slobdell · Jun 14, 2013 at 12:10 AM

Only you can answer that question. When you load the scene, what is it's state? When you save the game, what is it's state? Save the difference. You just have to save all possible things in the scene/game state that can be changed(level, health, object positions, time, etc. , so that you can bring your game from start state to current state when loading, or last save to now.

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 MrMcKinle · Jun 15, 2013 at 06:12 AM 0
Share

I think you misunderstood my question (though your answer did provide a little extra insight to what a save feature really does).

What are some ways of saving that information so it may be called upon later? That's why I asked about serialization because I've seen that word come up a few times and will be looking further into that once I clean up the bugs in my other scripts.

avatar image whydoidoit · Jun 15, 2013 at 07:22 AM 0
Share

What you need to serialize depends on your game. Some games just need the score and the level number/name, others need to reposition enemies and have them in the current state that they were when it was saved etc etc

You can save simple data to PlayerPrefs, a file using JSON/X$$anonymous$$L/Plain text with ease (level name, number). You can also store such information on a server if you have a way of creating one (ftp for server files, PHP perhaps for a database and an endless list of other choices).

Anything further than that requires you to create a structure of the information for saving. Unity Serializer offers one such way of creating that structure for you as it saves the data from just everything you flag as important to a byte[] or a string of JSON that can be stored in PlayerPrefs, a file or on a server.

The biggest complexity in serialization is recreating the links to assets in the game, which means that games that change the assets in use, or change the references to other game objects (like specifying the target that is being followed by an enemy etc) are much harder to do as Unity doesn't have a persistent identifier that can be used to find these things. Again, that's something the Unity Serializer does.

avatar image MrMcKinle · Jun 16, 2013 at 07:59 AM 0
Share

ok, so, basically, serialization. Got it. I'll look into that then. Thanks guys.

Also, my game isn't going to be that incredibly complex (I think) so creating the links to my data shouldn't be that much of a problem.

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.

Follow this Question

Answers Answers and Comments

17 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

Related Questions

How to store a boolean for each variable in a class 1 Answer

load button in main menu 1 Answer

Save/Load Game and buttons New Game/Load Game? 1 Answer

Save/Load/New 1 Answer

Problem Saving game progress 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