So here’s what I’m trying to do:
I’m building a large 2d world based off of a height map that’s eventually converted to tile values. Basically a giant 2d array.
The world will be too large to keep entirely in memory, and I want the player to be able to seamlessly walk from one end to the other.
The first issue then is how do I store the data on disk and load it, and how do I take what’s in memory (as it is more than I can/should draw at one time) and only display what’s around the player.
My current tests involve the latter case, and I’m not loading anything from disk. I have the 2d array in memory. I have a defined “chunk” size, which is the amount of content I intend on instantiating at one time. When the player leaves the current “chunk”, I instantiate the new tiles around the player character.
The problem is that this results in a huge pause in the action, and I’m not sure if I’m taking the right approach using Unity’s instantiation and GameObjects.
Has anyone else dealt with this or has some clue about the direction I should be heading?