Single Player bugs and crashes v38 plus (SVN) - After the 20th of February 2018

@KaTiON_PT: I found a new dll oddity.

Spoiler 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
{
iThreshold = ((GC.getDefineINT("GREAT_PEOPLE_THRESHOLD") * std::max(0, (getGreatPeopleThresholdModifier() + 100))) / 100);​
}

iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent();
if (bMilitary)
{

iThreshold /= std::max(1, GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getTrainPercent());
}
else
{

iThreshold /= 100;
}

iThreshold *= GC.getEraInfo(GC.getGameINLINE().getStartEra()).getGreatPeoplePercent();
iThreshold /= 100;


return std::max(1, iThreshold);​
}
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Look like great generals/hunters are not scaled by gamespeed correctly.

I think the bold part above should be like this

if (bMilitary)
{

iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getTrainPercent());
}
else
{

iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent();
}
iThreshold /= 100;
I think @Thunderbrd could have doing somewhere here.
 
I think @Thunderbrd could have doing somewhere here.
It is currently set up so that the military great person threshold don't scale by gamespeed, if that is what we want then the bit I pointed to could be changed:
Spoiler dll code :
FROM:
iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent();
if (bMilitary)
{

iThreshold /= std::max(1, GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getTrainPercent());
}

else
{

iThreshold /= 100;
}
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
TO:
if ( ! bMilitary)
{

iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent() / 100;
}
Those two code snippets in the spoiler above currently have identical results.
Currently GamesSpeed.getGreatPeoplePercent is the same value as GamesSpeed.getTrainPercent.
So iThreshold * X / X = iTreshold

Of course, if we generally don't want great military persons gain to scale by gamspeed, and if we want training time and great person gain to scale differently by gamespeed, then the current abnormal gamespeed scaling is in a way optimal.

We all know there are more combats during a long gamespeed game than in a short gamespeed game, so I think there should be some scaling at least. perhaps it should be dampened a bit.
Here's an example of how it could be dampened:
Spoiler dll code :
if (bMilitary)

{
iThreshold *= (80 + GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent() / 5);
}

else
{

iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent();
}
iThreshold /= 100;


If we want it to act the same way for getGreatPeoplePercent values below 100 as it does for those at, and above, 100 then it must be changed like so:

int iTemp = GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent()
if iTemp != 100
{

if (bMilitary)
{

int iDampening = 5
if iTemp < 100
{

iThreshold *= 100 - 2 * (100 - iTemp) / iDampening;
}
else
{

iThreshold *= 100 + (iTemp - 100) / iDampening;
}
}
else
{

iThreshold *= iTemp;
}
iThreshold /= 100;
}
The last example in the spoiler above is the code form I would prefer the most.
The dampening factor is very easy to adjust the way I mathematically set it up. It could be made a global define in XML if we need it.
 
Last edited:
Watchers and Enforcers can't get Policing II after Dualism either (Town Watchmen can). I hope this can be confirmed as a bug rather than an 'undocumented feature'.

That is the way ThunderBrd set them up. Any LE unit can not upgrade Past their Era entry level when a New Era level LE unit becomes available. It is designed to make you upgrade, Either thru building the New units outright or spending money to upgrade as you have noted.

There was a period of time that you could not even build older obsolete LEs in new cities that did not have the preq buildings built to build the new.

This was all documented around the time of v38 or v38.5.

Hope I was clear enough. If not PM T-Brd to get a proper explanation.
 
Watchers and Enforcers can't get Policing II after Dualism either (Town Watchmen can).
This is a feature and it is documented in the v38.5 player's guide. When a unit could take a promotion of a property control nature that is tech unlocked in a later era than the unit itself was qualified for, it becomes possible to get a better cost efficient gold upkeep to property control ratio to staff more under-tech-concurrent units and compensate that with promotions. This was, for now, an easy way to fix the problem. If your unit was tech qualified in the Ancient era, it can ONLY take promotions for property control that were also tech qualified in the Prehistoric and Ancient eras.

Here's a save where Storytellers can't get Educate II well after Community.
I'll take a look at why this is.
 
