Unit Statistics for FFH

Actually, I just left those functions out. I didn't take the time to check how exactly Kael changed the immortal rebirth code, since I first wanted to make sure the other hooks work before adding any new.

From what I can see now, the new immortal rebirth code is in the kill function. This means that the defeat of an immortal unit will no longer be counted as a withdrawal, but be treated like the defeat of an ordinary unit at fist, incrementing the 'units lost' count of the unit/owner, the kill count of the winner and so on. That's not too bad a thing. It might actually be funny to track how often people manage to kill off their Immortals... :) Anyway, the only problem I see is that the survival odds ('this is your luckiest unit') will be screwed up by this, but that's just a minor glitch.
 
Sorry if this has been answered but does this mod slow than the game at all? Does it need to record extra information (compared to vanilla games) or would there only be a lag if you tried to look at individual units and it would have to bring up the relevant information?
 
Yes, the mod does slow the game a bit because extra information has to be processed/stored. The speed loss is barely noticeable though, and one is most likely to see a difference if there are hundreds of simultaneous operations that are tracked by the mod. In consequence, some statistics are disabled by default, especially those that would have to be updated all the time (every turn and/or whenever a unit moves). Most of the statistics that are enabled by default deal with the tracking of combat results, and there usually aren't hundreds of combats at once.

Since the mod is easy to switch on and off, I might try to get some benchmark results on my machine to see whether the AI turns take any longer with Unit Statistics turned on.
 
OK, I worked with two late-game save games from my last game (standard map size). My machine has these specs:

Intel dual-core 1.7 Ghz,
2GB Ram,
ATI Radeon 1400XT

I measured the time of the AI turns with my wristwatch, so the numbers are not too reliable (+/- 2s).

When at war, you can expect the AI turn to take significantly longer. I measured these times:

Unit Statistics on, tracking everything: 33s/34s
Unit Statistics on, default settings: 32s/31s
Unit Statistics off: 30s/31s

At peace, the AI doesn't take that long:

Unit Statistics on, tracking everything: 19s/20s
Unit Statistics on, default settings: 16s/17s
Unit Statistics off: 18s/17s

As you can see, I would need a more reliable measuring method to see how big the impact of the mod really is. But actually, knowing that the performance loss is so small that it's hard to measure is good enough for me. It does seem that the features that are disabled by default do affect the turn times a bit, so they probably won't be turned on again in future versions.

I also tested how much space the mod data takes up in a savegame, and it's about 10% (395kb vs. 430kb and 431kb vs. 472kb). That's pretty much for such a small mod (gameplay-wise), but since all the mod does is track and store additional information, this was to be expected. I could probably half this number if I really wanted to, just by using shorter variable names, but this involves some work and could introduce new bugs, so I don't think it's worth it.
 
thanx for the feedback. a couple seconds longer is no problem at all, at least for me. my specs are really similar to yours btw, core 2 duo @ 1.66 with 3 gigs of ram. probably a tad bit faster than yours thanx to the ram, but shouldn't vary much. on large/huge maps it could make more of a difference though. if you could try those out too, that would be awesome. but don't feel obliged to do so, of course :)
 
Awesome mod; I was blithely fortifying a Warrior in Fall Further when I finally happened to notice the trophy icon & got immersed in a bunch of cool statistics - particularly liked the ones ranking the top units in the entire world on a whole bunch of metrics. :viking: Yeah, this is probably news only to me. But it got me thinking..

What if you were to tweak this mod so that the very best unit in the world for a given metric would be awarded a special temporary promotion recognizing its legendary status? Some possibilities:

Most Spells/Summons Survived -> Magic Resistance
Most Damage Suffered -> Medic promotion, or + to healing rate
Most Damage Inflicted -> Heroic Strength
Most Attacks Survived -> Heroic Defense
Most Heroes Killed -> Hero Slayer (+25% vs Hero units)
Most Battles Fought -> Leadership
Most Reckless -> Berserker
etc. etc.

If you like, this promotion could represent the unique Favor of one of the many gods (e.g. Most Spells Survived could grant the "Favored of Oghma" promotion, etc.)

You could have this game mechanism kick in after a delay (i.e. >50 turns into the game, or Classical Era) to allow players time to rack up the various Legendary feats. To prevent rapid back-and-forth cycling, a new claimant would have to exceed the current record by a certain margin before taking over the legendary promotion. Only the Living units list is eligible (Hyborem you're disqualified!) and to be fair perhaps each unit could only have one of these world-renowned distinctions at one time.

Dominions 3 does a simple version of this, with the top 5 units in the world gaining a Legendary bonus to one trait that continues to improve the longer they remain on the list (until they're hunted down & killed by envious/iconoclastic opponents :D) Could add a really cool twist to the game, if it's not too difficult to implement!
 
That's an idea I've played with myself, but in the end, I'd rather keep the mod non-intrusive, so that one can safely ignore it. The promotions would be hard to balance anyway, since a unit can have 10 or more high scores at once.
 
I've skipped the first few patches, but a version compatible with 0.34g is now up.
 
Are you quoting my october post? Might look a bit confusing if you don't look at the timestamp. The current version is 0.40h of course.
 
Nope, there haven't been any changes to UnitStats for quite some time (since summer, actually), I'm just making sure that the python/cpp files include the latest FfH changes/bugfixes and then recompile the DLL.

And no, I'm playing 'vanilla' FfH, not FF.
 
Sorry about the epic gravedig, but I have a few questions about Unit Statistics.

I want to merge some modmods and I'm considering this one. You mention that the modmod should be turned off for multiplayer matches. Do you mean matches against someone that doesn't have this modmod? Will this modmod be multiplayer safe if all players are using it?

EDIT: My guess is that this modcomp was created for Fall from Heaven II 0.34p. If I had the source of that FfH II version I could isolate the changes made by this modcomp and try to update them to the most recent version. Anyone knows if I can find that version of the source code somewhere?
 
I actually created an updated version that can be merged with MNAI. Of course it took a lot of time... I'm used to working with diff files, which make working with changes to existing code a lot easier.

After taking all the commented code, I got a working GUI but sadly the stats are never updated. I did not had time to look further into this issue yet, but if anyone is interested I can upload my updated code here.
 
Back
Top Bottom