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

I don't use Start As Minors because of the problems it creates for the AI (always being in a War state and never developing their cities). Or at least it used to do so. I'm not sure if T-brd fixed it or not. Was talked about over a year ago.

I also do not use Barb Civ because of the extra Civs it creates and slows down the game.

In my Civic Test game with Barb World the barbs have plenty of units out and about. And if you come into their territory you will get attacked. And this is also an Emperor Difficulty game too. 8 AI on a Large C2C_World map, low seas, temperate, Start everywhere.
 
I am using latest svn build: 10536

Late in the game (Nanotech era), user thread is consuming a lot of CPU during my (users) turn, so that the UI is almost completely unresponsive. Examining the callstack of the main thread I see "CvGameCoreDLL.dll!CvGame::handleDiplomacySetAIComment" all the time. Why is there Diplomacy stuff going on during user's turn when no diplomacy dialogs are even displayed?

This has been happening with the previous build (from around 3 weeks ago), I updated to the latest build (mid-game), and it continues to happen even with the latest build.

Let me know if you need a savegame or more info.
 
I am using latest svn build: 10536

Late in the game (Nanotech era), user thread is consuming a lot of CPU during my (users) turn, so that the UI is almost completely unresponsive. Examining the callstack of the main thread I see "CvGameCoreDLL.dll!CvGame::handleDiplomacySetAIComment" all the time. Why is there Diplomacy stuff going on during user's turn when no diplomacy dialogs are even displayed?

This has been happening with the previous build (from around 3 weeks ago), I updated to the latest build (mid-game), and it continues to happen even with the latest build.

Let me know if you need a savegame or more info.
Nice to see player going that far in game.

Upload save.

By the way are you playing on space map scenario?
 
@raxo2222

No, just playing regular random map from the very beginning. I attached the savegame. But, it's been like this for the last 30 or so turns at least.
 

Attachments

  • QuickSave.CivBeyondSwordSave.zip
    9.7 MB · Views: 136
@raxo2222

I attached the savegame. But, it's been like this for the last 30 or so turns at least.
I think something failed, as I don't see attached save.

You need to click "more options" to add attachment to edited post.
 
Just fixed it. Sorry. Took a while to upload.
Mod folder MUST be Caveman2Cosmos otherwise bugs will happen.
Spoiler :
Civ4BeyondSword 2019-04-17 18-41-18-11.jpg
 
Mod folder MUST be Caveman2Cosmos otherwise bugs will happen.
For this reason it's going to be hard to identify the problem. The diplomacy call is probably for the scoreboard. Hard to say what might be causing a lot of slowdown during the screen refreshing but we've seen some of that before.
 
@raxo2222, @Thunderbrd

Hopefully the issues I am experiencing in regards to slowdowns and hangs have nothing to do with the changed folder location. For the next game, I will try to remember to rename it back to the default.

@Thunderbrd

I also would like to once again bring to your attention frequent hangs (almost every turn in the later game) when AI is processing movements. This happens in the "CvSelectionGroup.cpp\CvSelectionGroup::updateTimers()" within "while (true)" loop. I have to manually jump out of the routine in the debugger to force the turn to end. Perhaps you can add a simple hack with a counter, so that the loop would also check counter value being less than a certain threshold (instead of just running forever)? I have been stumbling across this for the last couple of years in almost every single game.
 
Just realized that you should be able to make a junction or symbolic link in the parent folder of 'Caveman2Cosmos' named 'C2C' that points to 'Caveman2Cosmos'. That way the game should load fine. Once again sorry about this, will change the folder to default next game.
 
Just realized that you should be able to make a junction or symbolic link in the parent folder of 'Caveman2Cosmos' named 'C2C' that points to 'Caveman2Cosmos'. That way the game should load fine. Once again sorry about this, will change the folder to default next game.
Nice trick, had to google it though.
PPIO is fine with it too it seems.

I got like 5 FPS here lol.
 
Last edited:
"CvSelectionGroup.cpp\CvSelectionGroup::updateTimers()" within "while (true)" loop.
Well, yeah, that function is basically the AI taking a turn. It's probably bouncing back and forth on a particular unit getting caught in a loop until it's short circuited or something. I know there are still some bad spots that cause some hangs that need to be sorted out. If you had the mod folder labeled correctly, I'd ask for your save on these. As it is, it's too inconvenient to get setup to debug a differently named mod file.
Perhaps you can add a simple hack with a counter, so that the loop would also check counter value being less than a certain threshold (instead of just running forever)?
This is what I mean by short circuiting. There are reasons these turns don't get stuck forever and it's pretty much this suggestion in action.

I've tried hacks to the mod name before and they didn't work to do anything but crash the game on load. Toffer said he had the same problem with that as well so I didn't try TOO hard to sort it out further when that's what happened with my efforts.
 
