View Full Version : Improve Mod Lag Time


marx&engles
Nov 25, 2007, 03:20 PM
I created a personal mod that incorporates many different mod components that I would enjoy using in the game. I made 2 versions of the mod: 1 with only units and xml changes, and another with additional python changes. Both mods load and work fine, but the only problem is that the one with python changes has over 30 seconds in between turns on large maps :mad: (I like playing on the 18 civs map w/ all 34 civs).

Any suggestions are welcomed and appreciated. Thanks in advance! :)

Seven05
Nov 26, 2007, 03:12 PM
Python is slow, especially when it has to 'loop' to do things. More loops make it even slower. To fix this you need to minimize the looping, for instance if you have two python modcomps that each loop through every plot on the map at the beginning of the player's turn you could try combining their code so they use the same loop. Alternatively, you could move most of the python code into the SDK (DLL) since C++ is many times faster than Python can ever dream of being :)

marx&engles
Nov 26, 2007, 06:50 PM
Thanks for the advice. I'm planning on trying to combine some of the python components.

Also, do you know of any good SDK guides? I downloaded everything and compiled a dll, but it never did work...

Seven05
Nov 26, 2007, 07:01 PM
I followed the steps posted here (sorry, no link) to get it to work with Visual Studio 2005 Express. Once you get it to compile there isn't any sort of guide, you just have to work on one thing at a time and ask specific questions to get help :)