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

They probly do eventually just not as high priority as other tasks. If they need the resource they should make it a higher.
Well then something is critically broken since they don't have copper and thus they can't build resource factories and power plants (Copper wires are needed to build power lines needed to build power plants needed to build resource factories and a lot of Industrial and later era stuff).

I found like at lest 5 unimproved resources if not more outside of vicinity but within borders.
Improving resources should be absolutely highest priority, if they don't have them yet.

Setting resources at 200% of density before generating map fixes that issue, because they improve resources within vicinity without problems at least after Prehistoric era.
That is important resources are 2x more often within vicinity.

I uploaded save earlier, so you could see that they really don't want to improve stuff outside vicinity.

I disabled traits completely in my tests to shut their influence on expansion.
I think leaders have their personality defined somewhere, as some expands more than others.

It is bit weird, that Nightmare AIs don't cover whole Tiny Pangaea (84x56) map (C2C_World map script) by 200th turn.
 
Last edited:
I was somewhat interrupted during my reply yesterday so I had to end my statement a bit early. I'm saying that they probably should make it higher priority to go for those resources they have in borders but don't possess. I'm surprised they don't already. At some point soon I'll keep this flaw in mind and go code diving to take a look - but worker AI is a very large maze of priorities so it's no simple task to correct.
 
I definitely can finish the game with TXT_KEY_CITY_NAME names. No problem.
Yeah, and since the X name is given in the TXT_KEY_CITY_NAME_X, One can quickly go through each city and change the name to X once and the issue will be gone.
Well X is almost correct in most cases, special characters are not given in it and some are shortened versions like TXT_KEY_CITY_NAME_MACHU = Machu Picchu/Pikchu

Edit: Not as simple to do that with AI cities though, WB...
 
Last edited:
I have Never ever dealt with that cache in C2C assets. C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Caveman2Cosmos\Assets\cache. As it is always empty.

I have only ever dealt with the one that is created in C:\Users\"username"\AppData\Local\My Games\Beyond the Sword\cache. And every time I tell a player to delete it's contents their problems with "old stored data" from the last time they played (usually an older version of C2C), goes away.

Are we Clear now?!!! Crickey what a run around this has been! :p

If that is really true you did something wrong because AIAndy changed the caching the svn revision 3127.
Updates
  • Added caching of XML files (activated with a global define, DO_CACHING, in A_New_Dawn_GlobalDefines.xml)
  • Fixed a lot of bugs in the info class serialization methods
  • Added some info class serialization methods (not all yet, all that are used modular are worth it to add in the future at least)

After that change you should have cleaned Caveman2Cosmos\Assets\cache instead of C:\Users\"username"\AppData\Local\My Games\Beyond the Sword\cache.

It's not my fault that you didn't take care about the Caveman2Cosmos\Assets\cache. :crazyeye::crazyeye::crazyeye::crazyeye::crazyeye:
 
If that is really true you did something wrong because AIAndy changed the caching the svn revision 3127.


After that change you should have cleaned Caveman2Cosmos\Assets\cache instead of C:\Users\"username"\AppData\Local\My Games\Beyond the Sword\cache.

It's not my fault that you didn't take care about the Caveman2Cosmos\Assets\cache. :crazyeye::crazyeye::crazyeye::crazyeye::crazyeye:
This may happen if someone was playing vanilla or another mod before.
I'm not sure in case of first starting vanilla BTS and then loading mod - that is when you don't have this "Mod = Caveman2Cosmos" in civ4 BTS ini or generally when you don't launch mod directly.

Even then there is 1 MB cache here, that seems to be discarded when you restart computer - game always loads slower on first launch after starting computer.
C:\Users\"username"\AppData\Local\My Games\Beyond the Sword\cache
It seems to contain only paths to file locations.
 
Last edited:
If that is really true you did something wrong because AIAndy changed the caching the svn revision 3127.


After that change you should have cleaned Caveman2Cosmos\Assets\cache instead of C:\Users\"username"\AppData\Local\My Games\Beyond the Sword\cache.

It's not my fault that you didn't take care about the Caveman2Cosmos\Assets\cache. :crazyeye::crazyeye::crazyeye::crazyeye::crazyeye:

Tell you what I'll just Not say anything about any cache file anymore. As I had absolutely nothing to do with the cache file and it's various locations. Because I am not a python, c++, or SDK modder. Perhaps you should address this to those that do? Would be more relevant don't you think?
 
I mentioned before that I'd been working on some fixes/tweaks for issues in the mod.

I've written a fix for this bug that I reported some time ago.