Well, yeah, that function is basically the AI taking a turn. It's probably bouncing back and forth on a particular unit getting caught in a loop until it's short circuited or something. I know there are still some bad spots that cause some hangs that need to be sorted out. If you had the mod folder labeled correctly, I'd ask for your save on these. As it is, it's too inconvenient to get setup to debug a differently named mod file.

That slowdown is caused by changes made in the svn revision 9335. I always had some trouble understanding those changes maybe you remember why you made them?
 
That slowdown is caused by changes made in the svn revision 9335. I always had some trouble understanding those changes maybe you remember why you made them?
Sounds like he introduced a bug by accident :lol:
This revision was back in 2016.
 
That slowdown is caused by changes made in the svn revision 9335. I always had some trouble understanding those changes maybe you remember why you made them?
9335
  • Major savegame breaking adjustment to the manner in which the separation of NPC players is established. Fixes a number of issues with them that exist. Some aspects of this still need some further testing to ensure all is running as intended but so far, after extensive testing, it seems correct.
  • Adopts some code fixes from the main PBEM game.
I'm not sure what exact code line changes you're referring to but if I'm recalling, based on these notes (I can't look at the log compares at the moment), it may involve a fix to the free tech popup not coming up when it should? Even if I was to look at the code changes themselves, which lines in particular are you pointing at?

Sounds like he introduced a bug by accident
I cannot tell you how often a bug is just the fix of a different problem.
 
Last edited:
I'm not sure what exact code line changes you're referring to but if I'm recalling, based on these notes (I can't look at the log compares at the moment), it may involve a fix to the free tech popup not coming up when it should? Even if I was to look at the code changes themselves, which lines in particular are you pointing at?

The changes to CvSelectionGroup::updateTimers() cause what george585 reported and the same changes where made in other places as well. I attached a modified save from his game that you can use to see the effect of those changes. I think those changes where meant to fix the MP game but that real issue was fixed later in the FFreeListTrashArray.

also would like to once again bring to your attention frequent hangs (almost every turn in the later game) when AI is processing movements. This happens in the "CvSelectionGroup.cpp\CvSelectionGroup::updateTimers()" within "while (true)" loop. I have to manually jump out of the routine in the debugger to force the turn to end. Perhaps you can add a simple hack with a counter, so that the loop would also check counter value being less than a certain threshold (instead of just running forever)? I have been stumbling across this for the last couple of years in almost every single game.
 

Attachments

  • QuickSave.7z
    9.6 MB · Views: 96
I'm not sure what exact code line changes you're referring to but if I'm recalling, based on these notes (I can't look at the log compares at the moment), it may involve a fix to the free tech popup not coming up when it should? Even if I was to look at the code changes themselves, which lines in particular are you pointing at?
Free tech popup wasn't fixed at all - that is if you get multiple free techs in single turn, then still you can choose only one free tech.

Most likely he was referencing stuff in selection group, as that thing was reported.
 
Free tech popup wasn't fixed at all - that is if you get multiple free techs in single turn, then still you can choose only one free tech.
At the time you wouldn't get it at all. I know that it won't take 2 at once but before this it wasn't working flat out.

The changes to CvSelectionGroup::updateTimers() cause what george585 reported and the same changes were made in other places as well. I attached a modified save from his game that you can use to see the effect of those changes. I think those changes were meant to fix the MP game but that real issue was fixed later in the FFreeListTrashArray.
I'll take a look at the actual code changes as soon as I can. Changes to updateTimers were made as a fix to the free techs not triggering and had nothing to do with the indexing of units, which was a later problem.
 
I'll take a look at the actual code changes as soon as I can. Changes to updateTimers were made as a fix to the free techs not triggering and had nothing to do with the indexing of units, which was a later problem.
OK, I'll trust your assessment on this @alberts2. This was not the segment I recall that I was talking about for fixing the popup and I can definitely believe that this was an incorrect fix, looking back on this. (How in the hell did you identify this???) If you're saying that a later fix corrected the problem, which I believe is true, then this is probably indeed one of those vestigal fix attempts that should've been reverted after the real fix was found but became a lost and forgotten step. I seem to recall thinking that a change like this needed to be reverted later but then forgetting what exactly it was that needed to be corrected. I'll take care of this and then run some tests here since I have another project wrapping up here.
 
Free tech popup wasn't fixed at all - that is if you get multiple free techs in single turn, then still you can choose only one free tech.
I second that. In fact I think I reported that too last year, if I recall correctly. I was supposed to get 2 free techs in one turn (I think one was due to completing a Wonder, the other due to researching a tech), but got only one in then end.
 
Top Bottom