Different ways to improve your mods speed?

NotSoGood

Emperor
Joined
Jan 25, 2009
Messages
1,077
Location
Finland
After nearly a year of development of my mod, I have started to improve its speed. I know about those SDK modcomps that change the way AI does things (CAR and if I remember right there was two others), but I'm asking simpler ways to fasten it up.

I think someone has once said that BTS loads all the art when starting the mod. So would it be faster to start the mod and need less memory if I removed unused art defines from the Assets/xml/Art folder? Also how significantly would the mod loading speed up if I pak the art files? Also I quess merging the small text files would add a minor boost.
But is there any other simple* ways that you know and would like to share it with me? I would appreciate it. Thanks in advance.

*No complete AI recoding!
 
- fpk files do speed up loading the mod, probably halves the loading time
- 'import cPickle as pickle' in python files should speed up turns (don't ask me what it does, I found this info long ago from these forums
- adding unit/building buttons into atlas files speeds up showing the Advisor screens because then button images are loaded from couple files instead of several hundred files
- static leaderheads ie. static images instead of animated leaderheads does improve speed (can be modular)
- if you have custom python code (eventmanagers etc), optimizing code in them can give some speed improvements.
 
- 'import cPickle as pickle' in python files should speed up turns (don't ask me what it does, I found this info long ago from these forums

Hmm, that sounds interesting, but how do you exactly do that? I found it from the Rhye's and Fall of Civilization forums. I'm not much of a python coder, so if someone could explain here?
 
Hmm, that sounds interesting, but how do you exactly do that? I found it from the Rhye's and Fall of Civilization forums. I'm not much of a python coder, so if someone could explain here?
In python files that have 'import pickle' you change it to 'import cPickle as pickle'. Python documentation says that cPickle can be 1000 times faster than pickle module.
 
In python files that have 'import pickle' you change it to 'import cPickle as pickle'. Python documentation says that cPickle can be 1000 times faster than pickle module.

What a shame, seems like none of my python files use that import pickle. :(

But I did the search for original BTS python files and seems that CvAppInterface has it. :king: Should I just copy it to my mod's folder and change 'import pickle' to 'import cPickle as pickle'? It might speed up a bit...
 
Back
Top Bottom