Working MAF fix for WinXP 32bit!!

MusX

Prince
Joined
Apr 17, 2006
Messages
403
first of all, this thread is only the findings taken from I Fixed The Maf Error... Here Is How!! thread posted by Slyflyer (there is also fix for MS Vista).
all credits goes there!

this method is only for WinXP Pro and it won't work for WinXP Home

so let's go :D

1. edit your game exe file (civ4warlords.exe), if you play mods that contain any new exe's you might need to edit them too. don't forget to make backups!
Slyflyer said:
- First download the explorer from http://www.ntcore.com/exsuite.php
- Next make a copy of Civ4Warlords.exe. Than start "CFF Explorer" and open the orginal Civ4Warlords.exe file.
- Now go to NT Header/File Header and click File Header. There you will find a button labeld "click here". Click it. And select the checkbox "App can handle> 2gb adressest "
- Save the modified EXE, overwrite the orginal one.

2. edit your boot.ini so your WinXP can handle >2gb.
how to safe edit boot.ini?
Spoiler :
click on the links to see images illustrative each action
simkodavid said:
Right-click on "My Computer" and choose "Properties" from the context menu. The System Properties dialog box will open click the Advanced tab.
In the section "Startup and Recovery" click the button "Settings", as shown below
View attachment 153766
In the SystemStartup area, click Edit.
View attachment 153767
Boot.ini file in opens in Notepad
View attachment 153768

There below is my boot.ini file. The pivotal thing in it is the /3GB parameter at the end of OS line!
DON'T COPY AND PASTE WHOLE CODE cause your system may not boot next time :nuke:
Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /3GB
To fix MAF you must play on WinXP which has this parameter.
For your safety you can add second WinXP with this parameter and leave old XP config unchanged. simkodavid has done a fine post about it:
simkodavid said:
"Please be aware that the 3GB switch will only improve stability on systems with 2 or more GB of RAM, to safely add the 3GB switch we recommend adding a second instance of the OS in the boot.ini, and add the /3GB switch to that second version.

----- default boot.ini without 3GB Switch -----

This is what a default boot.ini file will look like. (This may differ from system to system.)

Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Pro"

----- updated boot.ini with 3GB Switch -----

This is what the updated version should look like. Notice the /3GB that has been added to the second instance of the OS line.

Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Pro"
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Pro with /3GB" /3GB

When your system reboots you will be given the option to choose either the standard Windows XP version or the 3GB switch enabled Windows XP version.

3. reboot your computer. there should be no more MAFs

don't know if my virtual memory configuration has any influence MAFs, anyway I will write them together with my ram specification:
2gb physical memory
4096-4096mb virtual memory
where to change virtual memory?
Spoiler :
My computer -> properties -> advanced -> performance -> settings -> advanced -> virtual memory


and don't forget to reboot you computer before reporting problem, also you might read Slyflyer's topic for more info.
hope you'll get it and enjoy giant maps :D

update:
- this fix is not working for WinXP Home Edition, it's for WinXP Pro
- some users notice there are another command (/userva) needed to fix MAF, it's useless for me but maybe you'll need it
 
I don't know of any mods using a new EXE....

In ViSa we make a custom shortcut, but its the same old bug laden Firaxis EXE :(

And great info....too bad Civ is unstable for me doing this and I tried numerous times, so YMMV ;)
 
you can edit boot.ini before windows run, use your windows cd-rom for this. what is your physical and virtual memory?
 
win xp pro sp2 32bit? really can't figered out where is the problem with your OS :confused:
 
This doesn't work for everybody and even when Civ does go past the 2GB limit it was crashing on me in other ways....

In the end, you can't fix a hard coded problem in the Firaxis EXE....well at least people outside Firaxis can't release it to the public even though numerous modders here have found the exact problem (which Firaxis denies there is even an MAF problem).
 
i haven't got any crash since i'm use this fix... all working fine... except my foobar music player which can't play music while playing huge maps :p
 
Thanks for this information on circumventing the MAF problem.

Just like with TAfirehawk, it didn't work for me though. Directly after restarting Windows with the new boot.ini file, I noticed that something was wrong with the resolution on my desktop. After some time, I found out that my video card drivers hadn't been loaded. Of course, that would prevent you from playing Civ4.

