[MODCOMP] Unit Statistics

Hello Caesium

I'v replaced CvGameCoreDLL.dll in Warlords\Mods\Amra's Modpack v2\Assets\ with CvGameCoreDLL.dll from Warlords_3SquareRadiusCities, by the way both files are exactly 5058560 byte in size if it means anything.

Now I have 3 Squars City Radius and by pushing U I get Unit Statistics, maybe something is missing and I don't know it yet.
 
the unit statistics' CvGameCoreDLL is only needed for combat tracking. If the battle counter / kill counter / damage counter etc. stay at 0 after a combat, the CvGameCoreDLL doesn't work.
 
Hello Teg_Navanis

Thanks for your reply.

How rude will it be to ask you to merge these two CvGameCoreDLL.dll for all of us whom enjoy playing huge maps and love 3 Squars City Radius ?

Thanks
 
I can't download the city radius mod right now as there are 'currently no free download slots'.

I suppose that you don't have to know anything about programming to merge the two mods, since they edit different files. If you follow the SDK tutorial you might be able to create your own CvGameCoreDLL. Just replace the original CvUnit.cpp with the one from my mod and CvCity.cpp (or CvDefines or whatever) with the one from the 3 Square Radius mod before you compile the DLL.
 
A new version has been uploaded. I recompiled the Warlords DLL for the new patch (the SDK file modified in the mod has not been changed in the patch). Additionally, the new version features a general bugfix and several changes that have been made specifically for the FfH mod, but were never uploaded as an independent version.
 
Teg_Navanis said:
A new version has been uploaded. I recompiled the Warlords DLL for the new patch (the SDK file modified in the mod has not been changed in the patch).

That's wrong. There are several changes in CvUnit.cpp which came with the patch. It should be last modified on 10/20/2006 11:44. The file you uploaded is based on WL 2.0. This way, the game might run into errors.

Matze
 
D'oh, I checked the last modification of the wrong file (CyUnit.cpp). Thanks for the info! The correct version has now been uploaded.
 
Thanks for the fast reply. As I can see, you have made no changes to CvUnit.cpp except for the changes that came with the patch. Is that right or did I overlook a detail?

Matze
 
Yep, just the changes that came with the patch.

I just found a bug that must have slipped in not long ago. UnitStatisticsUtils.py, line 721

Code:
				self.combatcountUpdater([B]combatcountUpdater[/B], DEFENCE, 2, defenderUnit.getOwner())

should be

Code:
				self.combatcountUpdater([B]defenderUnit[/B], DEFENCE, 2, defenderUnit.getOwner())

I'll do some more testing and upload a fixed version later. You might want to wait for that one.
 
@Teg_Navanis - this looks like a great mod. I'm currently cobbling a few of these things together but I don't want to change the DLL. If I bring in your mod (excluding the DLL changes) ...

a) will it still work as advertised?
b) if not, what will work and what will be 'missing'?
 
An explanation from old readme files:

Readme 1.31 said:
Since Civ4 upgrades a unit by deleting it and creating a new one, every unit
has to be given a unique name. I implemented a simple numbering system, but the
Random Unit Names Mod by TheLopez could be used as well

I could solve this problem by adding a single line of code to the DLL. After I knew that I'd release my mod with the DLL anyway, I also created some new python hooks that enabled more (and more complex) combat statistics. The last version of the mod which worked fine without the DLL was 1.33.

Readme 1.33 said:
You can run Unit Statistics without its CvGameCoreDLL file, although with restricted
functionality: only your players can be tracked and all units need an unique name
You have to change the following settings in the Unit Statistics Mod Config.ini
Use CvGameCoreDLL = false
Unit Naming = 1 (or a higher value, but not 0)
Track All Players = false (is default)

You can get version 1.33 here.

You'll notice that it lacks all recently implemented features (most importantly the screen interface and the multi-language support). Also, the combat tracking is much more crude without the DLL changes - without them, it's not possible to distinguish between attacks and defence battles, to track collateral damage or to give reliable damage stats.
 
Great - I'm going to pick up version 1.33 and see if it plays nicely with the other mods that I have already folded in. Unique names for units isn't a problem as I already have 5 different ways of naming units already built in.

I also noticed the problem with not being able to separate attack and defense (I think it comes down to .isHuman always returning true). I got around that by setting a temp flag to true in 'onEndGameTurn' and to false in 'onEndPlayerTurn'. This only works if the human is player number 0.
 
I notice that you are logging 'withdrawal' - is that an event that shipped with CIV or did you add it via the SDK?
 
In newer versions, withdrawals are logged via the SDK. In older ones, the number of withdrawals was simply the number of battles minus the number of kills.
 
The mod is essential for keeping track of the statistics. If you use the mod on a saved game that was started without the mod, all statistics will start from zero.
 
There are already mod compilations that include both. I'd suggest Caesium Mod, since it allows you to easily select which mod components you want to activate.
 
Back
Top Bottom