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
1
Question by xKroniK13x · Aug 19, 2012 at 04:21 AM · serverserializationupload

Upload Save (Unity Serializer) to Server

Hey guys! I was curious if anyone knows how to upload a save from Unity Serializer to a server? If not, could you at least inform me of how to manage the saves? I can probably code my own upload script but I don't even know where this saves them at! Any help would be wonderful! Thanks - Corey

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 Fattie · Nov 27, 2012 at 09:41 AM 1
Share

NOTE

for the sake of anyone seeing this question in the future.

There is a famous - in fact free - package "Unity Serializer"

http://whydoidoit.com/unityserializer/

(Again surprisingly this is completely FREE - the favourite price of Scotsmen everywhere.)

UnitySerializer is very widely used. Amazingly, it now includes incredibly simple direct saving to a file on the internet. Essentially, you can take things from your game, and with literally one line of code save/get them to the cloud.

If your task is literally "saving the game" or if you have to save anything else, whatsoever, to the cloud or to a server script - essentially, you have to be using UnitySerializer.

So hopefully this helps future readers. Cheers.

1 Reply

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

Answer by whydoidoit · Aug 19, 2012 at 06:56 AM

The Saves are made to PlayerPrefs by default. If you want to upload to a server you use a different technique and directly call LeverlSerializer.SerializeLevel which returns you a string you can save anywhere (e.g. A server). You reload that data using UnitySerializer.LoadSavedLevel().

Comment
Add comment · Show 36 · 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 whydoidoit · Nov 19, 2012 at 05:21 PM 1
Share

If you use the latest version you can do LevelSerializer.SaveObjectTree(yourObject) which will give you a byte[] (much neater than the previous method) You can save that array to a file. When you load it back call LevelSerializer.LoadObjectTree(thatData)

avatar image whydoidoit · Nov 19, 2012 at 05:22 PM 1
Share

Or now you can also save it to and from JSON with JSONLevelSerializer.SaveObjectTree(yourObject) - but JSON is big and slower.

However it is readable... Just.

avatar image whydoidoit · Nov 19, 2012 at 05:34 PM 1
Share

Well JSON makes more sense really. At least if you open the file you can understand something about it.

SaveObjectTree - that will save everything even if they don't have StoreInformation scripts attached so long as the root object doesn't have StoreInformation or PrefabIdentifier - if it does it presumes that the objects are configured and so only saves the ones that are marked.

If you want to override that default behaviour you can call EmptyObjectIdentifier.FlagAll(rootObject) and non-saved children will be stored in addition to flagged ones. Basically StoreInformation lets you turn off particular scripts from being saved - none of this sounds like a problem in your case.

avatar image whydoidoit · Nov 19, 2012 at 05:49 PM 1
Share

Yeah - I mean the basic save game stuff is fine - gives you multiple games etc - but a lot of people, me included, want to save individual things. The only problem is if those things refer to things outside of the same "Save" stream. It will only be able to find them if they already exist in the scene/project. It's very powerful though - there;s the whole OnlyInRange thing where it stores objects out of range in a file on the disk and holds a tiny structure in memory so it knows when to load them back in again (when you get close).

avatar image whydoidoit · Nov 20, 2012 at 02:57 AM 1
Share

Done. Added FTP/HTTP upload and WWW download from either for both JSON and binary + Files.

v2.1 on the website.

Show more comments

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

10 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

Related Questions

uploading file on server and keep getting an error 1 Answer

BinaryWriter or Serialization in mobile? 1 Answer

Limit reached when serializating XML 0 Answers

Unity networking tutorial? 6 Answers

Como fazer download de arquivos enquanto o jogo funciona 0 Answers


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