1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Working MAF fix for WinXP 32bit!!

Discussion in 'Civ4 - Technical Support' started by MusX, Jun 1, 2007.

  1. MusX

    MusX Prince

    Joined:
    Apr 17, 2006
    Messages:
    398
    Location:
    Poland
    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!
    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

    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:
    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
     
  2. TAfirehawk

    TAfirehawk WoC Team Manager

    Joined:
    Aug 25, 2006
    Messages:
    2,326
    Location:
    Florida
    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 ;)
     
  3. davidmarshburn

    davidmarshburn Chieftain

    Joined:
    Apr 4, 2006
    Messages:
    39
    the /3GB switch makes my system not boot. it freezes after the initial windows screen.
     
  4. MusX

    MusX Prince

    Joined:
    Apr 17, 2006
    Messages:
    398
    Location:
    Poland
    you can edit boot.ini before windows run, use your windows cd-rom for this. what is your physical and virtual memory?
     
  5. davidmarshburn

    davidmarshburn Chieftain

    Joined:
    Apr 4, 2006
    Messages:
    39
    physical memory is 2 GB. page file size is pinned at 4096 MB.
     
  6. MusX

    MusX Prince

    Joined:
    Apr 17, 2006
    Messages:
    398
    Location:
    Poland
    win xp pro sp2 32bit? really can't figered out where is the problem with your OS :confused:
     
  7. davidmarshburn

    davidmarshburn Chieftain

    Joined:
    Apr 4, 2006
    Messages:
    39
    yes, that's what i have.
     
  8. TAfirehawk

    TAfirehawk WoC Team Manager

    Joined:
    Aug 25, 2006
    Messages:
    2,326
    Location:
    Florida
    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).
     
  9. MusX

    MusX Prince

    Joined:
    Apr 17, 2006
    Messages:
    398
    Location:
    Poland
    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
     
  10. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    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/
     
  11. MusX

    MusX Prince

    Joined:
    Apr 17, 2006
    Messages:
    398
    Location:
    Poland
    great post. one friend also told me about userva but i fixed MAF without this command
     
  12. davidmarshburn

    davidmarshburn Chieftain

    Joined:
    Apr 4, 2006
    Messages:
    39
    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!
     
  13. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    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.

    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.
     
  14. Bastian-Bux

    Bastian-Bux King

    Joined:
    Mar 29, 2006
    Messages:
    795
    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.
     
  15. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    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.
     
  16. MusX

    MusX Prince

    Joined:
    Apr 17, 2006
    Messages:
    398
    Location:
    Poland
    info about WinXP compatiblity and about userva added to first post
     
  17. Lerinor

    Lerinor Chieftain

    Joined:
    Apr 2, 2007
    Messages:
    92
    Location:
    Sao Paulo, Brazil
    Maybe a dumb question, but here goes:

    I have only 1 Gb of phisical memory. Would this work for me?
     
  18. Bastian-Bux

    Bastian-Bux King

    Joined:
    Mar 29, 2006
    Messages:
    795
    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
     
  19. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    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.
     
  20. Lerinor

    Lerinor Chieftain

    Joined:
    Apr 2, 2007
    Messages:
    92
    Location:
    Sao Paulo, Brazil
    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.
     

Share This Page