Modifying CvUnit.cpp from line 13197 onwards:

Code:
	if (!isSpy())
	{
		if (criminalSuccessCheck())
		{
			changeExperience100(100);
			GET_TEAM(getTeam()).changeEspionagePointsAgainstTeam(GET_PLAYER(plot()->getOwnerINLINE()).getTeam(), iPoints);
			GET_TEAM(getTeam()).changeEspionagePointsEver(iPoints);
			if (pCapital != NULL)
			{
				setXY(pCapital->getX(), pCapital->getY(), false, true, true, false, false);
			}
			finishMoves();
		}
		else
		{
			finishMoves();
		}
	}

Source file with changes applied is attached also.
 

Attachments

  • CvUnit.zip
    216.8 KB · Views: 50
I've also made some tweaks to CvRandomEventInterface.py.

In the attached file, I've updated all the building destruction events (e.g. hurricane, fire) so that they can no longer target buildings that are obsolete/replaced, or buildings that are autobuilt, as was discussed in this thread.
 

Attachments

  • CvRandomEventInterface.zip
    40.8 KB · Views: 28
Also I would prefer:
if (pAdjacentPlot->getOwnerINLINE() == NO_PLAYER)instead of this:
if (pAdjacentPlot->getCulture(getOwnerINLINE()) < iAdjCulture)
So that the culture is only added to neutral plots, and not added to plots owned by other players.
Then that code does only what it is meant to do, claiming the neutral land in the first rung around the city the moment it is founded.

I just want to clear something up here. In reading setCulture, it only adds the 1 culture for the player but does not have any code to remove the culture from any player that currently owns it, so this call is not automatically asserting that the owner of the new city owns those plots. Just in case, since it's a set command rather than a change command, you were thinking that it would do that.

I mentioned before that I'd been working on some fixes/tweaks for issues in the mod.

I've written a fix for this bug that I reported some time ago.

Modifying CvUnit.cpp from line 13197 onwards:

Code:
    if (!isSpy())
    {
        if (criminalSuccessCheck())
        {
            changeExperience100(100);
            GET_TEAM(getTeam()).changeEspionagePointsAgainstTeam(GET_PLAYER(plot()->getOwnerINLINE()).getTeam(), iPoints);
            GET_TEAM(getTeam()).changeEspionagePointsEver(iPoints);
            if (pCapital != NULL)
            {
                setXY(pCapital->getX(), pCapital->getY(), false, true, true, false, false);
            }
            finishMoves();
        }
        else
        {
            finishMoves();
        }
    }

Source file with changes applied is attached also.
Adjusted a little:
Code:
    if (!isSpy())
    {
        if (criminalSuccessCheck())
        {
            changeExperience100(100);
            GET_TEAM(getTeam()).changeEspionagePointsAgainstTeam(GET_PLAYER(plot()->getOwnerINLINE()).getTeam(), iPoints);
            GET_TEAM(getTeam()).changeEspionagePointsEver(iPoints);
            if (pCapital != NULL)
            {
                finishMoves();
                setXY(pCapital->getX(), pCapital->getY(), false, true, true, false, false);
            }
            else
            {
                finishMoves();
                kill(true, NO_PLAYER, true);
            }
        }
        else
        {
            finishMoves();
        }
    }
    else
    {
        GET_TEAM(getTeam()).changeEspionagePointsAgainstTeam(GET_PLAYER(plot()->getOwnerINLINE()).getTeam(), iPoints);
        GET_TEAM(getTeam()).changeEspionagePointsEver(iPoints);
        kill(true, NO_PLAYER, true);
    }
I'd forgotten all about this since this ticket came in when I was taking a break. So thanks for bringing it back up!

I've also made some tweaks to CvRandomEventInterface.py.

In the attached file, I've updated all the building destruction events (e.g. hurricane, fire) so that they can no longer target buildings that are obsolete/replaced, or buildings that are autobuilt, as was discussed in this thread.
Looks good. I've got the dlls building with the other fixes now and will include this in my commit. Thanks but got it Kation!
 
I just want to clear something up here. In reading setCulture, it only adds the 1 culture for the player but does not have any code to remove the culture from any player that currently owns it, so this call is not automatically asserting that the owner of the new city owns those plots. Just in case, since it's a set command rather than a change command, you were thinking that it would do that.
No, I was thinking that it gave 1 free culture to tiles for no good reason as the plots wouldn't change owners anyway.
The only point of that code is to make the neutral plots around a city owned by the player that settles the city the moment the city is settled, not to add free culture to plots that are already owned by another player.

