Advertisement
Civilization Fanatics' Center  

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - General Discussions > Civ4 - Bug Reports

Reply
 
Thread Tools
Old May 26, 2007, 03:20 PM   #1
Slyflyer
Chieftain
 
Join Date: May 2007
Posts: 14
I Fixed The Maf Error... Here Is How!!

Ok, this is my first post in these forums and the main reason is because like so many of you I had the MAF errors in Warlords which annoyed me so bad. I mean, how could I play high end games like STALKER and Supreme Commander and have zero issues but have Civ IV screw up. I am running on Vista Business 32bit and this fix is geared toward any Vista OS but will work in XP too as far as I am aware of. I acctually got the idea from a fix for Supreme Commander and FSX where there were nastly bugs of CTD errors when to much memory was being used. I decided to give the fix a shot for CIV and see what would happen.... what happened is 3 hours of smooth bug free play in Warlords when the whole map had been discovered!

So here is my gift to you all.... enjoy!



Try this only if you have at least 2 GByte of RAM and at your own risk.

- 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. (Note in Vista you must be running CFF Explorer in Administrator Mode).

If you run Windows Vista 64 or Windows XP 64 youre ready to go and dont need to read on. The rest is only for Windows Vista 32 and maybe Windows XP 32bit.

- Now we need to make Windows Vista (32-Bit) ready to support more than 2 GByte.
- Open a command prompt with Administration rights. You find it under "Programs->Accessories->Command prompt" click right and select "run as administrator".
- Enter "bcdedit /set IncreaseUserVA 3072" (without quotes) in the command window and press enter.
After that restart windows
- For Windows XP there is a similar setting for the boot.ini, but I am not sure what it is, should be found be google.

ENJOY!

Last edited by Slyflyer; May 26, 2007 at 03:23 PM.
Slyflyer is offline   Reply With Quote
Old May 27, 2007, 11:18 PM   #2
Methos
HoF Quattromaster


 
Methos's Avatar
 
Join Date: Jan 2005
Location: Missouri
Posts: 12,952
If I'm reading this right, than technically you didn't fix the error, but are just allocating more memory for to use.
__________________
My SG History

Hall of Fame: Forums, Rules, FAQ, Tables, HOF Email: hof.civfanatics@gmail.com
Methos is offline   Reply With Quote
Old May 28, 2007, 08:01 AM   #3
T.A JONES
Deity
 
Join Date: Jan 2006
Posts: 3,471
^^True but that still works for me, if it work I mean. I never heard of this approach in getting more memory/ Hes maxing my virtual memory with this technique No?

How come it has to be 2G people only Huh? Think of all the 1.5 G people your excluding worse, The thousands of the 1 Giggers! they need it more don't you think? And about the poor 700n somethings, What do they do? (never mind the hapless 512's, their a lost cause man )

Is this the same as increaseing you pagion file> How come I havn't heard this approach on this cool rundown ?
T.A JONES is offline   Reply With Quote
Old May 28, 2007, 10:09 AM   #4
Slyflyer
Chieftain
 
Join Date: May 2007
Posts: 14
Well I learned this trick as i said from some other games where it worked. I decided to give it a try and it worked just fine. If you have less than 2 gigs of ram you could make it work, all you are doing is allowing the OS and game to address more than 2gigs worth of memory (whether its physical or virtual). It is stated that 2gigs is recommended simply because if you do this trick with less than that all you are doing is increasing your virtual memory on your hard drive. Some people have issues with that. Then again, in playing civ I doubt this slow down is even noticable as it is not a heavily intensive game compaired to many out today. All I know is this trick worked perfect for me and hopefully it will work for someone else It is NOT the same as increasing the pagefile. I tried that before hand and it did nothing. Thinking back its obvious just increasing the pagefile will not work because you still need to allow both the OS and the game to address more than 2048mb worth of memory space
Slyflyer is offline   Reply With Quote
Old May 28, 2007, 01:30 PM   #5
timmeh
Chieftain
 
Join Date: May 2007
Posts: 2
Quote:
Originally Posted by Slyflyer View Post
Ok, this is my first post in these forums and the main reason is because like so many of you I had the MAF errors in Warlords which annoyed me so bad. I mean, how could I play high end games like STALKER and Supreme Commander and have zero issues but have Civ IV screw up. I am running on Vista Business 32bit and this fix is geared toward any Vista OS but will work in XP too as far as I am aware of. I acctually got the idea from a fix for Supreme Commander and FSX where there were nastly bugs of CTD errors when to much memory was being used. I decided to give the fix a shot for CIV and see what would happen.... what happened is 3 hours of smooth bug free play in Warlords when the whole map had been discovered!

So here is my gift to you all.... enjoy!



Try this only if you have at least 2 GByte of RAM and at your own risk.

- 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. (Note in Vista you must be running CFF Explorer in Administrator Mode).

If you run Windows Vista 64 or Windows XP 64 youre ready to go and dont need to read on. The rest is only for Windows Vista 32 and maybe Windows XP 32bit.

- Now we need to make Windows Vista (32-Bit) ready to support more than 2 GByte.
- Open a command prompt with Administration rights. You find it under "Programs->Accessories->Command prompt" click right and select "run as administrator".
- Enter "bcdedit /set IncreaseUserVA 3072" (without quotes) in the command window and press enter.
After that restart windows
- For Windows XP there is a similar setting for the boot.ini, but I am not sure what it is, should be found be google.

ENJOY!
Works great for me!

Recently tried Giant Earth Map and was getting "MAF's" every 2/3 turns and now after playing few hours its fixed so i can finally finish it.

My spec: c2d@3k; 2gb; 7900gto; vista ultimate 32-bit;

THANKS!
timmeh is offline   Reply With Quote
Old May 28, 2007, 01:35 PM   #6
MusX
Prince
 
MusX's Avatar
 
Join Date: Apr 2006
Location: Poland
Posts: 397
kewl. will check this out

for winXP 32bit you propably should edit C:\boot.ini and add maxmem to the command link of your OS:
Code:
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /maxmem=3072
don't copy and paste whole code cause your system may not boot!! just add /maxmem=3072 at the end of line

this is not working very well for me... i still getting some mafs. what could help me? my ram is 2gb, my virtual memory is set constant 4096-4096mb. i've added maxmem=3072 to boot.ini. and of course edited exe via cff explorer.
it's still getting mafs

post editied cause 4096 was wrong maxmem: "4096" -> "3072"
__________________
http://www.last.fm/user/MusX/

Last edited by MusX; May 30, 2007 at 01:43 AM.
MusX is offline   Reply With Quote
Old May 29, 2007, 07:25 PM   #7
Slyflyer
Chieftain
 
Join Date: May 2007
Posts: 14
Quote:
Originally Posted by MusX View Post
kewl. will check this out

for winXP 32bit you propably should edit C:\boot.ini and add maxmem to the command link of your OS:
Code:
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /maxmem=4096
don't copy and paste whole code cause your system may not boot!! just add /maxmem=4096 at the end of line

this is not working very well for me... i still getting some mafs. what could help me? my ram is 2gb, my virtual memory is set constant 4096-4096mb. i've added maxmem=4096 to boot.ini. and of course edited exe via cff explorer.
it's still getting mafs
Don't use 4096 if you have a 32bit OS. This could be causing your problems because a 32bit OS does not know how to handle more than 3gigs worth of memory addressing. You must have a 64bit OS in order to run any number above 3072. If you have any question about what bit OS you have feel free to ask me, but chances are if you don't know you probably have a 32bit OS. If you have a 64bit OS (i.e. Windows XP Pro 64bit or Windows Vista 64bit) you should already know Try 3072 and see how it goes and also make sure you followed the steps exactly (unless you have XP, then use your boot.ini line, although I no longer use XP and am unable to try it myself to see if it works)!

Last edited by Slyflyer; May 29, 2007 at 07:34 PM.
Slyflyer is offline   Reply With Quote
Old May 30, 2007, 12:47 AM   #8
davidmarshburn
Chieftain
 
Join Date: Apr 2006
Posts: 39
this did not work for me. win xp, 2 GB physical memory. i tried /maxmem=4096 and 3072 in boot.ini, and i set the game executable to "know" about >2GB addresses.

i was going to attach a savegame file, but the file is 819 KB, exceeding the forum limit of 500 KB for that filetype (or so the internets tell me). in the savegame, the game crashes immediately on save after the beginning of the next turn. this is played with the napoleonic europe mod here:
http://forums.civfanatics.com/showthread.php?t=196505