It is currently set up so that the military great person threshold don't scale by gamespeed, if that is what we want then the bit I pointed to could be changed:
Spoiler dll code :
FROM:
iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent();
if (bMilitary)
{

iThreshold /= std::max(1, GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getTrainPercent());
}

else
{

iThreshold /= 100;
}
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
TO:
if ( ! bMilitary)
{

iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent() / 100;
}
Those two code snippets in the spoiler above currently have identical results.
Currently GamesSpeed.getGreatPeoplePercent is the same value as GamesSpeed.getTrainPercent.
So iThreshold * X / X = iTreshold

Of course, if we generally don't want great military persons gain to scale by gamspeed, and if we want training time and great person gain to scale differently by gamespeed, then the current abnormal gamespeed scaling is in a way optimal.

We all know there are more combats during a long gamespeed game than in a short gamespeed game, so I think there should be some scaling at least. perhaps it should be dampened a bit.
Here's an example of how it could be dampened:
Spoiler dll code :
if (bMilitary)

{
iThreshold *= (80 + GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent() / 5);
}

else
{

iThreshold *= GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent();
}
iThreshold /= 100;


If we want it to act the same way for getGreatPeoplePercent values below 100 as it does for those at, and above, 100 then it must be changed like so:

int iTemp = GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGreatPeoplePercent()
if iTemp != 100
{

if (bMilitary)
{

int iDampening = 5
if iTemp < 100
{

iThreshold *= 100 - 2 * (100 - iTemp) / iDampening;
}
else
{

iThreshold *= 100 + (iTemp - 100) / iDampening;
}
}
else
{

iThreshold *= iTemp;
}
iThreshold /= 100;
}
The last example in the spoiler above is the code form I would prefer the most.
The dampening factor is very easy to adjust the way I mathematically set it up. It could be made a global define in XML if we need it.
I'm not against any rethinking or retooling here but if someone else is going to work on that, I have an additional request - Team play suffers for sharing the same threshhold for Great People and Great Military People. It's something Whisperr and I have been finding more and more annoying over time is that when one of us gets either type, the other suddenly has so much longer a road to go and then if the other player is that much faster, they can sometimes reach the next one long before you do... it tends to lead to the feeling of unfairness and since we've removed any tech cost benefits for teams against non-team players, it also seems natural to keep all players maintaining their own threshold amounts.
 
I'm not against any rethinking or retooling here but if someone else is going to work on that, I have an additional request - Team play suffers for sharing the same threshhold for Great People and Great Military People. It's something Whisperr and I have been finding more and more annoying over time is that when one of us gets either type, the other suddenly has so much longer a road to go and then if the other player is that much faster, they can sometimes reach the next one long before you do... it tends to lead to the feeling of unfairness and since we've removed any tech cost benefits for teams against non-team players, it also seems natural to keep all players maintaining their own threshold amounts.
Interesting sentiment, I think I agree.

This is the code that makes it work like that:
if (bIncrementExperience)
{
incrementGreatGeneralsCreated();

changeGreatGeneralsThresholdModifier(GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * ((getGreatGeneralsCreated() / 10) + 1));

for (int iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).getTeam() == getTeam())
{
GET_PLAYER((PlayerTypes)iI).changeGreatGeneralsThresholdModifier(GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE_TEAM") * ((getGreatGeneralsCreated() / 10) + 1));​
}​
}​
}
Interesting thing though is that it increase the threshold first for the player that actually gets the GP and then once for everyone on the team including the one that got the GP.
So it increases the threshold twice as much for the player that get the GP than for the others on the team...

Could be changed to:
if (bIncrementExperience)
{
incrementGreatGeneralsCreated();
changeGreatGeneralsThresholdModifier(GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * (getGreatGeneralsCreated() / 5 + 2));​
}
 
You're really needing to start programming in C++ as well, Toffer. You're getting pretty good at finding this stuff. I'm too sick at the moment to do this myself but it does seem to check out (except that the +2 needs to be after a ) because the +1 was there primarily if the getGreatGeneralsCreated() function returns a 0).

I imagine it would be pretty easy to then find the code for great people in general as well.
 
