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

Status
Not open for further replies.
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.

Thanks.

Of course the question then becomes do we want the GF to put fish/crab resources on ocean tiles. And no we can only have a Great Farmer as the way it is coded it ignores the unit type or at least does not pass the unit doing the action to the code for checking against.

edit I have already started changing the tamed animals to be able to place herds on the map, starting with domesticated herds very early on. Wild herds would come later in the tech tree, probably at about when the GF comes in, so they probably should be removed from the GF at some stage.
 
edit I have already started changing the tamed animals to be able to place herds on the map, starting with domesticated herds very early on. Wild herds would come later in the tech tree, probably at about when the GF comes in, so they probably should be removed from the GF at some stage.
I think this is where I repeat my request for a Tamed Sheep? :D

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.
I did this. Turn-by-turn results:
Start: -10000 or so Crime, rebuilt all of the criminal buildings.
+1: -5000 or so Crime, nothing's happened so far.
+2: -500 or so Crime, still nothing.
+3: +6000 or so Crime, all crime autobuildings have appeared. A total of 16 criminals spawned this turn, of which 8 immediately attacked the single remaining Police Mech. Of these 8 attacking criminals, 5 died, 3 survived to withdraw for a total of 11 surviving criminals in the city. Note that the surrounding tiles are still sealed off by my Machine Guns so I didn't get to check if the withdrawing criminals went pillaging. Also, there weren't any capturable/defenseless units in the city to check that. Moved the crime generating units out and my police forces back into the city.
+4: +4000 or so Crime. No new criminals spawned, which I believe is as it should be, seeing as there's 11 total criminals in the city. All three of the withdrawing criminals again attempted to attack the Police Mech, with two of them withdrawing again and one dying. Total of 10 criminals in the city now.
+5: +3500 or so Crime. Both remaining withdrawing criminals from last turn suicide against police. Total of 8 criminals remaining in city.
+6: +3000 or so Crime. Three new criminals spawn in city, one of which is an Assassin that immediately suicides against police. Total of 10 criminals alive in city.

Of potential interest, all 8 of the attacking criminals were Assassins, Cutthroats, or Scoundrels, all of have been superseded for production by later criminals. The more up-to-date criminals (Street Gang, Robber, Mobster Car, Biker Gang) were/are passive. I'll open up a gap in the containment ring to see if the withdrawing criminals go pillaging momentarily, and park a ship in the city too.

Also noteworthy, it looks like the properly passive criminals that are spawning are obeying the 10-criminal limit to further spawns, but the aggressive ones aren't.

I'll let crime drop back down into the strongly negative again before demolishing the same set of criminal-spawning buildings and training another pile of Scoundrels, as in the first occurrence.
 
There is no getDomainType() available in Python. It has not been exposed. The getNearestLandPlot() is available.

Sorry, you're right. That's a call for units not plots.

For a plot, you'd use 'isWater()' to determine if the plot is land or water. It's only one or the other.
 
I did this. Turn-by-turn results:
Start: -10000 or so Crime, rebuilt all of the criminal buildings.
+1: -5000 or so Crime, nothing's happened so far.
+2: -500 or so Crime, still nothing.
+3: +6000 or so Crime, all crime autobuildings have appeared.
So far so good.
A total of 16 criminals spawned this turn
Are you 100% certain ALL of these are spawns? Could some be from an opposing nation sneaking them into the city somehow?

Do you have criminals of your own? Those should count against that limit too. And the limit isn't how many are spawned, it's how many the city should have at most after spawns take place. If there's 6 criminals in the city already, there should be a limit of 4 spawns that round and extremely unlikely to spawn the last few at all.

It reduces the chances by 10% of the ultimate chance for each criminal in the city basically.

And again, you MUST ensure you're on the absolute latest assets for this test to be meaningful against that limit as it wasn't too many commits ago that I added that limitation. It's not sounding like you are experiencing that adjustment.

of which 8 immediately attacked the single remaining Police Mech. Of these 8 attacking criminals, 5 died, 3 survived to withdraw for a total of 11 surviving criminals in the city. Note that the surrounding tiles are still sealed off by my Machine Guns so I didn't get to check if the withdrawing criminals went pillaging. Also, there weren't any capturable/defenseless units in the city to check that. Moved the crime generating units out and my police forces back into the city.
hmm... Were those attacks against the mech rather suicidal? They sound like it. I wonder why they are so willing to suicide. But that's a deeper question I'm not going to try to get into answering any time soon.

+4: +4000 or so Crime. No new criminals spawned, which I believe is as it should be, seeing as there's 11 total criminals in the city. All three of the withdrawing criminals again attempted to attack the Police Mech, with two of them withdrawing again and one dying. Total of 10 criminals in the city now.
Could have just been bad luck for the criminal spawn checks that round.

