简体   繁体   中英

Precaching resources and load times

I've been doing some research on caching resources for a game environment. By analyzing various games both 2D and 3D, I've come up with some questions.

In 2D games, such as Link to the Past, we see seemless transition from overworld to dungeon, or from house to overworld etc. I would imagine this means that all the game's resources are precached. That's all fine for 2D games since their resources tend to be smaller, but what about 3D games?

Half-Life 2 and Assassin's Creed for example, both have a loading screen inbetween map transitions. I know HL2 uses a sound cache, where a 5 second clip of the start of music will play while the actual mp3 loads. But this doesn't answer questions about textures and models. Do these games precache these resources to speed up load times, or do they not to save memory?

Further, we see 3D games like Twilight Princess where there is again seemless transition. Is this implying that all resources are cached here as well? I can understand this a bit more for PC games, but on the Wii of all platforms?

Overall, what is the best option to use for game development in both 2D and 3D environments?

Loading screens are what happens when a game's resources are moved from being on disk to being in RAM, while something like Twilight Princess uses something akin to Lazy Loading, where parts of the world are dynamically loaded into the game (while unloading other parts of the world to keep RAM usage low). Resources aren't necessarily cached, so much as managed differently.

In the case of a 2d game like Link to the Past (or Super Mario), there ARE loading screens, but they're short enough and often hidden by Link entering a dungeon, or the level/amount of lives left message in Mario, or the animation of going through a door in Metroid. Also, and perhaps more accurately, cartridge based games are effectively solid state memory, and the memory access speed is equivalent to RAM.

As always, the best option depends on what you're making. Ideally, you want to prevent ANY loading screens, but that's usually hard/impossible, especially with a large 3d game with tons of assets. While some games are clearly divided into levels (Portal especially comes to mind here), an open world game wouldn't be any good if you had to sit through a loading screen every city block. 2d games are a bit easier, since you don't have to deal with complex model data, but many of them have some sort of loading screen, usually when you start the game. The more complex the game, the more likely you'll have to deal with some sort of loading screen.

For great examples of 'lazy loading' in games, check out (the 3d) Grand Theft Auto games, Minecraft (infinite worlds), and Ultima 7 (the massive gameworld was divided into regions which got loaded when you go close to them)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM