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

Status
Not open for further replies.
@Joe:
I just realized as I was reviewing the traits tags that we have iCityStartCulture there!

What this means is that (if this is working properly) we can use this tag to give the barbarian and neanderthal leaders enough culture to pop their primary 8 tiles whenever they found a city and wash our hands of any complexities in that issue whatsoever. Easy peasy.
 
Hooboy. Somewhere in my attempts to abuse the ability to arrest your own criminals, something went horribly wrong. First, I demolished the required buildings to train various criminals until I got to the lowest-cost trainable criminal I could. Starting at early Transhuman/Late Modern, I wound up demolishing a Meth Lab, Mob Storefront, Motorcycle Club, Highwayman's Hideout, and Saloon. Possibly another building as well, but in any case I ended up at Scoundrels (17 str) as my cheapest trainable and arrestable criminal. I proceeded to spend a turn alt-training them in my capital, which wound up being around a dozen or so, then sat them there to become Wanted.

The first few turns went smoothly enough, with 2-3 arrested per turn. Then, suddenly, somewhere around 5-10 new criminals started spawning every turn and immediately attacking units in the city (without leaving it), as well as leaving the city and pillaging the countryside. This included attacking ships in the city, and the successful attacking of any ship instantly resulted in all capturable/defenseless units in the city being destroyed as though the city was conquered. Note that this entire time the Crime level in the city has been between -9000 and -11000 or so. I loaded an autosave from before the craziness in order to evacuate all the Great People from the city, and surrounded the city itself with a ring of Viet Cong (Machinegun UU) to hopefully keep the criminals contained. Since then, they've been continuing to spawn at a rate of 5-10 per turn and sometimes directly attacking other units in the city. It actually looks like they're going after whatever the first unit in the list is, so any ships or aircraft present get attacked first, and if there's no ships then my Modern Armors get attacked.

The spawning units include Assassins (8 str), Cutthroats (12 str), Scoundrels (17 str), Mobster Cars (40 str), Biker Gangs (60 str), and Street Gangs (70 str). All except the Cutthroats can be arrested fairly easily, but the Cutthroats are still getting the city's full defense bonus (over +1100%), and thus are often managing to successfully drive off or even kill my SWAT teams (100 str LE).

None have attempted to break out through the ring of Viet Cong machineguns thus far, and I'll keep going to see if I can end the criminal flood or not. Savegame attached. This save should be from the latest SVN, though the game was started on an older one.
 

Attachments

Just an update on the above situation. Things seem to have leveled off at about 20 criminals spawning per turn. In any case, I'm getting 20-30 Military Captives per turn, and I've worked out a promotion set that seems to give fairly consistent survival against the damned Cutthroats and their city defense. Still no attempts by the criminals to break out through the ring of machine guns, but ships built in the city are killed instantly by newly spawning criminals every turn.

Oh, and I'm getting a few of every criminal from Assassins to Street Gangs now. Doesn't seem to favor any particular type over the others, though Cutthroats tend to last longer because of the aforementioned defense issue.
 
@Joe:
I just realized as I was reviewing the traits tags that we have iCityStartCulture there!

What this means is that (if this is working properly) we can use this tag to give the barbarian and neanderthal leaders enough culture to pop their primary 8 tiles whenever they found a city and wash our hands of any complexities in that issue whatsoever. Easy peasy.

One this note I have a preference. I would rather that they did not pop those tiles at Founding. But would rather have a rate that would have them wait several turns. The number of turns dependent upon Game Speed selected for play. If this is possible.

@TrippedOnACloud,
Are you using any Combat Mod Options with this game? FoF, Hide n Seek? etc? Or is this a more basic game w/o any of those Options?

JosEPh
 
One this note I have a preference. I would rather that they did not pop those tiles at Founding. But would rather have a rate that would have them wait several turns. The number of turns dependent upon Game Speed selected for play. If this is possible.
JosEPh

Why? I can understand it for a civilized settlement but barbarians are more like nomads; they would not be setting up infrastructure but getting to know the layout of the land, preparing places for ambushes, discovering hunting/gathering resource sites and so on.

By the way, what happens when a barbarian now turns into a nation under these new rules? Do all the cities converted revert to one plot only? If they do it could be a problem for them given the population requirement for the trigger to become a nation.
 
1) Regarding my massive flood of criminals:
No combat mod options are on. Problems arresting Cutthroats are solely because they get the city's (extremely high) defensive bonus, which does not appear to be happening with any other criminal type.

Maybe a dozen turns after my previous post, the flood of spawning criminals has come to a sudden end. I'm completely mystified by where they came from in the first place, nor do I know why they've stopped. The city's Crime level was around -9000 when it began, roughly -16000 at the end as the result of the police I sent in to arrest the criminals. The majority of the criminals shouldn't have been spawning in the first place if I understand the intent of the mechanic, as their prerequisite buildings had been demolished via Ctrl-A. There's still 4 or 5 lingering survivors that haven't become Wanted yet.

I'm going to give it another dozen turns or so, then see what happens if I train another pile of Scoundrels. If that doesn't cause anything to happen, I'll try rebuilding and redemolishing the criminal buildings, and see if anything interesting occurs. Update: Haven't been able to trigger another massive flood of criminal spawning by training more Scoundrels or rebuilding/destroying the criminal buildings. Possibly was caused by some sort of caching issue, or something, I dunno.

Also, where in the mod's files is the code for the various criminal-related stuff? I'd like to take a look under the hood, and see if I can spot anything off.

2) Regarding Barbarian Cities Culture:
I, personally, would also prefer the barbarian cities start as single-tile cities before expanding. That said, I'd much rather have barbarian cities that start with the 8-tile first ring than barbarian cities that never expand at all, which the current situation appears to be.

Also, regarding culture push power, how is the relative strength of a city's cultural influence affected by distance from the city, and can it be adjusted? Mature cities in C2C have absolutely massive culture ranges, and in my recent games I've found that cultural influence tends to be extremely all-or-nothing. Over the course of a few turns, a border between two nations can easily jump across a 3 or 4 tile strip. Of particular note, I recently swiped a coastal city on another continent in order to gain access to Hemp, which was on a tile in the first ring. For a long period of time, my cultural influence was just the single tile of the city itself, and a small, detached triangle of ocean in the second and third rings. Recently, the city's grown extremely rapidly due to a combination of abysmally low education and absurdly high food production from techs and corporations (Mobby Meats), and suddenly it controls most of the tiles within a 4-tile ring, all of which flipped over the course of maybe a dozen turns.

I've been considering trying to create a building or project that stops cultural growth, also, but I'm not really sure where to start. There have been many cases where I would much rather have my borders just stop at some point rather than pushing out as far as they do.

Do note that I haven't tried a long game with Realistic Culture Spread yet, so I don't know how this would affect it.

3) Great Farmers can plant resources on ocean tiles if they use a Sea Tunnel. Haven't tried planting from a boat yet, but that might be possible too.

4) Ships that take one of the Transport (X) promotions and later upgrade to a type of ship with native transport capability will have their cargo type overridden. For example, say a Sloop of War with Transport (Troops) upgrades to a Modern Destroyer, which has native ability to carry missiles. It will no longer be able to carry troops despite retaining the promotion. Is it possible to set the Transport (X) promotions to always reset on upgrade?

5) The current Disease framework and the AI don't work very well together. I know it's currently incomplete, but I find that there's very little reason to actively fight disease at present. It's much easier to simply deal with the health and happiness penalties than to bring disease levels down. However, the AI seems to at least attempt to fight disease by building Health Care units, sometimes to the point where a city under threat from an invading army will have nearly no defensive units but dozens of healthcare units, and still be producing more. Telling the AI to simply ignore disease for now might make it more competitive.
 
Hooboy. Somewhere in my attempts to abuse the ability to arrest your own criminals, something went horribly wrong. First, I demolished the required buildings to train various criminals until I got to the lowest-cost trainable criminal I could. Starting at early Transhuman/Late Modern, I wound up demolishing a Meth Lab, Mob Storefront, Motorcycle Club, Highwayman's Hideout, and Saloon. Possibly another building as well, but in any case I ended up at Scoundrels (17 str) as my cheapest trainable and arrestable criminal. I proceeded to spend a turn alt-training them in my capital, which wound up being around a dozen or so, then sat them there to become Wanted.
Interesting that as you say you removed all the buildings with those spawning effects. I wonder if there's a bug in the removal of buildings somehow. Might be some caching that got that stuck in place perhaps but also too there are some unsanctioned buildings that come into play in the city that can help to spawn if you have extremely high crime. But as you said, the crime was low so that's all the more odd.

This is almost sounding like the chance is based not on the static crime level but the adjustment amount... that would be interesting. I'll have to run some tracking with your save on that segment.


The first few turns went smoothly enough, with 2-3 arrested per turn. Then, suddenly, somewhere around 5-10 new criminals started spawning every turn and immediately attacking units in the city (without leaving it), as well as leaving the city and pillaging the countryside.
There's an interesting hint in this I think... at the moment I don't really have spawning criminals being given a very detailed AI. It seems quite odd to me that they are acting this aggressive. Maybe I did SOME things to enhance that at some point a bit ago but this is still strange on a number of levels.
This included attacking ships in the city, and the successful attacking of any ship instantly resulted in all capturable/defenseless units in the city being destroyed as though the city was conquered.
A separate bug that's part of the movement stuff I'm working on now. New and improved data to consider though. Ugh... Not sure I've looked at trying to catch this side of things yet.

Note that this entire time the Crime level in the city has been between -9000 and -11000 or so.
This is what makes me think it might be looking at the adjustment rate and not the actual crime value, which is what I was trying to isolate originally. That could explain why others reported seeing criminals spawning when they didn't have positive crime amounts. But I DID check that code again afterwards and it was doing everything it was expected to do so this is really confusing.

It's also possible that you hit an integer limit somewhere, causing your values to go completely haywire. You're talking about pretty high numbers there but not the millions it takes generally to hit int overflows. So that's less suspect.

I loaded an autosave from before the craziness in order to evacuate all the Great People from the city, and surrounded the city itself with a ring of Viet Cong (Machinegun UU) to hopefully keep the criminals contained.
I'd like that autosave too...

Since then, they've been continuing to spawn at a rate of 5-10 per turn and sometimes directly attacking other units in the city. It actually looks like they're going after whatever the first unit in the list is, so any ships or aircraft present get attacked first, and if there's no ships then my Modern Armors get attacked.
hmm... ambush works this way. But ambush should not be functioning inside a city.

The spawning units include Assassins (8 str), Cutthroats (12 str), Scoundrels (17 str), Mobster Cars (40 str), Biker Gangs (60 str), and Street Gangs (70 str). All except the Cutthroats can be arrested fairly easily, but the Cutthroats are still getting the city's full defense bonus (over +1100%), and thus are often managing to successfully drive off or even kill my SWAT teams (100 str LE).
The defensive bonus is due to cutthroats being ruffians and thus having the ability to get defensive bonuses in general. I do still need to ensure that any unit that can blend into cities like they do cannot get city defense bonuses.

None have attempted to break out through the ring of Viet Cong machineguns thus far, and I'll keep going to see if I can end the criminal flood or not. Savegame attached. This save should be from the latest SVN, though the game was started on an older one.
This sounds more like what they should be doing if they are spawned criminals, yes. They shouldn't be moving about the countryside to find targets but they should be pretty much staying put and assassinating if they can do so effectively.

One this note I have a preference. I would rather that they did not pop those tiles at Founding. But would rather have a rate that would have them wait several turns. The number of turns dependent upon Game Speed selected for play. If this is possible.
We can give them an amt of of culture per round per city through their traits, as you saw with the creative trait. Either way, I think traits is the way to solve this. The barbarian leader is always given the barbarian default trait. I think a little code evaluation is in order to ensure this goes deeper for the rest of the npcs. On your end, just make sure to give them some culture bonus in that trait's xml.

Why? I can understand it for a civilized settlement but barbarians are more like nomads; they would not be setting up infrastructure but getting to know the layout of the land, preparing places for ambushes, discovering hunting/gathering resource sites and so on.
+ culture per round may scale properly while a static starting amount may not scale to the game speed. That's one reason I'd agree with him.

By the way, what happens when a barbarian now turns into a nation under these new rules? Do all the cities converted revert to one plot only? If they do it could be a problem for them given the population requirement for the trigger to become a nation.
Good question but iirc, a graduating nation is given a decent amount of culture to start when they outgrow barbarianhood. Great observation but I don't suspect its an issue.

Regarding my massive flood of criminals:
No combat mod options are on. Problems arresting Cutthroats are solely because they get the city's (extremely high) defensive bonus, which does not appear to be happening with any other criminal type.
Explained above. If you want to make this not an issue immediately on your system, just give them the tag that takes away their defensive bonuses.

Maybe a dozen turns after my previous post, the flood of spawning criminals has come to a sudden end. I'm completely mystified by where they came from in the first place, nor do I know why they've stopped.
Existing criminals in the city diminish the chances to spawn. Could that have anything to do with it?

The city's Crime level was around -9000 when it began, roughly -16000 at the end as the result of the police I sent in to arrest the criminals.
More data to suggest that it's the rate and not the amount of crime that is defining the random check... maybe. There's still some reasons this may not be at all accurate either. I almost wonder if the 'chart' flipped at -10k to being seen as a positive by the code somehow.

The majority of the criminals shouldn't have been spawning in the first place if I understand the intent of the mechanic, as their prerequisite buildings had been demolished via Ctrl-A. There's still 4 or 5 lingering survivors that haven't become Wanted yet.
NONE of the criminals should have spawned. They should never spawn when crime is 0 or less as the chance is basically .01% of the existing crime level every round. The chance gets checked for each potential spawn source which those buildings do represent. Again, what's truly weird here is that I've seen the code in action processing correctly so this is really mysterious.

I'm going to give it another dozen turns or so, then see what happens if I train another pile of Scoundrels. If that doesn't cause anything to happen, I'll try rebuilding and redemolishing the criminal buildings, and see if anything interesting occurs.
Yeah, well... obviously something is amiss. Let me know if it repeats though.

Also, where in the mod's files is the code for the various criminal-related stuff? I'd like to take a look under the hood, and see if I can spot anything off.
Quite a few spots really. Most in CvUnit and CvCity.


Also, regarding culture push power, how is the relative strength of a city's cultural influence affected by distance from the city, and can it be adjusted? Mature cities in C2C have absolutely massive culture ranges, and in my recent games I've found that cultural influence tends to be extremely all-or-nothing. Over the course of a few turns, a border between two nations can easily jump across a 3 or 4 tile strip. Of particular note, I recently swiped a coastal city on another continent in order to gain access to Hemp, which was on a tile in the first ring. For a long period of time, my cultural influence was just the single tile of the city itself, and a small, detached triangle of ocean in the second and third rings. Recently, the city's grown extremely rapidly due to a combination of abysmally low education and absurdly high food production from techs and corporations (Mobby Meats), and suddenly it controls most of the tiles within a 4-tile ring, all of which flipped over the course of maybe a dozen turns.
I think this is pretty much simply defined in the xml in the culture levels xml. Joe may be able to help more with that. The coding is pretty much still vanilla but expanded on by the xml as far as I know. Some of your questions about how to manipulate it would only be possible in the code though.

Such as this:
I've been considering trying to create a building or project that stops cultural growth, also, but I'm not really sure where to start. There have been many cases where I would much rather have my borders just stop at some point rather than pushing out as far as they do.

Do note that I haven't tried a long game with Realistic Culture Spread yet, so I don't know how this would affect it.
You should try the option. I find it is much more enjoyable and suited to C2C's scale.
 
3) Great Farmers can plant resources on ocean tiles if they use a Sea Tunnel. Haven't tried planting from a boat yet, but that might be possible too.
My you are clever. lol... I'd not noticed that.

DH... is this needed domain check for validation something you can enforce in python or is this in code?

4) Ships that take one of the Transport (X) promotions and later upgrade to a type of ship with native transport capability will have their cargo type overridden. For example, say a Sloop of War with Transport (Troops) upgrades to a Modern Destroyer, which has native ability to carry missiles. It will no longer be able to carry troops despite retaining the promotion. Is it possible to set the Transport (X) promotions to always reset on upgrade?
In part as designed but I see your point for having them reset on upgrade. I'll have to give that consideration. Probably no quick fix that I can think of off the top of my head anyhow.

5) The current Disease framework and the AI don't work very well together. I know it's currently incomplete, but I find that there's very little reason to actively fight disease at present. It's much easier to simply deal with the health and happiness penalties than to bring disease levels down. However, the AI seems to at least attempt to fight disease by building Health Care units, sometimes to the point where a city under threat from an invading army will have nearly no defensive units but dozens of healthcare units, and still be producing more. Telling the AI to simply ignore disease for now might make it more competitive.
I'm more interested in getting diseases to be more threatening soon. If they are responding as they should as if letting it go is as dangerous as letting crime go then I don't want to stop telling them to do that because diseases should be a much larger danger by the end of this cycle.
 
There's an interesting hint in this I think... at the moment I don't really have spawning criminals being given a very detailed AI. It seems quite odd to me that they are acting this aggressive. Maybe I did SOME things to enhance that at some point a bit ago but this is still strange on a number of levels.
I'm not certain, but what might have been causing the units to switch AIs was the immediate combat that was occurring. As you mentioned the possibility of ambushes, it might have been something along the lines of "Criminal spawns, immediately ambushes and kills a ship, then uses leftover movement to go pillage something". This is further supported by the fact that there were several unescorted workers that should have been in movement range of the city via railroad, but weren't attacked. It's also possible that the units are being forced out of the city when they successfully attack, rather than actually moving out, and the pillaging AI only kicked in once they were already outside. Also of note, I believe the only ones that went wandering were Assassins and Scoundrels. I don't recall seeing any of the other types leaving the city.
Existing criminals in the city diminish the chances to spawn. Could that have anything to do with it?
I actually understated the number of criminals that were spawning. It was really more along the lines of 20-30 criminals spawning and being killed per turn for several turns at the peak, with at least another dozen or so left in the city because they weren't yet Wanted. I think the total number of criminals was in the 40+ range for several consecutive turns, and the "shutoff" was sudden rather than a gradual tapering off. One turn, at least a dozen new criminals spawned, the next and subsequent turns, zero.
NONE of the criminals should have spawned. They should never spawn when crime is 0 or less as the chance is basically .01% of the existing crime level every round. The chance gets checked for each potential spawn source which those buildings do represent. Again, what's truly weird here is that I've seen the code in action processing correctly so this is really mysterious.
It may be worth bringing up that my laptop's hard drive is starting to fail and badly needs replacement, but I've been putting it off . I've been experiencing occasional periodic massive spikes in seek time, with my entire system locking up for 1-2 seconds, presumably the result of the page file or something else getting stored in a bad sector of the HDD. It's possible that the original cause was the result of a hardware-related issue on my end.

That said, based on your description of the spawning code, it sounds like what happened was for some reason the game thought the crime level in the city was sky-high for a period of time. When I go back and take a look at the saves I'll check and see if there are Crime buildings or not. If there are, then the code is probably working fine but something borked up the property value. If there aren't, the issue probably lies in the code somehow.

Another thing I think I'll try is seeing what happens if I take a save from when the criminals were still spawning en masse and force a recalc.
Yeah, well... obviously something is amiss. Let me know if it repeats though.
Haven't managed to reproduce the issue, though I haven't made any attempts to set up a dedicated test or anything, just tried training another pile of Scoundrels, then tried rebuilding and redemolishing a few of the criminal buildings.

I'd like that autosave too...
The actual autosaves are long gone but I should have a slew of normal saves around that time. I'm not sure if I have one from right before it started or as it started, but I definitely have a few from while they were still spawning and being arrested. I'll take a look and post them later.

I'm more interested in getting diseases to be more threatening soon. If they are responding as they should as if letting it go is as dangerous as letting crime go then I don't want to stop telling them to do that because diseases should be a much larger danger by the end of this cycle.
I agree, I'm just mentioning it as a possible easily-made and easily-reversed tweak as a stopgap until diseases are more of an issue. If I'm interpreting the files correctly, it could be something as simple as changing iAIWeight to an appropriately small/large/zero value (not sure how it works) and slapping a comment in as a reminder of the original value. If the disease updates are going to be fairly soon, there's no point, but if it's likely to be some months before they're implemented, telling the AI to ignore it for now may result in a slightly more competitive AI.

Finally, a few other things I've noticed:
1) Various buildings and wonders that require a Reef in the vicinity do not have "or Reef (Beacon) or Reef (Lighthouse)", or whatever the appropriate name is, for the replacement features that are created when you build the improvement on them, so if you improve the reefs the city will be unable to build them.
2) Graphical issue, Maglev lines crossing rivers still also generate a bridge as though they were more conventional roads from an earlier era (appear to be stone bridges). Said bridges don't line up with the Maglev lines either, and are basically just freestanding.
3) Some Missionaries have a base movement speed of only 1 rather than 2 like most.
4) Craters can be removed by workers executing a "Plant Forest" action. Technically what I believe is happening is that the Plant Forest Improvement is not blocked by the Crater, and when it's completed it simply replaces the feature on the plot with the Forest. Same thing probably happens with Caves.
 
3) Great Farmers can plant resources on ocean tiles if they use a Sea Tunnel. Haven't tried planting from a boat yet, but that might be possible too.

DH... is this needed domain check for validation something you can enforce in python or is this in code?

The point of the Great Farmer is that they can place resources on invalid terrain, so no terrain checks are done. A domain check may be possible but not directly as there isn't one. We would need to ask for the nearest land plot and if it is the plot the unit is on then it is land otherwise it isn't. That is possible in python.

Finally, a few other things I've noticed:
1) Various buildings and wonders that require a Reef in the vicinity do not have "or Reef (Beacon) or Reef (Lighthouse)", or whatever the appropriate name is, for the replacement features that are created when you build the improvement on them, so if you improve the reefs the city will be unable to build them.

3) Some Missionaries have a base movement speed of only 1 rather than 2 like most.
4) Craters can be removed by workers executing a "Plant Forest" action. Technically what I believe is happening is that the Plant Forest Improvement is not blocked by the Crater, and when it's completed it simply replaces the feature on the plot with the Forest. Same thing probably happens with Caves.

1) bug that needs fixing. It took quite awhile to get the reef damage and movement rules working properly and needed the different features to do it. The buildings were forgotten it seems. I wonder if we can have OR terrain features.

3) Design - not all religions are equal

4) There are still problems with the "Plant Forest" and other terriform actions.

edit - On Disease

Since people wont let me have a maximum population without infrastructure like Civ III, I have been working on what that limit represented in a nice way in a more realistic way, ie death from disease in places without the requisite infrastructure. I have almost got it ready for a pre-release test, it scales by difficulty so the AI is always affected at Noble level while the human player is affected at the difficulty level they are currently at. (Assumes the bit that changes difficulty level records the current difficulty level correctly.) Allowances are made for the C2C game so populations wont go below 6 if 6 or above at the time of an outbreak, same with 13. There is nothing worse than being 2:hammers: away from building a wonder only to have your city population fall below that needed to build the wonder.
 
Why? I can understand it for a civilized settlement but barbarians are more like nomads; they would not be setting up infrastructure but getting to know the layout of the land, preparing places for ambushes, discovering hunting/gathering resource sites and so on.

By the way, what happens when a barbarian now turns into a nation under these new rules? Do all the cities converted revert to one plot only? If they do it could be a problem for them given the population requirement for the trigger to become a nation.
1.I'll answer your question with a question; Why should a barb city/settlement have more culture influence than a regular Civ?

As long as their city eventually does grow to 8 tiles For this Option, then this is an advantage they should not have imhpo.

2. If the barb city evolves to a new Minor Civ were does the coding say they lose what ever Culture they have already accrued? Without this Option Barb Civs never lose their city tiles. So why would achieving Culture Level Poor prior to becoming a Minor Civ cause them to go back to Culture Level None?

This Option is only about acheiving a Culture Level, in this case the 2nd one in the game Poor. No coding has been changed, only the xml <iThreshold> has now been given an integer value>0.

Example original xml for Eternity Game speed:
Code:
<Type>CULTURELEVEL_POOR</Type>
			<Description>TXT_KEY_CULTURELEVEL_POOR</Description>
			<iCityDefenseModifier>0</iCityDefenseModifier>
			<SpeedThresholds>
				<SpeedThreshold>
					<GameSpeedType>GAMESPEED_ETERNITY</GameSpeedType>
					<iThreshold>0</iThreshold>

Now the change with the Option:
Code:
<Type>CULTURELEVEL_POOR</Type>
			<ReplacementID>CULTURELEVEL_ALT_POOR</ReplacementID>
			<Description>TXT_KEY_CULTURELEVEL_POOR</Description>
			<Help>TXT_KEY_CULTURELEVEL_POOR_HELP</Help>
			<iCityDefenseModifier>0</iCityDefenseModifier>
			<SpeedThresholds>
				<SpeedThreshold>
					<GameSpeedType>GAMESPEED_ETERNITY</GameSpeedType>
					<iThreshold>80</iThreshold>

And every iThreshold level is scale by GS #of turns, ie., Normal has ~1000 turns so it's Poor level is 10. Epic is ~2000 turns so Poor level is 20, etc.

JosEPh
 
1.I'll answer your question with a question; Why should a barb city/settlement have more culture influence than a regular Civ?

As long as their city eventually does grow to 8 tiles For this Option, then this is an advantage they should not have imhpo.

JosEPh

Barbarians are not a city/settlement. That is the problem. I really wish we could go back to the BtS standard barbarians where they had a completely separate AI and weren't just another nation.

edit In fact I would prefer if they did not have cities ever.
 
@T-brd,
Note that this entire time the Crime level in the city has been between -9000 and -11000 or so.
This is what makes me think it might be looking at the adjustment rate and not the actual crime value, which is what I was trying to isolate originally. That could explain why others reported seeing criminals spawning when they didn't have positive crime amounts. But I DID check that code again afterwards and it was doing everything it was expected to do so this is really confusing.

It's also possible that you hit an integer limit somewhere, causing your values to go completely haywire. You're talking about pretty high numbers there but not the millions it takes generally to hit int overflows. So that's less suspect.


It's in the CIV4PropertyInfos.xml;
Code:
<Type>PROPERTY_CRIME</Type>
			<Description>TXT_KEY_PROPERTY_CRIME</Description>
			<Strategy>TXT_KEY_PROPERTY_CRIME_STRATEGY</Strategy>
			<ValueDisplayText>TXT_KEY_PROPERTY_CRIME_DISPLAY</ValueDisplayText>
			<ChangeDisplayText>TXT_KEY_PROPERTY_CRIME_CHANGE</ChangeDisplayText>
			<ChangeAllCitiesDisplayText>TXT_KEY_PROPERTY_CRIME_CHANGE_ALL_CITIES</ChangeAllCitiesDisplayText>
			<PrereqMinDisplayText>TXT_KEY_PROPERTY_CRIME_PREREQ_MIN</PrereqMinDisplayText>
			<PrereqMaxDisplayText>TXT_KEY_PROPERTY_CRIME_PREREQ_MAX</PrereqMaxDisplayText>
			<bSourceDrain>1</bSourceDrain>
			<iAIWeight>-150</iAIWeight>
			<iTargetLevel>0</iTargetLevel>
			<AIScaleType>AISCALE_CITY</AIScaleType>
		[color=red]<iOperationalRangeMin>0</iOperationalRangeMin>
			<iOperationalRangeMax>1000</iOperationalRangeMax>[/color]

BUT, each individual Crime also only has a Positive range and that Min/Max is 0 to 100,000.

Example:
Code:
<PropertyBuilding>
			     		<BuildingType>BUILDING_CRIME_GRAFFITI</BuildingType>
			     		<iMinValue>20</iMinValue>
			     		<iMaxValue>100000</iMaxValue>
 			  	</PropertyBuilding>

AFAIK, there has never been any definition made for negative range. Unless it's in the dll files.

JosEPh
 
Barbarians are not a city/settlement. That is the problem. I really wish we could go back to the BtS standard barbarians where they had a completely separate AI and weren't just another nation.

edit In fact I would prefer if they did not have cities ever.

They must have some code that acts like a city. And yes they have a different AI, but the mechanics for having a city form/display like normal AI/Players has to have a similar basis surely. And Barb Civ and Barb World is Rev coding to boot.

And really I'm not concerned if the Barbs take longer to pop the adjacent 8 tiles with this Option On. They still build Mil units and are still a pest. Their main function in the game.

JosEPh
 
Started a new thread for the criminal spawn flood issue, with a save attached.

However, while looking at the old saves, I noticed something odd that may or may not be related, and possibly previously led to an odd occurrence that disappeared on loading of an autosave. If you take a look at the Production history chart in the statistics, you'll notice a VERY massive spike in England's production. This occurred at some point in the Prehistoric, and I believe it only lasted for one turn. Way back in the early Prehistoric I recall getting the "England is the first to discover Sedentary Lifestyle" announcement followed by something like five religions being founded simultaneously. Checking WB showed all five being founded by England. I assumed something went wrong somewhere, but loading of an autosave did not result in a repeat so I basically ignored it and moved on.

Now, I think what might have happened then is that production spike hit, and the AI happened to be producing Research and thus suddenly got a ridiculously large chunk of :science: that allowed it to research several dozen techs in one go. On reloading something presumably caused the AI to change production to something that went unnoticed.

Now, I have no idea what might have caused that in the first place, and it's been far too long to try and track down the cause of that spike to begin with, but I wonder if that event could have had some kind of lasting effect that is now making itself apparent? Presumably an int overflow occurred at the time, after all.
 
Finally, a few other things I've noticed:
1) Various buildings and wonders that require a Reef in the vicinity do not have "or Reef (Beacon) or Reef (Lighthouse)", or whatever the appropriate name is, for the replacement features that are created when you build the improvement on them, so if you improve the reefs the city will be unable to build them.

