Civilization Ii Patch

Civilization II, or Sid Meier's Civilization II, is a turn-based strategy game, the sequel to Sid Meier's Civilization. Brian Reynolds was the lead designer. Download smurf village for computer. It was released in 1996 for the PC and later ported to the Sony PlayStation. It is also called Civ II for short. Civilization II is very much like the first Civilization, with some changes to the units and civilizations.

Hello!PreambleI know that more than 10 years have passed since the Mastermind's patch was presented to run the game on the 64-bit systems. Nevertheless, I want to present you yet another patch.I was playing Civilization 2 MGE many years on my windows 7 64-bit. And always confusing about input fields not reacting on keyboard strokes like Enter, TAB or Esc. It was little annoying to press 'B' to build city and after that move mouse to hunt OK button rather than just press Enter.

I remembered that sometime in the past everything worked fine. Suddenly I took debugger and dive deep in assembly code for a week. Finally I realized that problem was in Mastermind's patch. Yes it allows to run game on 64-bit but the normal key-processing for input fields was broken. And after a while I managed to make my own patch that works without any side effects.DescriptionThis is Civilization II 64-bit Editbox Patcher.It eliminates game and editor crashes on 64-bit systems when the game tries to display edit controls (input fields) for entering text (like city name, emperor name, world sizes etc.).Unlike the it will retain the full functionality of edit controls including the response to the Enter, TAB or Escape keys.So, the establishing city is now just 'B', 'Enter'.

And customizing world size is like '100', 'TAB', '100', 'Enter'. No more mouse clicking.Supported game versions are:. Civilization II Multiplayer Gold Edition. Civilization II: Test of TimeThe patcher can even detect if Mastermind's patch has already been applied and will replace it.Download and source codeTechnical details. Code: v17 = GetWindowLongA(hWnd, 0xA);nIndex = GetClassLongA(hWnd, GCLCBWNDEXTRA) - 8;lpPrevWndFunc = GetWindowLongA(hWnd, nIndex);The problem was in hard-coded 0xA which is offset for parameter in extra window memory. Here we are getting two parameters: v17 - pointer to some Style data, and lpPrevWndFunc - pointer to parent callback. The second one is acquired correctly using offset in nIndex.

But offset for the first one is hard-coded = 0xA. In 32-bit OS size of extra window memory for 'Edit' window class equals 6 bytes. So plus our two integer (4 bytes) parameters gives total: 6+4.2 = 14 bytes. Call for GetClassLongA(hWnd, GCLCBWNDEXTRA) returns us this total bytes of extra memory used. To get offset for lpPrevWndFunc you have to subtract 8 from total (14) (which is done correctly). And to get offset for v17 you have to subtract 4 from total (14) which gives you exactly 10 ( = 0xA in hexadecimal). And that works well until 64-bit comes on scene where size of extra window memory for 'Edit' window class equals 8 bytes.

So with our two additional integers total size equals 16. And with offset for lpPrevWndFunc being still calculated correctly (16-8) the offset for v17 must be 16 - 4 = 12 (0xC) and not 10 (0xA).The first simplest solution is to change this single byte from 0xA to 0xC and all will be working fine until. Well, for example you decide to copy this patched file back to 32-bit system (to play on vacation on old notebook with Windows 98 or XP x32). And this patched file will not work on 32-bit OS. So there is no backward compatibility.The correct way to patch is to achieve code something like this.

Code: nIndex = GetClassLongA(hWnd, GCLCBWNDEXTRA);v17 = GetWindowLongA(hWnd, nIndex - 4);lpPrevWndFunc = GetWindowLongA(hWnd, nIndex - 8);Here two first steps are swapped. Firstly we have to get total size of extra memory. And then we can calculate each offset correctly.And then comes sweet part of juggling assembly code to achieve desired in less opcodes changed. And you have to fit in fixed frame because changing size of EXE is unacceptable. After 6th iteration I managed to make patch changing only 10 bytes.Before.

The update will not execute.When I click the link and download the patch Windows doesn't want me to run it. I override that. Then a small window pops up with 'Civilization II 64-bit Editbox Patcher' at the top.There is a welcome message. At the bottom it says to click browse then select Civ2.exe or Civ2Map.exe and click patch. When I click browse what I see is:Civ2x64EditboxPatcherWhen I click that I get this message:No version info detected.Wrong file.

Too much patterns found.CAN NOT PATCH!What am I doing wrong? FoxAhead, thank you very much for your great work!Your 64-Bit patcher worked like charm for both my Civ 2 Gold Multiplayer and my Civ 2 ToT with Windows 10.As you showed, you have dived into the Civ 2 source code. May be you can give me a hint with the following problem concerning animated units in Civ 2 ToT: Some time ago, I converted some animated units from Civ 3 to Civ 2 ToT with Mercator´s sprite tool.

These units looked pretty well in Civ 2 ToT. You can find them there:The problem is, that the attack animations are only shown for the attacking unit. The defending unit stands only at its place until the death animation is started for the defending or the attacking unit.

It is annoying that the defending unit does nothing when beeing attacked. Best would be, if in a battle, both units (the attacking and the defending) could switch to the attack animations.But it would be still better in a battle, than doing nothing as defender, if the old 'battle animation' of Civ 2 Gold Multiplayer could be activated, that showed hits in a battle mutually at the attacking or the defending unit.Do you have any idea what to do?

FoxAhead, thank you very much for your great work!Your 64-Bit patcher worked like charm for both my Civ 2 Gold Multiplayer and my Civ 2 ToT with Windows 10.As you showed, you have dived into the Civ 2 source code. May be you can give me a hint with the following problem concerning animated units in Civ 2 ToT: Some time ago, I converted some animated units from Civ 3 to Civ 2 ToT with Mercator´s sprite tool. These units looked pretty well in Civ 2 ToT. You can find them there:The problem is, that the attack animations are only shown for the attacking unit.

Hivemc. The defending unit stands only at its place until the death animation is started for the defending or the attacking unit. It is annoying that the defending unit does nothing when beeing attacked. Best would be, if in a battle, both units (the attacking and the defending) could switch to the attack animations.But it would be still better in a battle, than doing nothing as defender, if the old 'battle animation' of Civ 2 Gold Multiplayer could be activated, that showed hits in a battle mutually at the attacking or the defending unit.Do you have any idea what to do?