However, after reading through some Microsoft Knowledge Base articles, I found out that that is a normal problem with the /3GB switch in the Boot.ini. Apparently, the Video Driver notices that you have a big chunk of Physical Memory (2 GB's in my case) and wants to get a nice continuous block of it for itself. However, then Windows splits the memory in an unexpected spot (1 GB for the kernel and 3GB's for programs instead of 2GB's for both) and something goes wrong and the video driver isn't loaded.

The solution is to give a slightly larger section of the memory to the kernel and a slightly smaller section to programs and a new switch is used for that, the /Userva=xxxx switch. You need to have updated Windows XP to at least service pack 1 to use this switch.

An example would be to add /Userva=2900 directly after the /3GB switch which would allocate 1.1GB to the kernel and 2.9GB to programs.

The example Boot.ini file from the first post in this thread would then look like this:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /3GB /Userva=2900

Which value works is not exactly clear. I tried the 2900 that was used in an example in the articles that I had read and it worked. Later I refined that value to 3008 and it still works (3008MB's is one block of 64MB less than 3072MB's=3GB).
One of the articles talks about reducing the value of 3072 with multiples of 64MB until it works, but they use the 2900 in an example which isn't a multiple of 64, so it probably rounds it to a multiple of 64. Just try 2900 and if it works you can try higher values and otherwise you can try lower values.

Of course, you also still need to change the civilization.exe or warlords.exe file as explained in the first post of this thread.

Note that you need to know what you're doing when you start making changes to the boot.ini file. It's always a good idea to first create a system restore point in case something goes wrong.

Below are links to the three articles that I read that explain everything in more detail:
http://www.gehrytechnologies.com/catia/catia/catia_windows_large_memory.htm
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q319043
http://support.microsoft.com/kb/316739/EN-US/
 
great post. one friend also told me about userva but i fixed MAF without this command
 
i tried /userva=2900 and 2800. windows still wouldn't start (and, the video driver seems likely... the screen went black after the initial windows start-up screen). /userva=2500 did work, though. windows would start, and (along with the other changes outlined in this thread), the MAF errors seem to have gone away. hooray!
 
great post. one friend also told me about userva but i fixed MAF without this command

Thanks. Your adaptation of Slyflyers methods of creating more memory are great too. They allowed me to play Civ4 on huge maps with mods. A small change with the userva switch was needed, but I had never thought about these changes of the memory allocation by windows if you guys hadn't started these posts. I'm happy to see that my post here at least helped one person with similar problems with the /3GB switch.

i tried /userva=2900 and 2800. windows still wouldn't start (and, the video driver seems likely... the screen went black after the initial windows start-up screen). /userva=2500 did work, though. windows would start, and (along with the other changes outlined in this thread), the MAF errors seem to have gone away. hooray!

It seems we indeed had the same problem. Each computer however works a bit different, has different hardware and different software. Still, I hadn't expected that a value of 2500 was needed, the articles that I quoted seem to suggest that a higher value should be possible. But if it works, it works and that's fine.

You could try values between 2500 and 2800 to optimise the amount of memory Civilization can use.

If you want to check if the video card drivers weren't loaded: you can find them as follows:
Start -> Settings -> Control Panel -> System -> Hardware -> Device Manager and then click the plus next to the Display Adapters. When my video card drivers weren't loaded, there was an exclamation mark next to it.
 
One problem with this solution though:

/3GB does only work for WinXP 32 Professional. The Home edition (which would be the standard gamers edition) doesn't recognise this switch, or at least it doesn't have an effect. Microsoft gives differing informations on that.
 
One problem with this solution though:

/3GB does only work for WinXP 32 Professional. The Home edition (which would be the standard gamers edition) doesn't recognise this switch, or at least it doesn't have an effect. Microsoft gives differing informations on that.

Yes, the 3GB switch can only be used in Windows XP Professional and Windows Server 2003. Maybe that should be added to the first post to avoid Windows XP Home Edition users trying this stuff.
 
info about WinXP compatiblity and about userva added to first post
 
No. This fix only helps those that:

a) use a system that understands the 3GB switch (usualy "professional" or similar versions)
b) have more then 2GB RAM
 
Maybe a dumb question, but here goes:

I have only 1 Gb of phisical memory. Would this work for me?

No. This fix only helps those that:

a) use a system that understands the 3GB switch (usualy "professional" or similar versions)
b) have more then 2GB RAM

I'm not so sure about that. This 'fix' allows civilization IV to use more memory; that can be virtual memory or physical memory. Of course, physical memory is a lot faster than virtual memory, but one of the causes of the memory allocation failure is linked to the fact that civilization IV wants to use more than 2GB's of memory (physical + virtual) and Windows is not constructed to give programs more than 2 GB's of memory. The above mentioned changes allow Windows to provide Civilization IV with more than 2 GB's of memory.

Of course, the game might become horribly slow or other failures might arise when only one GB of physical memory is available but one of the causes of the memory allocation failure is circumvented with this 'fix'. Of course, you need to increase your virtual memory size so that physical + virtual memory is more than 3 GB's because other programs also use memory.
 
Thanks for the answers. Well, I'll just try it, and see what happens. The OS is Win Xp Professional, so it is supposed to work. Let's see... I'll post the results, in case someone else without money to buy Ram can try this.
 
Top Bottom