+5: +3500 or so Crime. Both remaining withdrawing criminals from last turn suicide against police. Total of 8 criminals remaining in city.
Same.
+6: +3000 or so Crime. Three new criminals spawn in city, one of which is an Assassin that immediately suicides against police. Total of 10 criminals alive in city.
Again those assassins may be taking a default AI rather than the barb criminal AI for some reason.

Of potential interest, all 8 of the attacking criminals were Assassins, Cutthroats, or Scoundrels, all of have been superseded for production by later criminals. The more up-to-date criminals (Street Gang, Robber, Mobster Car, Biker Gang) were/are passive. I'll open up a gap in the containment ring to see if the withdrawing criminals go pillaging momentarily, and park a ship in the city too.
It's by design that emergent criminals may well be throwbacks tech-wise. Just because the state might feel the way those types go about crime is yesterday's news, doesn't mean people committing crimes are always the types to go about it with cutting edge methods. Today, we still have biker gangs, thugs, street gangs, yet the cutting edge is currently the cyber criminal. The state would not likely invest into using the first three as its own operatives (but may be hanging on to some old school types from agreements made in the earlier days.)

Also noteworthy, it looks like the properly passive criminals that are spawning are obeying the 10-criminal limit to further spawns, but the aggressive ones aren't.
That's a little interesting in itself. There are not two methods at work here... So again, is it possible that some aren't spawning but rather being sent in by an opposing government?

I'll let crime drop back down into the strongly negative again before demolishing the same set of criminal-spawning buildings and training another pile of Scoundrels, as in the first occurrence.
k
 
Are you 100% certain ALL of these are spawns? Could some be from an opposing nation sneaking them into the city somehow?
Yes. I counted the "A troublemaking X has emerged to wreak havoc in the city of Byzantium" events in the log, and checked against the criminals in the city as well. Numbers matched every time.

Do you have criminals of your own? Those should count against that limit too. And the limit isn't how many are spawned, it's how many the city should have at most after spawns take place. If there's 6 criminals in the city already, there should be a limit of 4 spawns that round and extremely unlikely to spawn the last few at all.
There were no criminals of my own in the city at the time.

hmm... Were those attacks against the mech rather suicidal? They sound like it. I wonder why they are so willing to suicide. But that's a deeper question I'm not going to try to get into answering any time soon.
Very much so. Strength 8 Assassins attacking a highly promoted Strength 150 Police Mech. According to the combat log, in fact, it appears that the Mech is getting the city's +1200%ish defense bonus too.

It's by design that emergent criminals may well be throwbacks tech-wise. Just because the state might feel the way those types go about crime is yesterday's news, doesn't mean people committing crimes are always the types to go about it with cutting edge methods. Today, we still have biker gangs, thugs, street gangs, yet the cutting edge is currently the cyber criminal. The state would not likely invest into using the first three as its own operatives (but may be hanging on to some old school types from agreements made in the earlier days.)
Oh I know, I'm just wondering if their obsolete-ness is somehow related to their AI issues or their apparent ability to spawn beyond the limit.

I'm quite certain it's not the result of an opposing government. I've checked the numbers of criminals against the event log, there's a highly promoted police dog with massive vision range in every one of my cities, and the criminals all have promotions matching those provided by buildings and wonders in my capital.

