Introduction + Minor Request
Hello there, before fully going into this, I would like to advise everyone that doesn't know anything about this, not to post on this topic!
I don't mean this in an offensive way, I just want to avoid posts like "I want to know this too!", which tend to make topics like this unnecessarily big.
Reason + Short Explanation
This topic is meant for opinions on how to handle large "game worlds" (also knows as "game maps") and their impact on performance.
For this purpose I've made a poorly drawn example of a typical game world.
Game World Example (with sections named as "layers")
Game World System #1 (Layer Based Loading)
This system would be based on the current players position on the world.
The layers would have world borders, which would detect on what part of the world the player currently is
and unload* all other layers that are not next to the current layer.
*with "unload" I mean setting the layer invisible/opacity 0%.
Here are some scenarios that should make it clearer:
Player is on
Layer#1 = Load Layer #2 + Unload Layer #3
Player is on
Layer #3 = Load Layer #2 + Unload Layer#1
Game World System #2 (Layout Based Loading)
This system would separate each layer into its own layout.
That means when the player has reached the edge of one layout, it will have to change to the next layout.
Using this system also means that the game has to load a whole new layout and pass all the data
from the previous layout over to the newly loaded one (e.g. last enemy positions, player state and many more).
Here are some scenarios again:
Player is on the
right edge of the layout named Layer #2 = Go to the separated layout named Layer #3
Player is on the
left edge of the layout named Layer #2 = Go to the separated layout named Layer#1
Game World System #3 (Full One-Time Layout Loading)
This system would be the easiest to setup and basically have every layer loaded as a whole, inside one single layout.
This also means that the layout will have a giant size of 100.000 or more.
You could take this system as a lazy version of System #1 but without changing any visibility/opacity and only one layer.
Conclusion
Please note that my game is a multiplayer game, if that matters in any kind of way.
The game also uses HD sprites which could drastically increase layout loading times.
Which system would be the best performance wise and why?
Please share your opinion or suggest better systems below.