Actually they do. The only bit missing was the was that the Coral Reef Myth building did not have the improved Great Barrier Reef options as OR components. Otherwise Coral Reef has all three Coral types and Reef has all three Reef types as OR prerequisites.

This probably means that it is a problem with the display in the pedia and on the building itself.
 
I'm not certain, but what might have been causing the units to switch AIs was the immediate combat that was occurring.
Having written a very basic AI for these criminals, I have to admit there were a few functions called that I didn't write but was using as 'AI building blocks'. However, I would be deeply surprised if any of them make it likely to switch AI due to entering combat.

As you mentioned the possibility of ambushes, it might have been something along the lines of "Criminal spawns, immediately ambushes and kills a ship, then uses leftover movement to go pillage something".
I'm wondering now if Assassination target rules may make it possible for these units to 'assassinate' the ships and civilians you are talking about. It very well may and if that's the case then one of the big problems here is that the land domain vs sea domain rules are still not allowing a real conflict to ensue when its possible and that's a bug that the naval review has needed resolved for a while (and has long been a problem for hovering units that can fly over the ocean and conflict with boats - the bug has been that the conflict results in an auto-win like a chess attack rather than an actual combat. So this lingering lack of correction from Vanilla rules still haunts us and all the more as I open up greater conflict potential.)

Why they then go and pillage? I MIGHT have given them some coding to try to take advantage of pillageable targets in range where they can return to the city after doing so... I will have to review that AI again.

This is further supported by the fact that there were several unescorted workers that should have been in movement range of the city via railroad, but weren't attacked.
Perhaps.

It's also possible that the units are being forced out of the city when they successfully attack, rather than actually moving out, and the pillaging AI only kicked in once they were already outside.
That may be true... I might have done something to get them to consider their options when they were NOT inside a city, motivating them to get to another city and do some stuff along the way perhaps. Again, will take some review. I threw together some building block ai function calls and called it good. They're main mission - get to a city and cause it trouble if they aren't already in one. If they are, stay there. There's much more to be done to make them better.

Also of note, I believe the only ones that went wandering were Assassins and Scoundrels. I don't recall seeing any of the other types leaving the city.
hmm... that makes me think that maybe those units aren't accepting the spawned criminal AI and are instead taking on their default, which would very much have them acting much more obnoxious to the countryside.

I actually understated the number of criminals that were spawning. It was really more along the lines of 20-30 criminals spawning and being killed per turn for several turns at the peak, with at least another dozen or so left in the city because they weren't yet Wanted. I think the total number of criminals was in the 40+ range for several consecutive turns, and the "shutoff" was sudden rather than a gradual tapering off. One turn, at least a dozen new criminals spawned, the next and subsequent turns, zero.
Very interesting indeed. You ARE working on the LATEST SVN right? A recent change should theoretically limited the amount that could spawn significantly and I'm thinking this is a display of completely ignoring that. Or there's an element to the math that I'm overlooking.


It may be worth bringing up that my laptop's hard drive is starting to fail and badly needs replacement, but I've been putting it off . I've been experiencing occasional periodic massive spikes in seek time, with my entire system locking up for 1-2 seconds, presumably the result of the page file or something else getting stored in a bad sector of the HDD. It's possible that the original cause was the result of a hardware-related issue on my end.
Such would usually lead to a crash before odd behavior.

That said, based on your description of the spawning code, it sounds like what happened was for some reason the game thought the crime level in the city was sky-high for a period of time.
Absolutely, but how, then, does it report a negative number when that number is pulled from the same data source that the ruleset is looking at?

When I go back and take a look at the saves I'll check and see if there are Crime buildings or not. If there are, then the code is probably working fine but something borked up the property value. If there aren't, the issue probably lies in the code somehow.
Interesting test. Yes, look at the special buildings tab to ensure you aren't showing buildings that only come into play due to high crime and see if it jives with the crime level displayed on the properties tab.

Another thing I think I'll try is seeing what happens if I take a save from when the criminals were still spawning en masse and force a recalc.
Haven't managed to reproduce the issue, though I haven't made any attempts to set up a dedicated test or anything, just tried training another pile of Scoundrels, then tried rebuilding and redemolishing a few of the criminal buildings.

The actual autosaves are long gone but I should have a slew of normal saves around that time. I'm not sure if I have one from right before it started or as it started, but I definitely have a few from while they were still spawning and being arrested. I'll take a look and post them later.
Meh... no worries then. The save you provided should be enough.

I agree, I'm just mentioning it as a possible easily-made and easily-reversed tweak as a stopgap until diseases are more of an issue. If I'm interpreting the files correctly, it could be something as simple as changing iAIWeight to an appropriately small/large/zero value (not sure how it works) and slapping a comment in as a reminder of the original value. If the disease updates are going to be fairly soon, there's no point, but if it's likely to be some months before they're implemented, telling the AI to ignore it for now may result in a slightly more competitive AI.
True, that could be done but I'd fear forgetting it had been done.

The point of the Great Farmer is that they can place resources on invalid terrain, so no terrain checks are done. A domain check may be possible but not directly as there isn't one.
Not sure what you mean. You can't ask for the domain of the plot the unit stands on as a prequalification to being able to perform the mission? Such would be trivial in the C++. pUnit->plot()->getDomainType(). I know there's a spot somewhere where canDoMission (or whatever its called in this case) has some definitions because it keeps the unit from planting a resource where another resource already exists.

We would need to ask for the nearest land plot and if it is the plot the unit is on then it is land otherwise it isn't. That is possible in python.
This seems a much more complicated coding than 'what is the domain of the plot the unit is on?'

1.I'll answer your question with a question; Why should a barb city/settlement have more culture influence than a regular Civ?

As long as their city eventually does grow to 8 tiles For this Option, then this is an advantage they should not have imhpo.
That's a pretty good point in my book.

Barbarians are not a city/settlement. That is the problem. I really wish we could go back to the BtS standard barbarians where they had a completely separate AI and weren't just another nation.