With another test, I managed to trigger another mass spawning of criminals despite an overall negative crime value. Once again, I demolished via Ctrl-A the Mob Storefront, Pawn Shop, and Meth Lab in the city, and queued up a repeating Scoundrel (production was somewhere around 30ish, didn't count them). A total of 19 criminals of varying types spawned in the city. Of these, 10 were behaving passively as they should be, and 9 went aggressive. Of those 9, two attacked and destroyed the only two ships in the city (a Modern Battleship and a Coast Guard Cutter) in separate attacks, one attacked and withdrew from one of the police, and 6 committed suicide against the police. I don't believe there were any civilian/air units in the city to begin with to check on that situation. The three survivors (withdrawee, two ship sinkers) then went on to pillage a nearby tile that I left accessible.

I didn't manage to see what happened on the following turn, as Alt-tabbing out to post this crashed Civ. I'm not sure if I saved this turn or not, but either way the mass spawn during negative crime seems to be consistently repeatable. It's definitely noteworthy that the number of criminals that apparently aren't getting the right AI matches the number in excess of the spawning limit of 10. I'm not sure if this was the case the first time around, but it's been true in all of my test cases so far.

The trigger seems to be related to the mass production of Scoundrels in some way. I'm honestly not sure if the demolishing of the criminal buildings is strictly related, but it's necessary to do so in order to make the upgrades to Scoundrels untrainable. Another possibility is that it's somehow related to the Scoundrels becoming Wanted, Perhaps there's some kind of strange interaction between the Investigation code and the criminal spawning code? I have a few things in mind to try for future tests, including dropping the crime to high negatives then building Scoundrels without there being any Law Enforcement in the city to do any Investigating.
 
Ok, a bit more messing around and I think I've actually got the cause narrowed down quite a bit. Apparently it's triggered purely by the presence of Scoundrels in the city. Basically, if I take a stack of Scoundrels and park them in the city, the next turn a large stack of criminals will spawn. I'm not 100% sure of this yet, but it looks as though the number of resulting criminals is always equal or greater to the size of the stack of Scoundrels. So far I've tried with a stack of 1, 21, and 22 Scoundrels. 1 Scoundrel did not cause any spawning, but of note that single Scoundrel did not have the Wanted promotion initially. The stack of 21, all Wanted, caused a stack of 31 assorted criminals to spawn. 22 Scoundrels, all Wanted, resulted in 32 spawned criminals. I'll try a couple of different stack sizes and see what happens.

The faulty AI might be a false lead, or an separate issue. In these past two spawns not a single criminal has gone pillaging or attacked/suicided on city defenders/police. Also, the "extra" units spawned in the previous, positive-crime tests might be the result of Scoundrels being among the spawned criminals then causing extra spawns.

edit: Update on the testing, parking 10 Scoundrels resulted in zero criminals spawning. 12 resulted in 24 criminal spawns. 15 resulted in 32 criminals spawning. Not sure if it's due to random chance, or if there's some sort of critical mass of Scoundrels to trigger spawning, or there's some other oddball factor involved. Also tried with 15 Thugs, same results. 24 Scoundrels, 12 Hajduks (Culture version of Scoundrel), and 15 Thugs all at once resulted in 32 criminals.

edit 2: Skip forward a few dozen turns, and just the 24 Scoundrels and 12 Hajduks has been consistently spawning 36 per turn, as long as I arrest all of the spawned criminals on the same turn. I've been dancing the criminals in and out of my city every other turn to trigger a spawn, arrest them, then give my Police Mechs a turn to heal before repeating. Slave farming made easy!

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.

Unrelated issues:
1) The Mormon LDS Missionary Training Center National Wonder removes access to Coffee, but not to Roasted Coffee. Thus, I believe it blocks only the construction of vicinity buildings (if any) and the Roasting House/Factory, but not the Coffee House or Cafe.
2) Biopunk unlocks a building that produces Organic Computers, but Organic Computers as a resource isn't otherwise unlocked until much later in the tech tree, at DNA Computing. This makes the one from Biopunk useless. If the intent was for Biopunk to provide much earlier access to them as a benefit, the reveal/enable needs to be moved forward. What happens if a resource's reveal/enable are set twice?
3) The Vertical Farm improvement is an upgrade to Farms, Plantations, and Pastures. However, several Plantation and Pasture resources aren't provided by Vertical Farms, so the upgrade cuts off the resource access. This includes Llama, Camel, and Incense. Almost certainly others as well, but I haven't gotten around to checking.
4) Extraction Facilities, the unit, display as a Modern Workboat. Not sure if the art assets exist to have it display the same as the improvement, but if not, then changing it to the same graphics as a Construction Ship would be better at least.
 
Nothing has happened as far as I know.

The TerrainNative etc is used by the default spawner.

The suggested XML is good. However there are two main problems
  1. The C2C spawning is based on turn/year not the tech level of the game so it is very difficult to balance. This is why we only get small locust swarms in the game at the moment. It is to difficult to figure out when the larger ones will provide a challenge but not overwhelm the civilizations.

    We don't want to spawn gunmen when the most advanced nation only has wooden spears.

  2. You can't spawn inside barbarian territory.

Without those two being addressed I don't think we can progress things. There are a number of Python mods that will spawn barbarians but they are designed to spawn stacks either of raiding parties or full on barbarian migrations.
If Spawn infos had a game era or 'top team tech prerequisite' tag that would supercede the 'year' date range, would that help?
 
If Spawn infos had a game era or 'top team tech prerequisite' tag that would supercede the 'year' date range, would that help?

Not supercede but have dates or game era or top team tech prerequisite is needed.

BTW the message about loosing the hunter promotions is having lost one of its prerequisite promotions, your Master Hunter has lost its Hunter III promotion and may now select a new promotion. you can then select the Hunter III promotion and as far as I can see it did not loose any promotion at all. I also had one loose both Hunter III and Hunter IV but was able to select them again.
 
Not supercede but have dates or game era or top team tech prerequisite is needed.