I imagine it would be pretty easy to then find the code for great people in general as well.
Yes, it's in the same function as the code snippet I showcased was from.
except that the +2 needs to be after a ")" because the +1 was there primarily if the getGreatGeneralsCreated() function returns a 0.
I'm pretty sure that C++ code does the divide and multiplication before it does the addition, so the +2 doesn't need to be separated from "getGreatGeneralsCreated() / 5" with paranthesis.

These three should be equivalents afaik:
GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * ((getGreatGeneralsCreated() / 5) + 2)
GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * (getGreatGeneralsCreated() / 5 + 2)
GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * (2 + getGreatGeneralsCreated() / 5)
 
I'm pretty sure that C++ code does the divide and multiplication before it does the addition, so the +2 doesn't need to be separated from "getGreatGeneralsCreated() / 5" with paranthesis.

These three should be equivalents afaik:
GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * ((getGreatGeneralsCreated() / 5) + 2)
GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * (getGreatGeneralsCreated() / 5 + 2)
GC.getDefineINT("GREAT_GENERALS_THRESHOLD_INCREASE") * (2 + getGreatGeneralsCreated() / 5)
Perhaps that is true and I can see why that would be, but it still helps to communicate the purpose of the addition to use the first form. That and there would be little reason to use a +2 over a +1 except to directly mimic the previous formulas combined, but I suppose we might as well since it is for that purpose.
 
Here's a save where Storytellers can't get Educate II well after Community.

Watchers and Enforcers can't get Policing II after Dualism either (Town Watchmen can). I hope this can be confirmed as a bug rather than an 'undocumented feature'. The proliferation of meaningless units doesn't help anyone, and I personally don't have money to burn on all the upgrades currently.
Ok, so this is something I could repair with some ease but is going to just lead to another report of a similar nature later on.

As explained earlier, if a unit with property control values is qualified for in an era previous to the era that the property control promotion is tech-accessed, the unit must be upgraded to a unit that is qualified for in the same or later era as the promotion.

This is what is making it impossible for Storytellers (accessed during the Prehistoric) to take the Educate II promotion (unlocked in the Ancient era).

This works fine with the law enforcement and disease control but presents a bit of an issue for the education units because they aren't designed to pretty much have an upgrade every era. Yet there's pretty close to a new education promotion every era and in this case, the promotion is unlocked at the beginning of the ancient while the Bard, unlocked in the Ancient as well, is accessed at the end of the Ancient era. So I could change it so that the new education promotion is unlocked when the bard is, at Linguistics, but then it will take a lot more evaluation of later promos of this sort and currently this means that many of the education promotions are completely unavailable because they are made possible in later eras than the last entertainer unit.

