First of all I want to thank all you guys for your respect. It didn't let me to give up in hardest situations, I would surely stop my efforts, should I know that I write it just for myself
![Smile :) :)](/data/assets/smilies/smile.gif)
Currently I am downloading that hot-fix, probably I'll be able to set it up and see what have they fixed.
I blamed a lot things which didn't actually matter. For example, I blamed Python when it wasn't actually source of problems just because it was the first thing to suspect. For example, when you see a 3-wheel car going slowly, you will suspect 4th wheel absence as the reason of slow-downs, not broken engine. But when you investigate the issue, it actually becomes an engine... Situation here was about the same.
The game does drop back from 650Mb to 128Mb memory usage when I load my hugest test save game and then exit back to the main menu. Well, right by the start it's about 80AMb, so 40Mb are not freed (not necessarily lost), probably due to Python lazy dellocation; I don't know. But if I load same savegame again, it's again 650Mb, not 690 or 700 - so it's ok.
Firaxis didn't concact me yet. Probably just because no exe/dll still stands behind my words, just words...
![Smile :) :)](/data/assets/smilies/smile.gif)
Neither I contacted them. Well, just because my memory manager which probably makes allocations better, actually makes no sence, since the problem originates in Direct3D allocations size, not the way they are aligned.
My solution would optimize memory usage, so that after allocation 200Mb of pure data you would get, say 250Mb of actualy used memory, not 400 or 500. But it wasn't the problem... There is no need to optimize placement of a pile of boxes if the reason is just too big amount of them.
I said that entire game engine is written in Python. Even if this true, this doesn't make sense either. What would help this game is some 256Mb or 512Mb of video memory - that'll make it, but again only with a fix.
I have spotted that Direct3D objects are not placed in video memory, though they are placed in D3DPOOL_MANAGED. Probably they had their dirty hands on wrong priorities management, I don't know... Placing everything to D3DPOOL_DEFAULT sped it up a little, and less resources were kept in main RAM, but it needs more adjustments, so that textures don't go black after alt-tabbing and stuff. That's my current solution of the problem.
I saw about 250Mb of GEOMETRY DATA with only ~45Mb of textures!!! John Carmack would rather code Quake1 soft renderer in visual basic, rather then allow such a number... Also this seems to be backed by civ4 internal memory state, so we have about 500Mb of waste... I can fight off D3D waste of 250mb - that's what I am currently doing.