BTW the message about loosing the hunter promotions is having lost one of its prerequisite promotions, your Master Hunter has lost its Hunter III promotion and may now select a new promotion. you can then select the Hunter III promotion and as far as I can see it did not loose any promotion at all. I also had one loose both Hunter III and Hunter IV but was able to select them again.

1) OR is implied when all three could be used but IF all three ARE used then only one should be counted, thus there must be a hierarchy of which to use if someone foolishly uses multiple methods. Maybe... it might be possible to just say if any of the qualifiers are currently valid then use this.

2) Yeah, I finally set up a test and replicated the situation and it took some work to uproot the issue. What was happening was that each time a promotion is assigned, the unit checks for obsoleted or no longer capable of keeping promotions it already has and it also checks to make sure that the unit will be able to keep the promotion it's being assigned. This was a problem for upgrades because the prerequisite promotions may not yet have been assigned to the unit so as to justify this one carrying over to the new unit. So I made it run only one check on all promos at the end of assigning all promos. This corrected the issue and the fix is now on the SVN.
 
Save game uploaded

I declared war on jivario empire, conquered capital city Alto nanay and when i tried unload city guards they attacked sharshooters.

If you're going to upload a save, make sure to do so at the point I can manifest the bug with the next click. I'm not going through and declaring war and conquering a city to get at the situation.
 
Regarding the Grand Fire Festival, it requires Torches, but are replaced by Oil Lamps. I was unable to build Torches after having reseached Oil Lamps, even when I turned of "Hide Obsolete" or "Hide Replaced" buildings in the C2C's tab of the BUG options. (Not sure why; by comparison, all the obsolete bridge buildings were available.) Simple solution would be to require either torches or oil lamps, and possibly whatever other replacements there might be along that line, until the festival itself is rendered obsolete.

(I also wouldn't mind if a late building could be added as an alternative to the Volcano requirement.)

.

Is it intended that "normal" civs start with the Neanderthal culture? (Not 100% sure if it is all civs but I have their Native Culture with Hittite currently, and I'm sure I've seen it with other non-ME civs as well.) Normally I wouldn't much care but it does say 20% less food for cities. (Maybe this is a result of my starting in Ancient instead of Prehistory era?)
Are these issues still outstanding?
 
Great wonder - Rudolphine. Requires 7 astrology schools.

Can be built after discovery of Heliocentrism, which requires Navigation (after Astronomy), which obsoletes astrology schools.

Thus it can't be built.

p.s. if there any way to change victory condition in WB or options in existing game? Couldn't find any.

Looks like Observatory would be a better building. It is available at Astronomy and don't go obsolete.

Did you make this change then DH?
 
The first was a bug and got fixed or was not a bug and required explaining... can't recall which but recall addressing it.

The second I either couldn't get to crash or it was another animation bug that required shutting down the combat animation. Try it again and let me know how it runs for you but I recall addressing it as best I could.
 
I started a game on June 9 with (I think) the current SVN at the time. No game-breaking problems until 1420 BC, when the game hangs between turns. I went back to earlier saves and tried changing building queues, stopping all automated units, downloaded the latest SVN, that sort of thing, but every time I ended the turn at 1420, it would process a few things and then sit at the running cursor indefinitely. I had to shut down the game through task mgr. I've attached the save and log files, but if you need anything else please let me know. I'm running the game in Win7 on a fairly new gaming machine.

Hang was due to an EXE flaw in processing the great wall. I know it's a rare situation where it causes the hang but I don't think keeping the Great Wall art effect is worth a hang given that it also causes a crash in PBEM and Hotseat and has generated complaints of not working properly in some situations.

Down the road I may make a bug option to turn it on or off so that if it may be the problem it can be toggled, and this will keep those that love the visual effect happy.

But for now, this thing is far too wrapped up in EXE disagreements to maintain in the mod at this time.

After my next commit, you will not be seeing the Great Wall displayed on the map.
 
After my next commit, you will not be seeing the Great Wall displayed on the map.

I agree with this i never ever use it anyways, and besides China is the only one with a great wall, well until "stupid" Trump:devil:, lol
 
I'm getting this and a couple of dozen other similar errors when attempting to load the lastest C2C SVN, guys.

50zBhFd.png


As ever, thanks for your hard work on this peerless mod.
 
After my next commit, you will not be seeing the Great Wall displayed on the map.

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.

besides China is the only one with a great wall

Only if you ignore the Romans and Seirra Leonians

I'm getting this and a couple of dozen other similar errors when attempting to load the lastest C2C SVN, guys.

As ever, thanks for your hard work on this peerless mod.

That usually means a bad update. You will probably need to delete the old and get a new.
 
Status
Not open for further replies.
Back
Top Bottom