Doesn't really matter to any interpretation whether it is named "set" or "change" in this instance as it will only be used when the current culture value for the plot equals zero.
 
when the current culture value for the plot equals zero.
When the culture value from the player founding the city in that plot equals zero.
if (pAdjacentPlot->getCulture(getOwnerINLINE()) < iAdjCulture)

Not that it really matters either way much but:
No, I was thinking that it gave 1 free culture to tiles for no good reason as the plots wouldn't change owners anyway.
Could change ownership if the current tile owner was down to 1 culture in that plot, which might have taken place from some decay, or from a fort that has only given 1 culture to that plot. I'm not sure how it would determine the plot owner in a tie.
 
When the culture value from the player founding the city in that plot equals zero.
if (pAdjacentPlot->getCulture(getOwnerINLINE()) < iAdjCulture)
In this case iAdjCulture = 1 which means it will only add it if it is already zero, therefore the typical logical difference between a set and change function would be irrelevant.
Not that it really matters either way much but:
Could change ownership if the current tile owner was down to 1 culture in that plot, which might have taken place from some decay, or from a fort that has only given 1 culture to that plot. I'm not sure how it would determine the plot owner in a tie.
Well, it can happen, and then the code would in my opinion do something that it's not supposed to do, it would be a bug. ^^
 
Well, it can happen, and then the code would in my opinion do something that it's not supposed to do, it would be a bug. ^^
Naw... incoming culture from a new city should override old, not so strong culture in self and adjacent plots imo. I wouldn't be against enforcing ownership of initial plots surrounding the city immediately upon founding just to make sure the city has something to feed on. Of course, then it can fight any other sources of culture pushing against those plots and since it's a young city it should be soon overwhelmed and the city lost to cultural conquest. Without bolstering the heck out of it.
 
Naw... incoming culture from a new city should override old
Well, I'm of the opinion that it should always take more than 0 turn for a city to overwhelm another players national border with culture no matter what the circumstance. A new city has no incoming culture, it claims neutral plots without having any heritage claim on it, that's why I think the setOwner function should be used for that instead of the setCulture function.
 
Adjusted a little:
Code:
        if (criminalSuccessCheck())
        {
            changeExperience100(100);
            GET_TEAM(getTeam()).changeEspionagePointsAgainstTeam(GET_PLAYER(plot()->getOwnerINLINE()).getTeam(), iPoints);
            GET_TEAM(getTeam()).changeEspionagePointsEver(iPoints);
            if (pCapital != NULL)
            {
                finishMoves();
                setXY(pCapital->getX(), pCapital->getY(), false, true, true, false, false);
            }
            else
            {
                finishMoves();
                kill(true, NO_PLAYER, true);
            }
        }

I thought the conclusion when I initially reported the bug was that criminal units are not supposed to call kill() when they fail a criminal check?
 
Well, I'm of the opinion that it should always take more than 0 turn for a city to overwhelm another players national border with culture no matter what the circumstance. A new city has no incoming culture, it claims neutral plots without having any heritage claim on it, that's why I think the setOwner function should be used for that instead of the setCulture function.
I guess it depends on the definition you assign to culture. I'm thinking the city comes with an immediate infusion of culture into the area as it's settlers move into the area, laying personal claim to the region wherever they build their homes. Not ALL of them would choose to live directly in the middle of town. Many would want to put their homes close to the city but on the plots of land they will be wanting to work and raise their families. If there is one small overlap with another culture then the region would go into an immediate dispute of course. If there's not much national pride to the few hillbillies that live there, they'd probably gravitate immediately to more commonly using the closer city's resources, and would thus consider themselves a part of that community right away.

I thought the conclusion when I initially reported the bug was that criminal units are not supposed to call kill() when they fail a criminal check?
Only under one condition, and that's if they don't have a capital to go home to. At that point, they just vanish. It shouldn't ever happen anyhow with this command because if they don't have a capital, they probably shouldn't be able to perform the mission at all, but if they do, this is just to say they got out of there and become a non-factor to anyone forever. Barbarian criminals might do this if they become wanted perhaps.

Perhaps it should get a "wanted" promotion when failing...
That's what happens. It's a built-in portion of the criminalSuccessCheck() processing.
 
Only under one condition, and that's if they don't have a capital to go home to. At that point, they just vanish. It shouldn't ever happen anyhow with this command because if they don't have a capital, they probably shouldn't be able to perform the mission at all, but if they do, this is just to say they got out of there and become a non-factor to anyone forever. Barbarian criminals might do this if they become wanted perhaps.

Right you are, I misread the logic on that conditional.
 
Top Bottom