i really, really hate this bug now. it has ruined civ4/warlord for me by making every mod i've tried unplayable *grumpy*

thanks for the suggestions, though! this was a promising trick to try!
davidmarshburn is offline   Reply With Quote
Old May 30, 2007, 01:39 AM   #9
MusX
Prince
 
MusX's Avatar
 
Join Date: Apr 2006
Location: Poland
Posts: 397
Quote:
Originally Posted by Slyflyer View Post
Don't use 4096 if you have a 32bit OS. This could be causing your problems because a 32bit OS does not know how to handle more than 3gigs worth of memory addressing. You must have a 64bit OS in order to run any number above 3072. If you have any question about what bit OS you have feel free to ask me, but chances are if you don't know you probably have a 32bit OS. If you have a 64bit OS (i.e. Windows XP Pro 64bit or Windows Vista 64bit) you should already know Try 3072 and see how it goes and also make sure you followed the steps exactly (unless you have XP, then use your boot.ini line, although I no longer use XP and am unable to try it myself to see if it works)!
winxp 32bit, my cpu is up to 64bit but my OS is 32bit so 64bit cpu doesn't matter here.
ok. i've set 3072, same like davidmarshburn's said it's not work for me too. what with my virtual memory size (not only for OS but overall), is it right: 4096-4096? maybe if I would allocate another virtual memory on the civ4's partition, would it work faster/better?
__________________
http://www.last.fm/user/MusX/

Last edited by MusX; May 30, 2007 at 02:18 AM.
MusX is offline   Reply With Quote
Old May 30, 2007, 05:23 AM   #10
toft
King
 
toft's Avatar
 
Join Date: May 2005
Location: €urope
Posts: 694
OMG IT WORKS!


I have vista x64 and 4gb ram... and this little nifty trick has done it all. Last week I played a game that got a MAF at every saveattempt. But because of this I have been playing 10 hours straight on that game - No more MAF!
toft is offline   Reply With Quote
Old May 30, 2007, 07:58 AM   #11
MusX
Prince
 
MusX's Avatar
 
Join Date: Apr 2006
Location: Poland
Posts: 397
Quote:
Originally Posted by toft View Post
OMG IT WORKS!
it seems to be working only for 64bit OS, anyone figure out how to use it on 32bit XP?
__________________
http://www.last.fm/user/MusX/
MusX is offline   Reply With Quote
Old May 30, 2007, 04:30 PM   #12
Slyflyer
Chieftain
 
Join Date: May 2007
Posts: 14
Quote:
Originally Posted by MusX View Post
it seems to be working only for 64bit OS, anyone figure out how to use it on 32bit XP?
I am using a 32 bit OS and it works for me (granted its Vista not XP).

Quote:
Originally Posted by davidmarshburn
this did not work for me. win xp, 2 GB physical memory. i tried /maxmem=4096 and 3072 in boot.ini, and i set the game executable to "know" about >2GB addresses.

i was going to attach a savegame file, but the file is 819 KB, exceeding the forum limit of 500 KB for that filetype (or so the internets tell me). in the savegame, the game crashes immediately on save after the beginning of the next turn. this is played with the napoleonic europe mod here:
http://forums.civfanatics.com/showthread.php?t=196505

i really, really hate this bug now. it has ruined civ4/warlord for me by making every mod i've tried unplayable *grumpy*

thanks for the suggestions, though! this was a promising trick to try!
With a mod this could be a whole different issue but SHOULD still work for it. What matters in this case is the EXE file that is used to launch the mod. If you can get me the name of that file I could tell you how to do it. If you load the mod from Civ itself it still might be launching a seperate EXE for that mod (I am not sure because I never messed with mods in this game). So get back to me on that and I will try and help you out.

Quote:
Originally Posted by MusX
winxp 32bit, my cpu is up to 64bit but my OS is 32bit so 64bit cpu doesn't matter here.
ok. i've set 3072, same like davidmarshburn's said it's not work for me too. what with my virtual memory size (not only for OS but overall), is it right: 4096-4096? maybe if I would allocate another virtual memory on the civ4's partition, would it work faster/better?
In short... Not only have I done the trick myself and have it working but my Pagefile is set at 3068mb on my primary hard drive (C:\). My other hard drives are not being used to store the pagefile or civ data. I dont know if that helps but try to create my memory situation as best you can
Slyflyer is offline   Reply With Quote
Old May 30, 2007, 11:40 PM   #13
davidmarshburn
Chieftain
 
