很多小伙伴单机时喜欢各种奇葩地图,特别是资源丰富不差钱的图,最终结果满屏幕的飞兵坦克,导致游戏画面1帧一帧的播放,还有约战联机的小盆友,约定半小时不开战,攒够了100个天启、光棱来一波,结果画面 1帧一帧 的播放,针对兵种超多是引起画面卡顿,这里给出两个解决方案,大家可以试一下。
方案1
使用防卡代码 VideoBackBuffer=no,
ra2md.ini中
[Video]
VideoBackBuffer=no
ScreenWidth=1366
ScreenHeight=768
StretchMovies=no
关于这个代码含义,在游戏的word文档里就有描述,可自行理解,我的理解是分辨率高于640 画面更新可能出现异常,也就是卡顿,使用此参数可改善。(某大佬也解释过原理同方案2)
方案2.
从game.exe gamemd.exe运行程序入手,打上补丁,命令与征服游戏使用几个临时图形绘制。其中一些分配在视频RAM中,一些分配在系统RAM中。当游戏想要画东西时,数据必须从VRAM复制到系统RAM,在现代的电脑里这是一项蛋疼的操作,而且地图上的物体(单位、碎片等)越多,效果就越明显。该补丁改变了游戏,使其不再在VRAM中分配数据,因此解决了这个问题。
这些补丁解决问题的方法与尤里号复仇扩展dll“ares”的解决方法相同,我将此解决方案应用于TS和RA2。
Background
The dimetric Command & Conquer games use several temporary graphics to draw to. Some of them are allocated in Video RAM, some of them are allocated in system RAM. When the game wants to draw something, the data has to be copied from VRAM to system RAM, which is an expensive operation and it gets more obvious the more objects (units, debris, …) are on the map. The patch changes the game to not allocate surfaces in VRAM in the first place, so this cannot become an issue.
The following bytes need to be changed. This is not optimized. If you understand the raw assembler instructions, you can optimize it by putting a jmp there.
Game | Offset | Original | Patched |
Tiberian Sun | 0008AC2F | 3C 01 75 0C | 90 90 90 90 |
Red Alert 2 | 000AA51F | 3C 01 75 0C | 90 90 90 90 |
Yuri’s Revenge | 000BA61F | 3C 01 75 0A | 90 90 90 90 |
补丁工具:
红警2原版1.006的game.exe,已打好补丁:
红警2尤里的复仇1.001的gamemd.exe,已打好补丁 :