Civ 2 Gold - Reducing CPU Usage

deeves

Chieftain
Joined
Jul 8, 2016
Messages
11
I dug up my old MGE and ToT CDs recently and got addicted to playing Civ 2 yet again. Thanks to this forum, I got both games running on my Windows 8. The ToT patch project is an amazing piece of work.

One thing that bothered me is that I could not find a working fix for the CPU usage issue for MGE. Tim's patch crashes on me. The CPU throttle inject tool crashes when I try to load a game. So I decided to write my own patch using the same concepts.

Attached is the patch. This patch will apply on any variation of v1.3. So don't worry if you have the XP patch, AI fix, or the no-limits patch installed.

Here are some technical details for those interested. The members of this forum have discovered that the PeekMessage calls in the main game loop is constantly being hammered. To add a delay, MsgWaitForMultipleObjectsEx is needed. I added my own implementation of PeekMessage in civ2patch.dll to include the delay. Then I patch the civ2.exe to import the DLL and replace some calls to PeekMessage to use my version. In the archive, I include the source to my DLL as well.

This fix is more for my personal enjoyment, but I hope it helps out other people too :)
 

Attachments

  • civ2mge_cpu_fix_1.zip
    199.9 KB · Views: 239
Top Bottom