预缓存资源和加载时间

发布于 2024-11-26 10:10:45 字数 422 浏览 2 评论 0原文

我一直在研究游戏环境的缓存资源。通过分析各种 2D 和 3D 游戏,我提出了一些问题。

在 2D 游戏中,例如《众神的三角力量》,我们看到从主世界到地牢、或从房屋到主世界等的无缝过渡。我想这意味着所有游戏资源都被预先缓存。对于 2D 游戏来说这还好,因为它们的资源往往较小,但是 3D 游戏呢?

例如,《半条命 2》和《刺客信条》在地图转换之间都有一个加载屏幕。我知道 HL2 使用声音缓存,在实际 mp3 加载时会播放音乐开头的 5 秒剪辑。但这并不能回答有关纹理和模型的问题。这些游戏会预先缓存这些资源以加快加载时间,还是不会节省内存?

此外,我们还看到《暮光公主》等 3D 游戏中再次出现了无缝过渡。这是否意味着所有资源也都缓存在这里?对于PC游戏我可以理解一点,但是在所有平台的Wii上呢?

总体而言,在 2D 和 3D 环境中进行游戏开发的最佳选择是什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半葬歌 2024-12-03 10:10:45

加载屏幕是当游戏的资源从磁盘上移动到 RAM 中时发生的情况,而像暮光公主这样的游戏使用类似于延迟加载的东西,其中世界的某些部分被动态加载到游戏中(同时卸载游戏的其他部分)世界以保持较低的 RAM 使用率)。资源不一定会被缓存,只是管理方式不同而已。

在像《链接到过去》(或《超级马里奥》)这样的 2D 游戏中,有加载屏幕,但它们足够短,并且通常被链接进入地牢或马里奥中留下的生命等级/数量信息所隐藏,或者《银河战士》中穿过一扇门的动画。此外,也许更准确地说,基于卡带的游戏实际上是固态存储器,并且存储器访问速度与 RAM 相当。

一如既往,最好的选择取决于你正在做什么。理想情况下,您希望阻止任何加载屏幕,但这通常很难/不可能,尤其是对于具有大量资源的大型 3D 游戏。虽然有些游戏被明确地划分为不同的级别(这里特别想到了《传送门》),但如果你必须在每个城市街区都经历一个加载屏幕,那么开放世界游戏就没有任何好处。 2D 游戏要容易一些,因为您不必处理复杂的模型数据,但其中许多游戏都有某种加载屏幕,通常是在您开始游戏时。游戏越复杂,您就越有可能需要处理某种加载屏幕。

有关游戏中“延迟加载”的绝佳示例,请查看(3D)侠盗猎车手游戏、Minecraft(无限世界)和 Ultima 7(大型游戏世界被划分为多个区域,当您靠近它们时就会加载)

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文