Single Player bugs and crashes v36 plus (SVN) - After the 24th of October 2015

Status
Not open for further replies.
Why not return it to the way it was in BtS rather than the modded version we use. It is just displayed at the time it is built and never moves afterwards.
Since Koshling's work on viewports and such, the old way (or the old coding rather) is incompatible. This kind of graphic stuff gets into highly mysterious exe interactions I just can't even guess at understanding.

We'd need Koshling to adjust this to a debugged and workable situation.
 
Need to figure out why it is taking 10 minutes PER TURN?? This is ridiculous, IMPO. . .

I am ONLY on a standard size map, all civs are attacking really 1 civ (light blue, Greece) pic 1

My options are in pic 2

pic 3 is proof everyone is attacking Greece (Russia) also, but only 1 town.

I am in the Ren Era. and Tupi is my civ (Purple)*attached) and i only have Crime fighters and Healers in each city, nothing else.

You are right that this is a crazy long turn. I was extremely surprised as to why, however.

Apparently, I have a number of issues here that probably cannot get addressed until after I do a few basic things that break saves. Those things alone may solve the majority of the issues.

At the core, what is causing the vast majority of the delay here is that the neanderthal player has amassed between 1k and 2k attack units. These units are almost entirely stacked up on his one city. I don't know if this game is a 'peace among ai' game or not or if that would even matter. Ultimately, they are gaining around 10-20 new stone throwers every round and it's added up. Each round, each unit thinks through what it's going to do which is 'fairly' simplistic but adds up to a huge delay.

Issue #1: They are getting a lot of production for what they are building. Why are they building stone throwers???

Issue #2: It appears that they are building Stone Throwers because they lose their technologies and regain them every round. Something's funny about how they work with techs.

Issue #3: They just lost access to resources, perhaps the resources that had allowed them to build atlatls instead?

Issue #4: They should probably get automatic access to neanderthal warriors and those should be a bit more expensive so that they can't build 20 units a round out of a minimally improved city.

Issue #5: They are not gaining any population according to world builder.

We know that there are graphic issues with their city bars that need to be solved by making some changes to the way NPCs are setup that will break saves. It's very possible those changes will fix a lot of the oddities seen in Neanderthal cities like this one and oddities seen in the player data for the Neanderthal player.

There could be some bad code choices made when splitting off Neanders as well and that needs reviewed in light of noticed buggy effects BUT it's hard to want to do that until the above noted save-breaking steps are taken.

I'm holding off on breaking saves until I get caught up to the crashes reported at least.

Anyhow, the prescription for now is:

#1) Stop using Neanderthal Cities. I'll be disabling the option and making it invisible for now.

#2) If you wish to continue playing this game, load it, go into world builder, and destroy the neanderthal city and all the units there. It's in the lower right hand corner of the screen. I wouldn't turn off neanderthal cities as you're far enough into the game that they shouldn't manifest any further ones from here and turning off the option mid-game could cause a big crash problem.
 
Spoiler :
edit 3: Looking at CvCity.cpp, I think I found what's allowing them to spawn both past the limit and with negative crime. The relevant section of code. iCurrentValue is, if I'm reading this correctly, the crime property value in the city. I'm not familiar with the structure of the rest of the code, but I don't believe there's a check on whether Crime is positive or negative before the adjustment for iNumCriminals.
Code:
{
			iCurrentValue -= ((iCurrentValue/10) * iNumCriminals);
		}
		iCurrentValue = std::max(0,iCurrentValue);
