• 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 eriger123 · May 08, 2013 at 08:25 AM · unity serializer

Unity Serializer saving to file

Hello, I've been using Unity Seralizer. And I'm using it to make a minecraft-like save feature.

However the terrain doesn't exist until the actual game is started.

So whenever I try and load a save after closing the actual game. It just generates a new world. Instead of using the one that's already generated. So how would I go about loading and saving from a file?

For example here are some images.

This is the data that's created after the play button is pressed.

Before the play button is pressed. There aren't any objects. I hope this helps :)

alt text

Comment
Add comment · Show 10
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 · May 08, 2013 at 08:26 AM 1
Share

Tell me a bit more about your sequence, I'm not quite getting it.

avatar image eriger123 · May 08, 2013 at 08:54 AM 0
Share

I would like to save the save data to a file. So I can load it afterwards from a button. The terrain isn't actually in the game until the game is started. (Hence why I want to save it to a file) So that's why I'm having trouble saving the terrain. For example, if I use the pausemenu and I go and save my world. And load it. It works perfectly fine (until I restart the game) After restarting the game and loading the save file. It seems that the game generated another world. The terrain doesn't actually have any children until the game is started.

avatar image whydoidoit · May 08, 2013 at 09:04 AM 0
Share

Well UnitySerializer does not specifically save Terrain data - it does save meshes etc. It would be possible to add it

avatar image eriger123 · May 08, 2013 at 09:07 AM 0
Share

Well, technically it's just creating meshes at runtime. It's not an actual terrain object.

avatar image Fattie · May 08, 2013 at 09:10 AM 0
Share

Yes, it's very annoying that the word for Unity's terrain system is "terrain"! I've had great success saving ground meshes (and all sorts of meshes) using U/S.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by laurentlavigne · May 11, 2015 at 08:21 AM

You need to save the seed that your noise is using, not each block. Save also changes made by users but that's separate from generation. When you load, first restore the seed then as your generator scans through each block, test if the block was change and fork your generation to restoring that block.

Comment
Add comment · 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

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

15 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

Related Questions

Is it possible to use DataContractJsonSerializer? 2 Answers

Unity serializer and 2D Sprites 0 Answers

[Unity Serializer] Prefab objects don't keep references of other objects 2 Answers

Unity Serializer V2.xx animations and loading 1 Answer

Unity Serializer plugin - uploading with http 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