Memory-fix by Harkonnen is out!

marshallstack
With 128Mb of video memory you'll want to leave it intact. If corrupted graphics after fullscreen alt-tabbing becomes a problem, set 'insane_mode = 0', but it might make it a little more swappy. Though, the latter is not so critical with 1Gb of physical memory, it becomes critical with 512Mb of physical memory.
 
... and yet another lurker posting to register his praise!

I'm running a Acer Aspire 5020-series laptop (Turion ML28, 512 mb, ATI x700 128mb), and your patch improved performance significantly. I was very glad to notice the demise of the terrible memory hangup when exiting the game. Now I can actually do something with my computer after closing the program instead of twiddling my thumbs for three minutes. Great work!
 
Hi, I have a problem with this patch.
First, I loaded it up, loaded my own huge map save game.
Ran fast, then I hit the turn key.
Slow slow slow, then went to a city that had built something, and the terrain takes on this black/orange color, and the game chugs.
So I loaded up your save game file Hark, and it did the exact same thing.
Here are my specs:

p4 2.53ghz
128 agp aparture
512 ram
Radeon 9250
128 memory
 
Just thought I would share my experience with the memory fix.

First, my Civ IV experience up to now. It was hit and miss before v1.09 came out. I might run until the 1300s or so with no hitch, or I might go black screen and such very early, but it happened sooner or later. v.109 fixed most of that issue and I was able to play most of the time on the lower graphics settings, but I still had the occasional rendering issue or corruption. So, in desperation I reloaded my machine, creating a Win2K partition solely for Civ IV. I disabled almost all non-essential services to the point that the task manager showed 72MB of memory being used after boot up. I now experience a stable Civ IV, but it is slow at times, especially later, and the movies are hesitant.

Specs:
Compaq Presario 8000 8QSXE1
AMD Athlon 1800XP 1.53MHz 128KB L1 Cache 256KB L2 Pipeline Burst Cache
266MHz frontside bus
512MB PC2100 RAM
200GB Seagate Barracuda 7200PRM HDD
PNY Verto NVIDIA GeForce FX 5500 128MB video card
Sound Blaster PCI 128 (ES1373) sound card

The insane mode DOES work on Windows 2K, with some issues. I can no longer switch video resolution from within an active game. It actually does switch, but I am never prompted with the "are you sure" (or whatever the prompt is) prompt and it reverts right back to the original resolution. I can successfully switch from the games main menu at Advanced > Options. Alt-tabbing with insane=1 does exactly what Harkonnen said it would do, causes graphics corruption. I just wanted to mention this because the INI file stated that it shouldn't work at all, but had on XP SP2. Given I'm running it on 2K, I thought I should mention it works, more or less, on 2K as well. :)

I found that the ideal settings for me are:
vid_mem_usage = 72
insane_mode = 1

The video memory usage might just be my mind playing tricks on me, but I swear it seems even a smidge snappier at 72 than it does at 80. Could be wrong, though.

Graphics settings are set to low in the game, but I do not have animations or effects turned off. I have health bars enabled, single units, low textures. Resolution is 1024x768. I wish I could kick up the resolution, but performance suffers. Still, I tried the settings above with and without Harkonnen's patch and the game certainly does flow faster. Everything is just snappier all around, particularly zooming out to the globe view. I don't have near the hesitation I used to when it is crossing the barrier between globe and non-globe view. Also, the adivsors, particularly military, come up much quicker.
 
rokel
First, try setting 'vid_mem_usage=50', 'insane_mode=0'. If it works, try 'insane_mode=1' to increase playability. If it doesn't work, step back to 'insane_mode=0'.

Though, 512Mb system owners (like me) should make anything possible to make 'insane_mode=1' playable. For example, it was working for me with 5.11 Catalyst drivers.
 
AMD Sempron 2500+ @ 2100Mhz
Radeon 9600 XT series 128Mb
64Mb agp aparture
1Gb RAM
vid_mem_usage = 80
insane_mode = 1
resolution 1280x1024
Running low res on everything

Initial performance increase. Could not Alt-TAB out and back or got 'black terrain' but no biggie as i do not alt tab normally anyways. Only thing I noticed at first was that some leaders had freaky eyes. Some had very white eyes while alexander had black lashes like wearing makeup. Gengis Ghan had one normal and one white eye. Go figure.

After about 1 h I got my first problems. If some popup was in focus like diplo window or building popup in the beginning of turn, the background got 'darker' and everything was real jumpy.. It couldnt play the animations.. Then on the next turn it would be fine again.. And then a couple of turns later again.. cant really do diplo.

Anyways it got more frequent and I have now decided to try running with insane mode = 0.
 
VRWCAgent
Thanks for the info! I will remove scary notes about 'nVidia' and 'WinXP' in my next minor release (this weekend), and I have updated post #1 right now.

You are probably right about 72. 80 was off-the-wall assumptions, given average profiling values I gathered some time ago in 'memory leak' thread. Personally for me I will now use '72' too :) BTW, I tried to make it playable without 'single unit graphics'. Just this impacts game appearance too much... IMHO.

I had to write some code to make antialiasing switching possible, but I forgot to test resolution switching. This will come into next release (this weekend). Thanks for pointing that out! :)
 
Alphard
Did 'insane_mode = 0' help you? I am especially interested in leader heads since I couldn't still replicate this bug. How much turns are needed for leader heads to become corrupted?
 
Hey Hark, before reading your reply, I just lowered the vid mem usage to 60, while leaving insane mode to 1, and it works.
Would lowering vid mem to 50 make it go faster? Or should I leave it at 60?
 
Wanted to post specs, and my settings. This has really, really helped tremendously. I'm able to keep playing my games.

Prostar 4794 Laptop
Intel Pentium 4 3.06
1024 MB RAM
ATI Radeon Mobility 9000 w/ 64MB RAM
(Drivers only provided by Prostar for 9000 Mobility)
60Gig 7200RPM HD
Windows XP Pro SP2


vid_mem_usage = 50

insane_mode = 1
 
rokel
The pattern for vid_mem_usage is something like that:

slow-slow-slow-avg-avg-best-avg-avg-slow-bugs-crash

So I think you moved from 'bugs' to right-handed 'avg' or to 'best'.
 
Ah, ok Hark, cause it was bugging out at 80. Thanks for this patch btw, can't wait to finish an Earth Map!! :D
 
Harkonnen - you are the best! :thumbsup: Tvoj patch prosto super! :D

With it I finally managed to finish my game on a large map which I gave up in 1949 AD. This was my first win on Prince! :king:

I have a laptop with a 64MB Nvidia 5200 and 512MB system RAM. I used your patch in the insane mode and with vid_mem_usage=30.

The perfomance improvement was very noticeable. The saved game loaded in only a couple of minutes instead of more 5 minutes before the patch. When I loaded the game, Civ4's total memory usage was 530MB, and by the time I finished in 1973AD, the memory usage has gone up to 780MB. In comparison, without your patch, memory usage rose to more than 900MB, and that's earlier on in the game.

Correspondingly, the game was much smoother and much faster.

Also, without your patch with this game, it took upto half an hour for Civ4 to unload from memory when quitting to desktop, now it took less than 5 minutes.

So again, thank you very much! Bolshoye spasibo!:goodjob:
 
VRWCAgent
Well, I tried to play switching resolution and everything was fine...

ATI Radeon 9800 Pro, 128Mb. WinXP Pro SP2. 1152x864x32 at desktop. I was trying to switch betwen 1024x768 and 1152x864 in all 16 combinations for:
1) windows/fullscreen
2) main menu, in-game
3) aa/no-aa
4) resolution

Each time it worked, at least with small savegame.

Do you mean changing resolution in-game or changing resolution of desktop when game runs in windowed mode?

ALL
Did anyone else experience problems switching graphics resolution with my fix?
 
wow sweet...

I'm running a barton 3200+ with 2 gb system memory and a 128 meg ATI 9800 pro.

I was having issues playing one of my late game sg's last night with very slow loads and random desktopping...

just installed this keeping all my normal HQ settings and laod tiems are MUCH better. Scrolling around is smooth as well.

I'll stress test it later but so far so good.

Now I'll waste even more time playing civ! :eek:


thanks hark

Cheers!
-Liq
 
I don't understand this:

1) patch_on = 0 - ~700Mb

2) patch_on = 1, vid_mem_usage = 80, insane_mode = 0 - ~600Mb

3) patch_on = 1, vid_mem_usage = 80, insane_mode = 1 - ~520Mb

4) patch_on = 1, vid_mem_usage = 180, insane_mode = 1 - ~420Mb

Where are those numbers coming from?

I have 1 gig of ram and a 128mb graphics card. What should I be editing to if at all?
 
Harkonnen said:
VRWCAgent
Well, I tried to play switching resolution and everything was fine...

ATI Radeon 9800 Pro, 128Mb. WinXP Pro SP2. 1152x864x32 at desktop. I was trying to switch betwen 1024x768 and 1152x864 in all 16 combinations for:
1) windows/fullscreen
2) main menu, in-game
3) aa/no-aa
4) resolution

Each time it worked, at least with small savegame.

Do you mean changing resolution in-game or changing resolution of desktop when game runs in windowed mode?

ALL
Did anyone else experience problems switching graphics resolution with my fix?

Hmm. Interesting. I'll load it on XP again later tonight and see if it is maybe a 2K vs. XP thing. When I mentioned that I couldn't change resolution, I was referring to full-screen while actually playing with a game loaded. However, as I mentioned, it worked okay when changing resolution at the Civ IV main menu.

One thing is you mentioned using a small game file. Let me try that real quick here while booted into 2K. I was experimenting with a save from around year 1815, so it wasn't new.

Okay, now keep in mind all results are for insane_mode=1 and vid_mem_use=72 on Win2K. All tests are with aa set to zero as trying 2 or 4 really messes with performance no matter what, also all tests are with a new game, so a large save file isn't an issue:

main menu/Full and Windowed: Can change resolution no problem.

In game/Full: The dialog box appears briefly, but doesn't seem to acknowledge my click on keeping the new resolution and reverts back to the old resolution. The only difference here with my previous attempt is it's now a new game vs. an old, large saved game file.

In game/Windowed: Seems to allow me to change it so far. I've tried it several times and it's worked.
 
Kudos
This is vm_size from task manager on my system with my 1961 AD savegame pointed at post #1.

With your system you might try it as is, without any changes. If you experience minor visual bugs, try reducing vid_mem_usage to 60. If there are still problems, set 'insane_mode = 0'.

Don't be afraid, most probably previous paragraph won't be necessary.
 
VRWCAgent
I think I know the reason of this... When the game changes resolution, it assumes that device reseting will be almost instant, but since my patch has a lot of work to do by that time, it takes time to reset. So, basically, it consumes time to reset device while timer-to-revert-back already ticks.

If that's true, setting 'insane_mode=0' will solve the problem because in this case device reseting is much faster.
 
Back
Top Bottom