edit In fact I would prefer if they did not have cities ever.
Barbarian cities are indeed settlements, but they are settlements of anarchists who refuse to live under any form of governance and live on the outskirts of society, often joined in the common goal to live as freely as possible. The 'united' appearance of barbs in the game is purely due to the fact that we cannot have thousands of little splinter societies as players. The tech level of barbs is to be considered the level of knowledge that generally ALL people are fluent in and utilize in day to day life, regardless of leadership or lack thereof. Barbs are not to be seen as one unified nation, but simply as the population of folks who refuse to have any nation at all.

If barbs were to conflict with other barbs now and then it could be beneficial to the setting. Otherwise, they are slackers who refuse to deal with the demands of a competitive society and seek to take more than give and hold back the swelling tide of expanding authority in the world. Hillbillies and clans and all manner of folk who claim allegiance to none.

And they do have a completely separate AI, just as they originally did. The BBAI stuff may have made the unit AI's a bit more cohesive in their overall teamwork with other units because Barb AI was not kept tremendously separated from some unit AIs as they may have been.

It's in the CIV4PropertyInfos.xml;
Code:
<Type>PROPERTY_CRIME</Type>
			<Description>TXT_KEY_PROPERTY_CRIME</Description>
			<Strategy>TXT_KEY_PROPERTY_CRIME_STRATEGY</Strategy>
			<ValueDisplayText>TXT_KEY_PROPERTY_CRIME_DISPLAY</ValueDisplayText>
			<ChangeDisplayText>TXT_KEY_PROPERTY_CRIME_CHANGE</ChangeDisplayText>
			<ChangeAllCitiesDisplayText>TXT_KEY_PROPERTY_CRIME_CHANGE_ALL_CITIES</ChangeAllCitiesDisplayText>
			<PrereqMinDisplayText>TXT_KEY_PROPERTY_CRIME_PREREQ_MIN</PrereqMinDisplayText>
			<PrereqMaxDisplayText>TXT_KEY_PROPERTY_CRIME_PREREQ_MAX</PrereqMaxDisplayText>
			<bSourceDrain>1</bSourceDrain>
			<iAIWeight>-150</iAIWeight>
			<iTargetLevel>0</iTargetLevel>
			<AIScaleType>AISCALE_CITY</AIScaleType>
		[color=red]<iOperationalRangeMin>0</iOperationalRangeMin>
			<iOperationalRangeMax>1000</iOperationalRangeMax>[/color]

BUT, each individual Crime also only has a Positive range and that Min/Max is 0 to 100,000.

Example:
Code:
<PropertyBuilding>
			     		<BuildingType>BUILDING_CRIME_GRAFFITI</BuildingType>
			     		<iMinValue>20</iMinValue>
			     		<iMaxValue>100000</iMaxValue>
 			  	</PropertyBuilding>

AFAIK, there has never been any definition made for negative range. Unless it's in the dll files.

JosEPh
Nice thinking and you did spark some considerations, namely that there may be a hardcoded limit in the code that, when hit, makes the code think the property value is the opposite to what the amount actually is. That point may be somewhere around 9k to -9k. Might be in AIAndy's coding somewhere. But the operational range you first mention, for the property as a whole, is purely an AI consideration that Koshling originally used for his AI. I've advanced the AI past the use of this tag in most cases though there may still be a few spots that do use it.

The second is interesting but should only be capable of removing a building when the property levels exceed 100k and should never enable a property autobuilding to manifest in a city when the city is outside of the minimum to maximum ranges.
Started a new thread for the criminal spawn flood issue, with a save attached.
Ok. Keep in mind this is a good thread for this since the multiple issues being found here each need to eventually be addressed and by being in this thread will be noticed as an issue to resolve. Discovering them elsewhere will mean I need to register the bug here still and sometimes I forget and that's how some bugs never get addressed.

However, while looking at the old saves, I noticed something odd that may or may not be related, and possibly previously led to an odd occurrence that disappeared on loading of an autosave. If you take a look at the Production history chart in the statistics, you'll notice a VERY massive spike in England's production. This occurred at some point in the Prehistoric, and I believe it only lasted for one turn. Way back in the early Prehistoric I recall getting the "England is the first to discover Sedentary Lifestyle" announcement followed by something like five religions being founded simultaneously. Checking WB showed all five being founded by England. I assumed something went wrong somewhere, but loading of an autosave did not result in a repeat so I basically ignored it and moved on.
I've seen something like this before. No bead on what causes this yet.

Now, I think what might have happened then is that production spike hit, and the AI happened to be producing Research and thus suddenly got a ridiculously large chunk of :science: that allowed it to research several dozen techs in one go. On reloading something presumably caused the AI to change production to something that went unnoticed.

Now, I have no idea what might have caused that in the first place, and it's been far too long to try and track down the cause of that spike to begin with, but I wonder if that event could have had some kind of lasting effect that is now making itself apparent? Presumably an int overflow occurred at the time, after all.
I strongly doubt an int overflow since the game is at a much simpler time then and there's no basis to suspect such an overflow. I dont' suspect an overflow in your properties either because at a point, it comes back to sanity. Usually once madness is introduced by an overflow it's all bad from there and never recovers any sense of normalcy.
 
Not sure what you mean. You can't ask for the domain of the plot the unit stands on as a prequalification to being able to perform the mission? Such would be trivial in the C++. pUnit->plot()->getDomainType(). I know there's a spot somewhere where canDoMission (or whatever its called in this case) has some definitions because it keeps the unit from planting a resource where another resource already exists.


This seems a much more complicated coding than 'what is the domain of the plot the unit is on?'

There is no getDomainType() available in Python. It has not been exposed. The getNearestLandPlot() is available.
 
There is no getDomainType() available in Python. It has not been exposed. The getNearestLandPlot() is available.

PyPlot.getPlotType() ought to tell you what you need to know:
0 = PLOT_PEAK
1 = PLOT_HILLS
2 = PLOT_LAND
3 = PLOT_OCEAN

I think all the coast and ocean terrain types are still all PLOT_OCEAN in C2C.
 
