How to save and load environment in a survival type game?

Hello there,
I am working on a survival game and in this game the entire map is manually made and split into multiple 512x512 size chunks/terrains. Depending on the player position chunks are loaded and unloaded.
The problem I am facing is saving and loading the chunk environment. In the game the player is able to chop trees and also plant them back.
Considering that there’s no knowing where and how many trees there will be in the chunk I can’t use pool system and if I instantiate all the trees when I load up the chunk I could be calling thousands of instantiate calls, which would kill the performance.

How should I approach this, what could be the good solution for this? Thank you

This topic has been discussed many times over.

But for a simplicity, you can use random seed for the map generation and only save changes that happens in the world, during Gameplay.

Random seed? I don’t have a map generator. The entire terrain and all the objects like trees, rocks and grass and etc are placed by me. The only thing you can do is chop the placed trees and have an ability to place an additional tree, by planting it.

Nevermind, I just found a solution!! The Addressables. Using Addressables.loadAsync and Addressables.InstantiateAsync. I made a simple test where I created 5000 complex meshes and zero lag… Unbelievable

2 Likes