All this is a patch for a fix we've discussed previously about making the units have a stronger base but introducing another or stronger base property influences to control. The problem with this is that we have an astonishingly good balance right now and I'm scared to throw that out of whack. But DH has a good idea as to another source of influence on Disease and I think it can and should be extended to Crime and perhaps with those in place we can enhance the base control values on units enough to remove this restriction on what promos they can take (or perhaps allow the next era's unlocked promos at least.)

I've also been discussing with DH that we should be splitting up the entertainer line, at the point that the chain currently ends, into Educators and Entertainers and have entertainers actually start to be a detractor to education but capable of counteracting the negative impacts of low education so that low education can strategically be utilized as a strategy for preparation for war or civic changes. Then we'd have Educating units like teachers and professors that are entirely for the purpose of enhancing education. Current entertainer units could upgrade to either line past the highest upgrade they have possible now.

Not a project for the faint of heart of course.

In the meantime, I'll see if perhaps I can't isolate education from this 'rule'. It might still violate the REASON for the rule, which is to keep players from exploiting the cheaper older units with more promos and getting better overall property control per upkeep cost by resisting the urge to upgrade and just training more of the cheaper units.

EDIT:
Actually I just discovered that conveniently this is much more within individual control on promotions than I had recalled making it have. I can eliminate this effect on educational promos entirely and if some others are a bit too restrictive, I can individually make adjustments as to which era the units must be unlocked in for the promotion to be valid for. So that's a good thing :) Much easier to control.
 
Last edited:
Just upgraded to SVN 10255 and now all the screens are missing including the mini-map. Any ideas?
I just tested on my end and I'm not having this problem. Are you using Toffer's display modmod and have you errored in not updating it since your last SVN update? See his thread's most recent comments for details on this - just came up. If you're not using his modmod at all then I suspect you either have the whole problem that comes from renaming the mod folder something other than caveman2cosmos or you may need to be running in admin mode. Or something else entirely, I dunno. See if any of those sound accurate.
 
I just tested on my end and I'm not having this problem. Are you using Toffer's display modmod and have you errored in not updating it since your last SVN update? See his thread's most recent comments for details on this - just came up. If you're not using his modmod at all then I suspect you either have the whole problem that comes from renaming the mod folder something other than caveman2cosmos or you may need to be running in admin mode. Or something else entirely, I dunno. See if any of those sound accurate.

Thx TB!
The thing that worked was "Running as Admin."

The mod folder name is correct and I haven't tried Toffer's modmod (unless it comes with an SVN update). Recently upgraded to Windows 10 and have been playing C2C since then without incident - with only one small thang: whenever I initiated the mod, some small window popped up saying something about RI not installed. Guessing now I was pointing at the wrong file?

Anyway, many thanks!
 
Sorry that VS2017 didn't work. I'm not sure what went wrong with that build output you gave. I couldn't reproduce unfortunately :(
 
Sorry that VS2017 didn't work. I'm not sure what went wrong with that build output you gave. I couldn't reproduce unfortunately :(
Ill be upgrading to win10 within weeks here and I shall try again. Might have something to do with it. There's a lot of download options with the vs2017 and i have to think it was one of those that i didn't download that caused me a problem.

I am super impressed you got 2017 to work for u tho. Seems like it might be faster and have some real improvements.
 
Ill be upgrading to win10 within weeks here
Be prepared for win 10 to make changes that you don't want and will need to revisit with every "upgrade" that it puts out. Also the paths to the way things were done in win 7 are more obscure in win 10. Takes more hunting thru layers to find and change what you like. Microsoft "knows" best you know. :p

I Had to go back to win 10 after reverting back to win 7 because the 2 "keys" I had for win 7 became invalid After I switched back to 7. Even though both were initially accepted. it was not until 3 months after each key change that I became notifified by MS that my keys were being rejected. Had to get my IT son-in-law involved to fix the problem and that meant going back to win 10. Keys are now digital and having a Microsoft account a necessity, not an Option as it was when 10 was being handed out for free. Today's change is...….Microsoft want full control of your computer......:cringe::(:mad:
 
Be prepared for win 10 to make changes that you don't want and will need to revisit with every "upgrade" that it puts out. Also the paths to the way things were done in win 7 are more obscure in win 10. Takes more hunting thru layers to find and change what you like. Microsoft "knows" best you know. :p

I Had to go back to win 10 after reverting back to win 7 because the 2 "keys" I had for win 7 became invalid After I switched back to 7. Even though both were initially accepted. it was not until 3 months after each key change that I became notifified by MS that my keys were being rejected. Had to get my IT son-in-law involved to fix the problem and that meant going back to win 10. Keys are now digital and having a Microsoft account a necessity, not an Option as it was when 10 was being handed out for free. Today's change is...….Microsoft want full control of your computer......:cringe::(:mad:
I hate that stuff too which is a major reason for being reluctant up to now. But I'm upgrading my computer system significantly and I figure I might as well bend to the march of time here. I'm sure I'll be asking about how to navigate some of these matters you mention. Is there anything I should know about with the mod?
 
I hate that stuff too which is a major reason for being reluctant up to now. But I'm upgrading my computer system significantly and I figure I might as well bend to the march of time here. I'm sure I'll be asking about how to navigate some of these matters you mention. Is there anything I should know about with the mod?
I think @KaTiON_PT or @Toffer90 have windows 10 too.
 
I also have Win 10. I don't have a Microsoft account even though for awhile there they wanted us to have one to play Minecraft. My problems have been related to SSDs rather than Windows.
 
Top Bottom