Thunderbrd said:
Ok. Keep in mind this is a good thread for this since the multiple issues being found here each need to eventually be addressed and by being in this thread will be noticed as an issue to resolve. Discovering them elsewhere will mean I need to register the bug here still and sometimes I forget and that's how some bugs never get addressed.
Alright, I'll just keep posting here then and ignore the new one. You'll want to go grab the save from there though, and read if you haven't already, there's some new info. Crossposting from there:
Spoiler Post from the other thread :
After going back to the old saves, I find I made a few mistakes in values I quoted for crime and in specific units involved, but none of which significantly affect anything. In any case, all Crime values are and were significantly negative throughout.

Attached is a save from immediately before the issue begins. In the capital, demolish via Ctrl-A the Mob Storefront, Pawn Shop, Motorcycle Club, Saloon, Highwayman's Hideout, and Meth Lab, then end turn. The current construction queue should finish. The following turn, just queue up a repeating batch of Scoundrels and end turn again. Next turn, you should have a pile of 20-something Scoundrels built, end turn again. I didn't bother moving any units, and other cities that finished their construction queues were set to produce Espionage. Now, 20-something assorted criminals should spawn, with some immediately attacking the units in the city. In my test one attacked and died to a Police APC, and a second attacked and withdrew from another Police APC. All sea and air units in the capital, along with subdued animals and Great People, should disappear as if captured, and one Cutthroat pillaged the nearby Stone Quarry and wandered off to the southeast.

I'm fairly certain the pillager is the same criminal that attacked and withdrew from the Police APC, and it seems highly likely that he's also the one that's causing the disappearance/destruction of the sea, air, and noncombatant units in the Capital. I think the other pillagers I mentioned may be similar cases, in that they attacked and withdrew from some unit in the city upon spawning before setting off to pillage. Note that the nearby stacks of Steampunk Workers and assorted Subdued Animals go untouched.

A forced recalc via Ctrl-Shift-T didn't appear to change anything. At no point were any Crime (X) buildings visible in city, nor did the total crime value become positive.

It is quite possible that the spawning is somehow being based on the change in the Crime value, or perhaps the change in the rate of change of Crime, rather than the total amount. After all, a single-turn production of over two dozen Scoundrels is a significant change in the rate of Crime, and subsequent turns the spawning Criminals would produce a sufficient change on their own to continue the cycle. In this scenario, ending the cycle would be due to single-turn production of sufficient Police to negate the change. I don't recall ever moving police forces into the city from outside of it, and for most of the initial period of spawning I was producing assorted other things in the city. I'm not certain, but I believe the end of the spawning cycle occurred after I put a full turn's production towards Police APCs.

However, even disregarding the Crime values, many of the criminals spawning should not have been able to due to lack of the related building. I was getting Street Gangs (Meth Lab), Biker Gangs (Motorcycle Club), Robbers (Pawn Shop), Mobster Cars (Mob Storefront), Scoundrels (Conspirator's Hideout, present in city), Cutthroats (I forget), and Assassins (Assassin's Den, present in city).
I'm wondering now if Assassination target rules may make it possible for these units to 'assassinate' the ships and civilians you are talking about. It very well may and if that's the case then one of the big problems here is that the land domain vs sea domain rules are still not allowing a real conflict to ensue when its possible and that's a bug that the naval review has needed resolved for a while (and has long been a problem for hovering units that can fly over the ocean and conflict with boats - the bug has been that the conflict results in an auto-win like a chess attack rather than an actual combat. So this lingering lack of correction from Vanilla rules still haunts us and all the more as I open up greater conflict potential.)
Interestingly enough, I don't think the combat with ships was actually resulting in an auto-win. I'll keep in in mind for the next test, but I remember seeing at least one ship successfully defending itself in the event log. I'm more inclined to believe the loss of the ships and civilians is related to the bug BunnyWunny reported in http://forums.civfanatics.com/showthread.php?t=574302, triggered by either the criminals spawning, attacking, or withdrawing. Best guess is the attacking or withdrawing is causing it.

Why they then go and pillage? I MIGHT have given them some coding to try to take advantage of pillageable targets in range where they can return to the city after doing so... I will have to review that AI again.

That may be true... I might have done something to get them to consider their options when they were NOT inside a city, motivating them to get to another city and do some stuff along the way perhaps. Again, will take some review. I threw together some building block ai function calls and called it good. They're main mission - get to a city and cause it trouble if they aren't already in one. If they are, stay there. There's much more to be done to make them better.
I will note that I've never seen spawned criminals leave the city before this game and case, and that the spawned criminals left behind from razing a city also have never moved that I've noticed, even over the course of hundreds of turns.

hmm... that makes me think that maybe those units aren't accepting the spawned criminal AI and are instead taking on their default, which would very much have them acting much more obnoxious to the countryside.
As I mentioned above, the wandering criminals I've noticed are only Assassins, Cutthroats, and Scoundrels. If, however, only criminals that attack something in the city then withdraw are going pillaging, this might be because only those have successfully withdrawn rather than because of anything inherent to the unit. I should probably pay closer attention to the event log next time I run a test, and see exactly which units are doing the instant attacking. Also, not all of those types are attacking or pillaging, some appear to be behaving as usual.

Very interesting indeed. You ARE working on the LATEST SVN right? A recent change should theoretically limited the amount that could spawn significantly and I'm thinking this is a display of completely ignoring that. Or there's an element to the math that I'm overlooking.
It should be, though I might have made a mistake somewhere when updating manually from my actual SVN folder to the BtS/Mods folder because I don't really know how to use TortoiseSVN very well. Also, I'll pull all the police out of the city and see what happens if I actually do let crime go out of control in terms of criminal spawn rate and type.

Interesting test. Yes, look at the special buildings tab to ensure you aren't showing buildings that only come into play due to high crime and see if it jives with the crime level displayed on the properties tab.
As mentioned above, there are definitely no Crime effect buildings in the special buildings tab showing up, on any of the 4-5 turns I tested for. Crime was actually in the -5000 to -7000 range.

I'd like to know whether you can trigger the same flood of spawning criminals by following the steps outlined, using the AD-0350 save.

Also, in my previous attempt to reproduce the issue in the ongoing game, I didn't rebuild all of the buildings. I'll see what happens if I repeat the situation more faithfully by constructing and demolishing all of the buildings in one turn, rather than just a few of them.
 
Status
Not open for further replies.
Back
Top Bottom