Teg_Navanis
King
- Joined
- Jan 21, 2006
- Messages
- 737
Normally, everything works fine, but =DOCTOR= uses the mod in his CustomAssets directory while CvPath.py is only intended to work in the mods directory.
=DOCTOR= said:Has no one else experienced the massive late game lag when all options for recording are selected?
Ok, I seem to have managed to disable the movement things in UnitStatisticsUtils (I couldn't find any in CvUnitStatisticsEventManager) and this has stopped them from showing when I press "u"; however, the massive delay when moving stacks was very much still present.
OzzyKP said:Will that hall of fame retain info for dead units?
GoodjobTeg_Navanis said:Hurray, I solved all performance issues!
By using SdToolKit, all the stats were written in the same file (CyGameInstance.setScriptData()), which was painfully slow when you had many units.
Now, the stats are stored separately for each unit in CyUnit.setScriptData(). Unit Statistics now has become so fast that you won't even notice that it's running (which was my personal goal #1). I use to create 250 units in worldbuilder and move 40 of them 10 tiles (railroad). This took up to 120 seconds with the unoptimized code, now it only takes 2 (it also takes 2 seconds when UnitStatistics is off)
personal goal #2, making unique names obsolete, probably won't be possible until the SDK comes out.
Note to self: always use unique names with the SD-Toolkit.
The Great Apple said:Hmmm - this means I no longer have to worry about silly unique naming and suchlike. It seems most obejects have a scriptdata function.
But I think Teg brings up a great point, maybe the right thing to do is generalize Tegs code and merge it into SD-Toolkit. This way if the object passed in has the get/setScriptData methods then those are used otherwise the more generic way CyGameInstance is used instead. What do you guys think?
But are you just merging the unit code from your UnitSdToolkit.py file or are you making a generic solution?