- Home /
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?
Answer by Cassos · Jul 04, 2020 at 11:41 AM
that's why seeds exist
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.
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.
I see, but what about player-placed object and changed tiles (say there is default grass tile and player change it to path)?
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.
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
![](https://koobas.hobune.stream/wayback/20220613002127im_/https://answers.unity.com/themes/thub/images/avi.jpg)