Thus, what is happening:
When there's no criminals in the city, iNumCriminals is 0, iCurrentValue is unchanged by the -=, and the second line then zeroes iCurrentValue if it was negative, or leaves it alone if not. No issues here.
When there are more than 10 criminals present in the city but iCurrentValue is negative, we wind up subtracting a negative value of magnitude greater than that of iCurrentValue from it, thus resulting in a positive value. Example, crime is -1000, 15 criminals in the city. The calculation becomes -1000 - ((-1000/10)*15) = -1000 - (-1500) = +500. Thus, we have a negative crime value being flipped to a positive value and passed to the spawning code, while at the same time bypassing the limit.
I can see several potential fixes for this, not sure what would work best in terms of performance or other issues, I'm not actually a programmer. We could simply use a conditional to bypass the entire block of criminal spawn code when crime is negative to begin with. We could rewrite the reduction-per-criminal calculation to multiply instead of decrement (something along the lines of iCurrentValueAdjusted = iCurrentValue * max(0,((iMaxCriminals - iNumCriminals)/iMaxCriminals)) where iMaxCriminals is however many criminals you want the cap at). We could rewrite it to enforce a maximum effective value on iNumCriminals (iCurrentValue -= ((iCurrentValue/iMaxCriminals) * (min(iNumCriminals,iMaxCriminals))
Note that the above is just pseudocode, not actual code, since I don't know C++. Also, I used iMaxCriminals so that if anything crops up in the future or changes are made, we don't all wind up wondering what this mysterious "10" value is meant to be or where it came from, and to make it easier to tweak.

I'm not sure what was allowing it to overshoot in the positive-crime cases, though.
Another thought, this effect probably explains how criminals are spawning without their prerequisite building too. I can't seem to locate the relevant code, but I suspect the spawning code is checking only tech and crime value passed to it from the above to determine what gets spawned, and therefore it doesn't matter that the Crime (Unsanctioned X) doesn't exist in the city, because it thinks it should given the conditions it thinks apply.
 
SVN 9260: There is still a major exploit with SM: Usually when you select a Quality promotion you lose all of your experience points, but when you have a unit that lost promotions (due to upgrading) and select a Quality promotion to replace it, you don't lose any experience. In fact, it is easily possible (as I have seen with my current game) that you can select several Quality promotions at once.

I upgraded a slinger to an archer, lost 5 promotions IIRC, and then I could select 3 Quality promos and 2 star promos to replace it. I ended up with an archer unit with a str of around 23 (elite + 2 :c5capital:), in early Ancient. Of course, after that, the exp points were gone, but that unit will be able to compete for quite some time.

Unfortunately, I don't have a savegame to replay that issue quickly, but I seem to remember that this exploit has been valid for quite some time.

Would it be possible to offer a Quality promo only when it's possible to erase the experience of the unit - which doesn't seem to be the case when you are in the process of replacing lost promos?
Next commit will include a fix to this issue.
 

Another thought, this effect probably explains how criminals are spawning without their prerequisite building too. I can't seem to locate the relevant code, but I suspect the spawning code is checking only tech and crime value passed to it from the above to determine what gets spawned, and therefore it doesn't matter that the Crime (Unsanctioned X) doesn't exist in the city, because it thinks it should given the conditions it thinks apply.

I'll have to look deeper at the second statement here but the portion in the spoiler does seem to be pointing at the issue. I appreciate the effort. It's easily resolved by limiting to 0 if a negative before entering the formula so I'll get right on that.

Each potential spawn is being checked as you see there. That section is in a loop that gets checked for each identified potential spawning unit. I'll have to look at how that gets setup too.
 
You are right that this is a crazy long turn. I was extremely surprised as to why, however.


Anyhow, the prescription for now is:

#1) Stop using Neanderthal Cities. I'll be disabling the option and making it invisible for now.

#2) If you wish to continue playing this game, load it, go into world builder, and destroy the neanderthal city and all the units there. It's in the lower right hand corner of the screen. I wouldn't turn off neanderthal cities as you're far enough into the game that they shouldn't manifest any further ones from here and turning off the option mid-game could cause a big crash problem.

WHEW :whew: had to go back all the way to 18 Jun for this one, ,, , , ,
 
WHEW :whew: had to go back all the way to 18 Jun for this one, ,, , , ,

lol. Yeah... that's how far buried I am here. But I'm catching up fairly quickly I think.
 

Another thought, this effect probably explains how criminals are spawning without their prerequisite building too. I can't seem to locate the relevant code, but I suspect the spawning code is checking only tech and crime value passed to it from the above to determine what gets spawned, and therefore it doesn't matter that the Crime (Unsanctioned X) doesn't exist in the city, because it thinks it should given the conditions it thinks apply.

