[MOD] v41 SVN and GithubDesktop Bugs and Crashes Single player

Captured cities are named incorrectly in the Event Log.

Steps:
- Capture Goz

Result:
- Messages like "The %building% in the City of Rostov is no longer functioning" are shown in the Event Log. At the same time player does not have a city named Rostov. After clicking on such entries in the Event Log camera is centered on tile on which Goz city was.

Expected result:
- Messages like "The %building% in the City of Goz is no longer functioning" are shown in the Event Log.

v42.0.BETA.6623
Can't reproduce it, I've tried capturing and razing both Goz and Seul. Neither display the message at all either way.

Maybe some BUG option is triggering the message, could you upload your UserSettings folder zipped.
 
Captured cities are named incorrectly in the Event Log.

Steps:
- Capture Goz

Result:
- Messages like "The %building% in the City of Rostov is no longer functioning" are shown in the Event Log. At the same time player does not have a city named Rostov. After clicking on such entries in the Event Log camera is centered on tile on which Goz city was.

Expected result:
- Messages like "The %building% in the City of Goz is no longer functioning" are shown in the Event Log.

v42.0.BETA.6623
Upload user settings
 
Ok, now I got it.
upload_2022-2-17_13-52-47.png


Seems like the city is destroyed first, then the city object, before it's cleared out is further used to produce those messages. The object is halfway uninitialized at that point and cause some unexpected behaviour when used.
Edit: Actually, a new city is created upon capture, even though it will autoraze, looks like some free building given to the new city is checked for disabling before the new city has been given the name of the old city. Meaning the new city has the default name corresponding to your nations next city if founded.
 
Last edited:
Captured cities are named incorrectly in the Event Log.

Steps:
- Capture Goz

Result:
- Messages like "The %building% in the City of Rostov is no longer functioning" are shown in the Event Log. At the same time player does not have a city named Rostov. After clicking on such entries in the Event Log camera is centered on tile on which Goz city was.

Expected result:
- Messages like "The %building% in the City of Goz is no longer functioning" are shown in the Event Log.