Join Date: Apr 2006
Posts: 39
Quote:
Originally Posted by Slyflyer View Post
With a mod this could be a whole different issue but SHOULD still work for it. What matters in this case is the EXE file that is used to launch the mod. If you can get me the name of that file I could tell you how to do it. If you load the mod from Civ itself it still might be launching a seperate EXE for that mod (I am not sure because I never messed with mods in this game). So get back to me on that and I will try and help you out.
i load the mod from within civ (well, when i started the game; after that, i double-click the savegame to load it and the mod in one step). the mod folder contains no executables, only xml and stuff. the executable that shows up in the task manager is indeed CivIVWarlords.exe.
davidmarshburn is offline   Reply With Quote
Old May 31, 2007, 03:24 AM   #14
MusX
Prince
 
MusX's Avatar
 
Join Date: Apr 2006
Location: Poland
Posts: 397
Quote:
Originally Posted by davidmarshburn View Post
i load the mod from within civ (well, when i started the game; after that, i double-click the savegame to load it and the mod in one step). the mod folder contains no executables, only xml and stuff. the executable that shows up in the task manager is indeed CivIVWarlords.exe.
the same here. i use Giant Earth Map which has no exe's
__________________
http://www.last.fm/user/MusX/
MusX is offline   Reply With Quote
Old May 31, 2007, 01:17 PM   #15
Gyathaar
Warlock

 
Gyathaar's Avatar
 
Join Date: Nov 2003
Location: Trondheim, Norway
Posts: 3,730
For 32bit XP , win2k and win2k3 you should be using the /3GB switch.. not /maxmem switch

http://www.microsoft.com/technet/sys...n/bootini.mspx

/maxmem just says how much physical memory windows is allowed to use, /3GB is the one that allows programs to use up to 3GB memory
Gyathaar is offline   Reply With Quote
Old May 31, 2007, 01:31 PM   #16
ERLoft
San Diegan
 
ERLoft's Avatar
 
Join Date: Dec 2001
Location: San Diego
Posts: 246
Quote:
Originally Posted by Gyathaar View Post
For 32bit XP , win2k and win2k3 you should be using the /3GB switch.. not /maxmem switch

http://www.microsoft.com/technet/sys...n/bootini.mspx

/maxmem just says how much physical memory windows is allowed to use, /3GB is the one that allows programs to use up to 3GB memory

So, you're saying that this line which farther up looked like this:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Professional" /noexecute=optin /fastdetect /maxmem=4096

should look like this:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Professional" /noexecute=optin /fastdetect /3GB


What needs to be done to the .exe file for the second requirement as listed in the link you posted above: "and the application .exe must be flagged as a 3-GB-aware application."
ERLoft is offline   Reply With Quote
Old May 31, 2007, 03:42 PM   #17
Gyathaar
Warlock

 
Gyathaar's Avatar
 
Join Date: Nov 2003
Location: Trondheim, Norway
Posts: 3,730
Quote:
Originally Posted by ERLoft View Post
So, you're saying that this line which farther up looked like this:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Professional" /noexecute=optin /fastdetect /maxmem=4096

should look like this:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Professional" /noexecute=optin /fastdetect /3GB
Yes..
Quote:
Originally Posted by ERLoft View Post
What needs to be done to the .exe file for the second requirement as listed in the link you posted above: "and the application .exe must be flagged as a 3-GB-aware application."
That is the stuff the program linked in the first post of the thread does
Gyathaar is offline   Reply With Quote
Old May 31, 2007, 05:04 PM   #18
TAfirehawk
WoC Team Manager
 
TAfirehawk's Avatar
 
Join Date: Aug 2006
Location: Florida
Posts: 2,326
The MAF has been very well documented in ViSa since the mod is over 800MB and Firaxis has been well informed of their problem in the EXE.....more memory helps but is not a solution. Don't get me wrong, I am for any and all possible ideas to reduce the MAF like we have a NCSaver routine that is a work-around for saving games that is a huge help to MAF's.

