6
\$\begingroup\$

In most games the whole world is small enough to fit into memory, however there are games where this is not the case, how is this archived, how can the game still run fluid even though the world is so big and maybe even dynamic? How does the world change in memory while the player moves?

Examples for this include the TES games (Skyrim, Oblivion, Morrowind), MMORPGs (World of Warcraft), Diablo, Titan Quest, Dwarf Fortress, Far Cry.

\$\endgroup\$
6
  • \$\begingroup\$ Note: This question was asked yesterday by a different person, but deleted after a short period after being pointed to a different, somewhat comparable, question. However I didn't agree that the question was the same and found it quite interresting so I decided to ask the question myself. \$\endgroup\$
    – API-Beast
    Sep 29, 2012 at 13:54
  • 1
    \$\begingroup\$ Exact duplicate: gamedev.stackexchange.com/questions/32879/…. \$\endgroup\$
    – jcora
    Sep 29, 2012 at 14:16
  • \$\begingroup\$ @Bane Actually no, Minecraft/voxel based worlds are a different kind of story. While the answers to this question could be applied to voxel worlds, the other way arround thats not possible. \$\endgroup\$
    – API-Beast
    Sep 29, 2012 at 14:20
  • 1
    \$\begingroup\$ The solution seems to be the same, but OK. (Also, I've seen more than 1 question that deals with this same topic, if I find them, I'll link them here.) \$\endgroup\$
    – jcora
    Sep 29, 2012 at 14:21

2 Answers 2

2
\$\begingroup\$

The way to achieve a seamless world as big as you could fit on the hard drive, or server's hard drive for that matter is more complex.

1.Yes, first you divide the world into tiny pieces you can load quickly.

2.Then, in run-time you divide the loading process into tiny parts that fit in a frame, so that each frame you only spend the limited x% resources you can afford on loading nearby areas while still rendering the world and perfoming the game logic.

2*. You can also use threads instead of dividing the loading process into chunks, however I found that they could be hard to control and dividing it into chunks offers more optimization.

3.Sometimes the world is randomized, in these cases you may want to save the world slowly back into the hard drive as it is being generated.

*Having the world load from the server hard drive may be unreasonable considering the world complexity and the bandwidth allotment and costs.

\$\endgroup\$
1
\$\begingroup\$

Basically the world gets devided into chunks, and get loaded and unloaded depending on the distance to the player (in the background). When the player enters a area that isn't loaded completly yet a loading screen is displayed.

In the case of single player games, such as the "The Elder Scrolls"-Series, the chunks are divided after distance from the player, things in near chunks are calculated in-detail, frequently, the more far away the chunks are the less frequent and the less detailed the calculations become to save processing power. The things in far away land might even only ever updated when the player approaches them, the player won't notice anyway.
Another thing is LOD (Level of Detail), each chunk of the landscape mesh is saved multiple times in different detail levels, for chunks far away only the lowest detail level is kept in memory, for chunks near the highest detail level is used.
For procedurally generated landscapes, like those found in the Diablo games, when loading a chunk it is checked if this chunk was already generated, if yes it is just loaded from the hard disk, if not a new chunk is generated which is then saved on disk.

In the case of MMORPGs, such as World of Warcraft, the whole world is calculated and saved on the servers... the invidual clients wouldn't be able to do so. If the server isn't powerful enough alone then the chunks are distributed between multiple servers. The distance can't be used here because the players are everywhere, all chunks need the complete power.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .