Optimization suggestions

well i tried first version of this one (second one kept crashing), i also recently upgraded my cpu to 3 gigs of ram and omg is it fast :) amazing job!
 
well it kinda makes sence, i upgraded my cpu to have 3 gigs of ram

anyways im trying to load spanish from 3000 bc, it says 30 minutes but its gonna be done in about five, again great work! it really improved this mod :)
 
well it kinda makes sence, i upgraded my cpu to have 3 gigs of ram

You have missed the point Khoukharev that was making, which was that you have upgraded your PC to now have 3 gigabytes of RAM. Your CPU may also have been upgraded, but its speed is measured in GHz and has nothing to do with memory (RAM).
 
So these changes will work for Plain BtS version 3.17 and for any Mod. :cool:

And should have no impact upon Solver's UOP ver 0.19, right?

I've modded games like MoO3 but this Python stuff makes my old and slow head spin.

Thank you musicfreak.

JosEPh :)
 
is the thing in first post correct?
 
Musicfreak,

What BtS files need this *fix* the most?

I've added your line: import cPickle as pickle, in several .py files in the Main BtS folder and in the Mod I play the most (Rise of Mankind). I've seen improvements but don't know if I've missed files that need it too.

Does the Core game CIV IV need this fix too?

It would be great if you would visit the RoM forum and post your advise there too.

Again Than you. :thumbsup: :cool:

JosEPh :)
 
is the thing in first post correct?
Yes, it should be. It works for me.

So these changes will work for Plain BtS version 3.17 and for any Mod. :cool:

And should have no impact upon Solver's UOP ver 0.19, right?
Yes, correct. This literally does nothing besides speeding it up. No other changes are made by this.

I've added your line: import cPickle as pickle, in several .py files in the Main BtS folder and in the Mod I play the most (Rise of Mankind). I've seen improvements but don't know if I've missed files that need it too.

Does the Core game CIV IV need this fix too?
I think you misunderstood what I actually did. I didn't just add the line, I replaced every instance of import pickle with import cPickle as pickle. So if it doesn't have the first line, then you don't need to do anything. The core Civ IV game does not use pickle, so it does not need this optimization. You only need it for mods that use pickle, in files that have the line import pickle. Not sure if you understood it correctly, I couldn't really tell from your post.

It would be great if you would visit the RoM forum and post your advise there too.
You could link to this post in that forum. I honestly don't have time right now, with school and all. Sorry. You probably won't see me on these forums much anymore at all.

Thank you musicfreak.
No problem, glad to help. :)
 
Here's wishing you well in school and a heartfelt goodbye. :D

Thank you

JosEPh
 
Well, if you're serious about 50% speed improvement, these changes will go straight to the top priority, and will be exported to vanilla, warlords, rand and MP.

However, I don't think I'll change city names storage to dictionaries, because there's not real speed improvement, and it's convenient for me to keep tuples, which I paste directly from Excel sheets
 
Well, if you're serious about 50% speed improvement, these changes will go straight to the top priority, and will be exported to vanilla, warlords, rand and MP.

However, I don't think I'll change city names storage to dictionaries, because there's not real speed improvement, and it's convenient for me to keep tuples, which I paste directly from Excel sheets

Rhye, from my experience, just making the cPickle change is dramatically faster. 50% is a low estimate of the increase, I think.

I also have not noticed any change in AI behavior or bugs in the game since making those changes.
 
Another optimization find, especially for XP user's, check your BIOS under Chipset settings. Look at the AGP Aperture setting. It should match the amount of Ram your Vid Card has. Many ppl are finding that it is set to 64mb not what their V-card can support. I changed mine to 256mb to match my card and I no longer have main map scroll lag or build list scroll problems. I'm playing RoM2.3 but thought that you all could use this info too. musicfreaks cPickle sure helped.

JosEPh :)
 
Hmmmm. I must be doing something wrong.

I downloaded and extracted the .rar in post 20 to the appropriate folder. Now, when I start a new game, the "You have been defeated" box pops up, even before the map is visible!
 
Well, if you're serious about 50% speed improvement, these changes will go straight to the top priority, and will be exported to vanilla, warlords, rand and MP.

However, I don't think I'll change city names storage to dictionaries, because there's not real speed improvement, and it's convenient for me to keep tuples, which I paste directly from Excel sheets

Pickle is used all over the code, so changing it to something faster would improve the speed. However, IMO the biggest drag on the code is the Python for loops, especially those that loop over regions of the map. For RFC Europe I have taken the lOwnedCities stability loop (every 6 turns) and moved it to C++, also the collapse barbs and motherland loops. UHV loops can also be placed in C++ (Persian and British in particular). We are going to run some tests to see how well that works now. Another big one is the Russian UP. AIWar maps could also be moved to C++, however, that would require more work. Since I have the code already, I could try to move that from RFCE to RFC.
 
OK I changed import pickle to import cPickle as pickle in all Python files. Ethiopia does load 50% faster (3 as opposed to 6 minutes). The improvement seems huge, however, I don't think is would be that much in the later stages of the game. When there are only 4 - 6 civs and those have only a few cities and units, the game spends a lot of time in Python and very little in the .dll. In the beginning we are mostly pickeling in the Python, so the improvement is significant. Later in the game, however, the game would spend more time in .dll routines and thus the improvement would be smaller.
 
However, conferences take 1/8 of the time with cPickle. It used to take forever for the flips to happen, now it's bam! Victoria gets Aksum, bam! I get Berlin, etc...which helps because I can remember better who I voted for and who might vote for me if I vote for them.
 
Back
Top Bottom