Recently I got the MAF's to decrease by changing the Memory Priority to System Cache....which pushes more of Civ to the pagefile. Our testing has shown that most MAF's happen at a repeatable amount of free physical RAM is reached, but the amount varies from PC to PC.

Also note that any MS OS after Win2k will have MAF problems....and the newer the worse it is besides Media Edition.

I am not the one on the ViSa Modpack Team doing the MAF testing so my info might not be 100%, but the save routine work-around and System Cache setting the MAF is nearly eliminated for most people.....hopefully this change will help even more!!!!
__________________

World of Civilization Modding Platform for BtS
WoC is not a mod but an extension of the Modular XML Loading Firaxis released with BtS
The WoC goal is to allow the player the choice of mod components from all BtS modders


Do or do not... there is no try.
Yoda
TAfirehawk is offline   Reply With Quote
Old May 31, 2007, 05:56 PM   #19
Gyathaar
Warlock

 
Gyathaar's Avatar
 
Join Date: Nov 2003
Location: Trondheim, Norway
Posts: 3,730
Quote:
Originally Posted by TAfirehawk View Post
The MAF has been very well documented in ViSa since the mod is over 800MB and Firaxis has been well informed of their problem in the EXE.....more memory helps but is not a solution. Don't get me wrong, I am for any and all possible ideas to reduce the MAF like we have a NCSaver routine that is a work-around for saving games that is a huge help to MAF's.

Recently I got the MAF's to decrease by changing the Memory Priority to System Cache....which pushes more of Civ to the pagefile. Our testing has shown that most MAF's happen at a repeatable amount of free physical RAM is reached, but the amount varies from PC to PC.

Also note that any MS OS after Win2k will have MAF problems....and the newer the worse it is besides Media Edition.

I am not the one on the ViSa Modpack Team doing the MAF testing so my info might not be 100%, but the save routine work-around and System Cache setting the MAF is nearly eliminated for most people.....hopefully this change will help even more!!!!
Yes.. there are 2 things that cause the MAF... one thing is if the system actually runs out of memory.. which this method will prolly help with.. (basically I believe it will if the game uses more than 1.5 GB of memory, and it then gets MAF error when you save.. or if you have low amount of memory... if you have less then 1GB of memory, you will more likely run into this limit than the 512MB limit mentioned further below)

The other thing is there is a max limit for how large a single datastructure can be in memory.. this seems to be set in windows.. and varies depending on the OS.. (civ4 stores most of the save game data in a single datastructure while it compresses/uncompresses the data)

It is possible that this method also change that max limit (of around 512MB) somehow on some versions of Windows (I expect that may very well be the case on 64bit OSes and Vista)
Gyathaar is offline   Reply With Quote
Old May 31, 2007, 05:58 PM   #20
TAfirehawk
WoC Team Manager
 
TAfirehawk's Avatar
 
Join Date: Aug 2006
Location: Florida
Posts: 2,326
On WinXP, I changed the BOOT.INI to the /3GB switch and modified the EXE, but Civ still won't use more than 2GB of total memory

I pull up a 512x512 smartmap game which wants like 10GB of ram and it still pegs at 2GB limit.

And thanks Gyathaar for pushing this to Firaxis....since they wouldn't listen to us before the v2.08 Warlords patch.....
__________________

World of Civilization Modding Platform for BtS
WoC is not a mod but an extension of the Modular XML Loading Firaxis released with BtS
The WoC goal is to allow the player the choice of mod components from all BtS modders


Do or do not... there is no try.
Yoda
TAfirehawk is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - General Discussions > Civ4 - Bug Reports > I Fixed The Maf Error... Here Is How!!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed Civs with a Fixed map, various difficulties Bleys Civ4 - SDK/Python 0 Apr 09, 2008 11:40 AM
MAF not fixed in BtS MusX Civ4 - Bug Reports 1 Jul 28, 2007 07:08 PM
Is Multiplayer OSS error fixed in BTS??? Raider62 Civ4 - General Discussions 4 Jul 25, 2007 01:50 AM
Fixed - CRC Error during Install Camp_7 Civ4 - Technical Support 0 Jan 20, 2006 01:22 PM
Error: Missing D3DX9_26.DLL. How I fixed it. silverjim Civ4 - Technical Support 1 Nov 03, 2005 11:55 AM


Advertisement

All times are GMT -6. The time now is 05:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR