CvPlayer.m_iFractionalCombatExperience not saved

Archid

Warlord
Joined
Oct 30, 2009
Messages
296
Location
North Wales, UK
Looking around the latest svn code I noticed that the m_iFractionalCombatExperience value is not included in the CvPlayer::read & CvPlayer::write functions so is lost between saves. Given that this value only contains the fractional components it is not a major issue, but I believe it should persist.

[EDIT] Removed previous edit as it would not simplify things as much as I initially thought.
 
Last edited:
erm... this is a copy of what we have in C2C dll:
Code:
int CvPlayer::greatPeopleThreshold(bool bMilitary) const
{
    int iThreshold;

    if (bMilitary)
    {
        iThreshold = ((GC.getDefineINT("GREAT_GENERALS_THRESHOLD") * std::max(0, (getGreatGeneralsThresholdModifier() + 100))) / 100);
    }
    else
....
What's the difference

My snippet was not shown with the proposed change, just the section to change. The change would have been:
PHP:
int CvPlayer::greatPeopleThreshold(bool bMilitary) const
{
    int iThreshold;

    if (bMilitary)
    {
        iThreshold = GC.getDefineINT("GREAT_GENERALS_THRESHOLD") * std::max(0, (getGreatGeneralsThresholdModifier() + 100));
    }
...
}

But having run some more tests I realised that when you look at the GG XP value in the UI everything would be 100x so you would see 200/3000 rather than 2/30. This would require a Python update to resolve so its probably easier to go back to storing the fractional value in the save file.
 
Good observation perhaps but very low importance level. I'm not sure it's worth adding another integer storage to each player but it's not as heavy as for each unit I suppose. It would not make a significant difference to game play.
 
Good observation perhaps but very low importance level. I'm not sure it's worth adding another integer storage to each player but it's not as heavy as for each unit I suppose. It would not make a significant difference to game play.
I agree that it should be classified as very low importance given that it only stores values of less than 1 and after the first couple of GG this amount becomes almost insignificant. I only mention it for completeness as my view is that loading a save game should place you in the same exact same situation as if you had continued to play without the break. Saving the value does not add to game storage requirements as the integer is already allocated in the class it only increases the size of the save file on disk.
 
I agree that it should be classified as very low importance given that it only stores values of less than 1 and after the first couple of GG this amount becomes almost insignificant. I only mention it for completeness as my view is that loading a save game should place you in the same exact same situation as if you had continued to play without the break. Saving the value does not add to game storage requirements as the integer is already allocated in the class it only increases the size of the save file on disk.
Makes sense. It does bug me from an OCD kinda perspective too, which is probably something anyone smart enough to see the point would have at least some of ;) I'm impressed you have the coding skill to notice. Have you considered helping with a few things? Perhaps starting there?
 
I had a look at the Modding Getting started link and it mentions sending my SF login to Koshling to add me as a contributor, but the post is pretty old so wanted to check if that was still the correct process.

I will warn you however that I am not the best at playing with the other children and tend to drift in and out as RL and my desire to have control of how things are done kicks in ... which would tend to suggest I have more that a bit of OCD :)

However, given that I am going through the C2C stuff to steal things for my own mod it is only fair that I put something back so am happy to knock off some of the low hanging fruit for now and we can see where it goes from there.
 
However, given that I am going through the C2C stuff to steal things for my own mod it is only fair that I put something back so am happy to knock off some of the low hanging fruit for now and we can see where it goes from there.
The correct term is "reuse" :lol: as long as you give credit where it is due.
 
Back
Top Bottom