You know that in RPG worlds, the outside world is the overworld. There would be areas connected together like routes/paths, or roads that players can traverse back and forth. If all the areas are connected together, the overworld can get quite big. Big enough that the hardware the game is running on won't be able to load all the areas entirely at once. The most obvious way would be to split the overworld up into chunks and let the game load the chunk the player is currently in.
While I was thinking about the chunks, I noticed that when games are loading the overworld, each chunk it loaded was connected seamlessly together. It's as if the overworld is just too large to fit on the display screen. I wanted to know how to achieve the effect of connecting chunks of areas together seamlessly.
I'm just asking if I'm correct:
- Possibly load all chunks nearby and move the overworld by the player's position as offsets. Once the player enters a new chunk, load the unloaded chunks that weren't there previously, keep the old chunk the player had just left from, and unload the chunks that are too far away from the player.
- To let players transition from one chunk to the other, the game needs to check to see if the player is walking out of the boundaries, or the player is walking inside the traversable areas that connects the two chunks together.
- Anything outside of any chunk must render something that tells the player it's truly not walkable.
Each chunk is to be loaded for each area the player is in. One chunk per area. Does this mean that chunks have a constant size? What should happen if there's an area split into 2 chunks or more? What should I do about that?
When doing the loading/unloading chunks, what sort of system should I use to manage them? I don't think managing an array of chunks is easy, but it's the only thing I can think up that is closest to what I can use. Do you guys use a queue, or a linked list to help the management?
What about chunks with areas like tunnels, caves, or rooms?
I think that's all of the questions I can ask. I just don't know if that's enough for me to solve this.