v42.0.BETA.6623
Ok, issue is cleared up on my side, but I ended up restructuring a significant amount of code while fixing the issue, more than needed to strictly fix the issue, so it will have to be tested a bit before it can come on SVN.
I.e. when a city is autorazed (when you don't get the choice to keep the city on conquest) it will just be razed with the code restructure, before it would create a copy of itself, destroy itself, and then destroy the copy. This was idiotically convoluted way to go about it (the vanilla way), so I was compelled to change it.
 
Ok, issue is cleared up on my side, but I ended up restructuring a significant amount of code while fixing the issue, more than needed to strictly fix the issue, so it will have to be tested a bit before it can come on SVN.
I.e. when a city is autorazed (when you don't get the choice to keep the city on conquest) it will just be razed with the code restructure, before it would create a copy of itself, destroy itself, and then destroy the copy. This was idiotically convoluted way to go about it (the vanilla way), so I was compelled to change it.
There have been errors in city destruction process forever here - maybe this will clear up quite a bit. Cool!
 
Great Generals and Great Admirals appear in space cities - in fact after building the first cities in space they only appear there, never on earth. You can't do anything with them except settling on spot, no option to move them. Maybe there should be a general option to transport units from space cities but otherways I'd say it is a bug that Great Generals and Admirals appear there.
 
@Toffer90 unit spawning doesn't consider map category of plot
General unit spawning do, but the specific GP/GG creation does not.

Spoiler Great General city spawn scoring :
City with lowest score spawns the great general
Code:
int calculateGreatGeneralSpawnCityScore(const CvCity* city, int numCities)
{
    int iValue = 4 * GC.getGame().getSorenRandNum(numCities, "Warlord City Selection");

    for (int i = 0; i < NUM_YIELD_TYPES; i++)
    {
        iValue += city->findYieldRateRank((YieldTypes)i);
    }
    iValue += city->findPopulationRank();

    return iValue;
}
 
Last edited:
City with lowest score spawns the great general
That seems like the most AI fouling logic ever in itself. Should be the opposite for the sake of the AI which should be as likely to place the GG as a trainer as anything else (that's what 90% of mine become anyhow - and all in the main unit production center - which there IS code to call for that would avoid having to run a city loop evaluation.) When I did Prophets I had them all go to the capital with the similar thinking that the AI would 90% of the time be best to just focus even all the holy city designations onto their primary city as well - eventually I wanted to more deeply consider other city specialties and what religion they'd want and if that religious center would be better in say, a commerce production 'primary city' (New York type city rather than DC.) These kinds of plans to help the AI diversify away from just a singular city of focus haven't yet been put in place to the extent I was meaning to.

But the main point here stands- the general is being spawned in the worst possible place for a general to spawn.
 
But the main point here stands- the general is being spawned in the worst possible place for a general to spawn.
Just like the age old problem with new Religions spawning in the newest, youngest, smallest frontier cities for any empire. For those games that use Multiple Religions Option in BUG.
 
Just like the age old problem with new Religions spawning in the newest, youngest, smallest frontier cities for any empire. For those games that use Multiple Religions Option in BUG.
I felt it was a problem, yes. But after a discussion with Hydro on it, back when I started here, I realized that's a one man's bug is another man's feature sort of issue. That happening is one HUGE reason I did Divine Prophets to begin with, so that I wouldn't have to deal with useless religion placements. I mean sure we could change the algorithm but it seems some people like how that works.:dunno:

Main difference between that and the general spawning is that where the general spawns isn't feeding into more basic AI for placing the general as a trainer in a helpful way at all. With the religious holy city placement issue, it screws up human and ai alike and doesn't require better AI coding to account for it because the damage is fixed from the moment it happens.
 
That seems like the most AI fouling logic ever in itself. Should be the opposite for the sake of the AI which should be as likely to place the GG as a trainer as anything else (that's what 90% of mine become anyhow - and all in the main unit production center - which there IS code to call for that would avoid having to run a city loop evaluation.) When I did Prophets I had them all go to the capital with the similar thinking that the AI would 90% of the time be best to just focus even all the holy city designations onto their primary city as well - eventually I wanted to more deeply consider other city specialties and what religion they'd want and if that religious center would be better in say, a commerce production 'primary city' (New York type city rather than DC.) These kinds of plans to help the AI diversify away from just a singular city of focus haven't yet been put in place to the extent I was meaning to.

But the main point here stands- the general is being spawned in the worst possible place for a general to spawn.
You misunderstand, low score means good city.
The random point addition from number of cities does drift it towards more average cities in general though.

upload_2022-2-18_18-42-2.png

I think the best rank from these two functions is the value zero, or one, not 100% sure which.
Rank 1 (0?) is the highest rank possible. Like a gold medalist finishing at position 1.
 
Last edited:
I have been getting a lot of CTDs after updating to latest SVN, I can upload save but the thing is it seems random and after I load a save it runs fine for a little bit. The other weird thing, for me at least, is that it is happening pre-modern era. Usually the modern era crashes a lot because of all the units that are being built.
 
I have been getting a lot of CTDs after updating to latest SVN, I can upload save but the thing is it seems random and after I load a save it runs fine for a little bit. The other weird thing, for me at least, is that it is happening pre-modern era. Usually the modern era crashes a lot because of all the units that are being built.
Upload save and user settings

It must be some setting causing random crashes.
 
Here you go.
 

Attachments

I have been getting a lot of CTDs after updating to latest SVN, I can upload save but the thing is it seems random and after I load a save it runs fine for a little bit. The other weird thing, for me at least, is that it is happening pre-modern era. Usually the modern era crashes a lot because of all the units that are being built.
I saw a lot of graphic related crashes in a save I had (DirectX crashes), and it was medieval era, lots of knights around.
I think we have some corrupted unit models around for that era, something that overloads something directX related over time somehow.
So my question to you, are these crashes occurring around medieval era?
 
They start then, and have been continuing. I am up to Renaissance Era and still crashing.
 
Back
Top Bottom