Code:
		for (std::vector<PropertySpawns>::iterator it = m_aPropertySpawns.begin(); it != m_aPropertySpawns.end(); ++it)
		{
This portion is the loop through the qualified potential spawns that exist in the city. A check is only made if we are looking at a potential spawn.

I looked at the code that handles the removal of a spawn and it looks like it has to be correct so I really am confused by that. I may have to run an ingame test on destroying a spawn source. However, if this isn't working, I shudder to think how many other similarly coded places wouldn't be...
 
[9264] In my current game, something that feels quite strange, monarchy obsoletes sentry posts (except for their defensive bonus). Which means I cannot build enforcers, so I must rely on crime reducing buildings until law enforcement (which I've beelined in research). What's the reasoning behind monarchy obsoleting sentry posts? IMO, law enforcement tech should obsolete it, because a better option is available. I'm guessing who ever made the change that made sentry posts become obsolete with monarchy, he wanted to make the building almost obsolete, but not make the law enforcement units unbuildable.

Edit: Screenshot. http://imgur.com/lK7DgXb Sentry post isn't in the building list and isn't in the buildable buildings. "Obsolete with Monarchy (Except defensive bonus)" isn't entirely true, the building is currently completely obsolete (it's not on the buildings list any more).
This issue is taken care of now. As is some other reported exploits. (They are allowed but not as severely as they were.)
 
SVN 9298

Suddenly I got 83+ Million gold! For no apparent reason. Hehe :)

I got these last year and the year before IIRC, when taking barb cities. I thought this bug was eradicated long time ago?

Gonna look at the autosaves backward if I find the cause.

EDIT: It didn't repeat itself.
 
SVN 9298

Suddenly I got 83+ Million gold! For no apparent reason. Hehe :)

I got these last year and the year before IIRC, when taking barb cities. I thought this bug was eradicated long time ago?

Gonna look at the autosaves backward if I find the cause.

EDIT: It didn't repeat itself.

Never fixed. Just very rare to manifest and since it doesn't repeat, it's almost impossible to find and repair.
 
Are these issues still outstanding?

Sorry, I hadn't been keeping up with the thread.

The Native Culture (Neanderthal) issue was fixed with 9280, the ERA_PREHISTORY -> ERA_FUTURE change (among others).

I'm not sure about the Grand Fire Festival as I don't often go for it. I will start a new game and look into it.

Edit: Yes, it still appears to be an issue. If you build torches in the city first, it is fine. Once you research oil lamps (and have a source of oil - fish, ghee, whale, olive), you can only build oil lamps. Even toggling Hide Replaced Buildings, Hide Obsolete Buildings and Hide Unbuildable buildings, the torches building is still greyed out.

Simple fix would be to allow Torches or Oil Lamps, presuming that is possible.
 
The TXT_KEY_ errors are in the Brackenspore buildings I think. I'll track them down.

edit Yep that is where the problem is. Apparently that screen gets the text from the Building Class whereas everything else gets it from the Building Info. I had mistyped the description in all the Brackenspore buildings. I'll update the SVN later today.
 
Next commit will include a fix to this issue.

Thank you for that fix, but I think that has produced another issue. When you upgrade a unit with a quality promo, you can lose that promo without compensation (I think it happened with an upgrade Spiked Clubman -> Stone Maceman).

Would it be possible to retain exactly the number of quality promos you have? I can certainly understand if it takes a while, but the new problem means you could end up losing your best units.
 
Thank you for that fix, but I think that has produced another issue. When you upgrade a unit with a quality promo, you can lose that promo without compensation (I think it happened with an upgrade Spiked Clubman -> Stone Maceman).

Would it be possible to retain exactly the number of quality promos you have? I can certainly understand if it takes a while, but the new problem means you could end up losing your best units.

hmm... good point. Sounds like I'd need an extra tracker for purely quality promotions and a system that automatically reassigns quality promotions when they are lost due to the foundational quality unitcombat changing. Ok... it's on the list.
 
Now I have even seen a case where the quality promo does nothing but reset the exp counter. Unfortunately, I don't have a save game.
 
Status
Not open for further replies.
Back
Top Bottom