• 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 Klusimo · Jun 30, 2020 at 02:49 PM · loadsave datasave file

How to save data of thousands upon thousands of different tiles and objects?

Hello, so i am not a newbie but not a pro either (Anglish veri gud tu). Also this is my first ask post so dont be mad if i posted it in wrong place.

I am planning to make a survival adventure sandbox game in top-down view (think Don't Starve) and i want to know the solution before starting.

So basically i want to generate a random world using several different perlin noises on a tile map. That is not hard but the thing is I want to save and load said worlds. I want these worlds containing thousands upon thousands of tiles and objects to be saved and then loaded again in the future.

Now i understand saving/loading to some extent. I know how to save/load inventory, position etc...

But saving thousand different tile and objects each with unique data and then load their data AND position back... Well i am lost.

Can you help me?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Cassos · Jul 04, 2020 at 11:41 AM

that's why seeds exist

Comment
Add comment · Show 1 · 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 Klusimo · Jul 04, 2020 at 04:27 PM 0
Share

Alright, maybe it does, but how and is it able to save player-made objects etc.?

You have to be more clear you just can´t answer with this.

avatar image
0

Answer by UnityedWeStand · Jul 04, 2020 at 08:02 PM

So basically i want to generate a random world using several different perlin noises on a tile map. That is not hard but the thing is I want to save and load said worlds.


What @Cassos is trying to say is that, because your maps are procedurally generated, you don't have to save the information for every single tile and object in the map. You just have to save the parameters used to generate the map, namely the seed value used to generate the Perlin noise. Then when you want to load the map, you just plug in the saved seed value(s) into the map generator and you will have the exact same map.
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 Klusimo · Jul 05, 2020 at 06:12 AM 0
Share

I see, but what about player-placed object and changed tiles (say there is default grass tile and player change it to path)?

avatar image UnityedWeStand Klusimo · Jul 05, 2020 at 07:07 AM 0
Share

You can store only the tiles or objects that the player changed along with the seed values. You still save the state of the map without having to save the information for every tile.

avatar image Klusimo UnityedWeStand · Jul 06, 2020 at 07:20 AM 0
Share

Oh okey, thanks for clarification. I have one more question, when i have 2+ identical player-made objects, whose only difference are coordinates, how do I save them automatically and then associate correct files to correct objects?

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

228 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 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 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 avatar image avatar image avatar image

Related Questions

Saving data through FileStream DataInfo? Think i'm misunderstanding something. 1 Answer

I have a class containing my settings/player stats. How would I serialize the whole class at once in order to save load? 2 Answers

Save scene 1 Answer

About photon engine and saving data? 1 Answer

Save and Load 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges