Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 malkere · Jan 25, 2017 at 03:44 AM · serializationbinaryformatterfilestream

Can we merge multiple save files for easier management?

Say my player has traveled across and altered one thousand terrains, I'd rather not make one thousand files to save all those changes. I'm curious if someone can point me towards how to merge those multiple files into one larger file allowing me to find and load/save only the sections I need. Or would such merged file require me to rewrite the entire file every save? I can imagine loading the one big file at the start, but then how do I safely save incremental changes without rewriting the whole thing?

For another way to look at it, say I am saving heightmap, splatmap, tree, grass, building, and object data per terrain all separately so that I can alter one without having to rewrite the whole file. Is there a way to merge these into a single file but still be able to only rewrite certain sections? Note that none of these arrays/lists have fixed sizes; the heightmap resolution can be changed in the settings, etc.

Or is having tons of files per world really not something I should be concerned about? Seems messy...

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

Answer by JedBeryll · Jan 25, 2017 at 05:49 AM

Interesting question, i guess it's better to have multiple small files instead of 1 big so you don't have to bother for lookups and overwriting just the part you need in a single file. You could make save folders for every single save so lets say you have a "Saves" folder and inside you have "Save1", "Save2" folders... so your files are still separated. I have seen this in many big games so if it worked for them it should work for you too.

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 malkere · Jan 25, 2017 at 06:08 AM 0
Share

That's where I am right now. A master folder for each player, then subfolders for each world, and files for all the data, but it quickly gets into the hundreds once the player starts exploring the world. It certainly works, heck unity uses tens of thousands of files, I just would much prefer a file per world ins$$anonymous$$d of hundreds if possible... Am looking at a database as a viable option right now... I don't understand how the one big data.dat approach is viable though some games seem to do that...

avatar image JedBeryll · Jan 25, 2017 at 06:38 AM 0
Share

As much as it hurts to have so many files, I don't see a better, more manageable and faster way to do it.

avatar image JedBeryll · Jan 25, 2017 at 06:41 AM 0
Share

What you can do is create a class that handles all the saving and loading ins$$anonymous$$d of searching for the right file and data everywhere. This should make at as clean as possible.

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

65 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

Related Questions

"IOException: Sharing violation on path" when Loading Data to Overwrite Save 1 Answer

EndOfStreamException : Failed to read past end of stream 1 Answer

Bool array to binaryformatter method 1 Answer

Save multiple scriptableObjects in just one binary file 2 Answers

What's a fast serializer that works cross platform that can be used for saving/loading custom levels? 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