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

AI has lots of subdued animals on noble difficulty and seems to know what to do with them on Normal.
They don't do as well with Teleport animals off, of course. Humans are a lot better at managing that option.

Sounds like some improvements to their promotion selections could help a bit.
The AI code was originally designed for the Hunters to deliver captured animals to the city.
We have too many useless buildings that's the problem they where designed in spreadsheet and batch added without anyone questioning if they are really needed or provide some value.
The AI doesn't build buildings like this one at all because they are pointless and have no value. Hunting Instructions is a prime example of that it only gives one free promotion and I think it was 1Education per turn that makes it a prime example.
With all the other buildings and units there are lots of better things to build for the AI.
These are actually different modders and their perspective on what should be done. I don't think there was ever a spreadsheet used in the design.

Me, I went for minimums ie one or at most 2 things from a building, Hydro went for three or more of each thing, Things = culture, money, food, hammers, bonus and promotions. At the peak there were more than 4 modders adding buildings all with little or no understanding of what the AI code for buildings actually does and going by what we were told was the way to get said buildings built by the AI.

Hunting Instruction is one of mine. I presume you mean perceived value ie the code was written to see no value in it. I was told that any free promotion was as valued by the AI code as much as and free bonus and designed my buildings to fit.
 
Me, I went for minimums ie one or at most 2 things from a building, Hydro went for three or more of each thing, Things = culture, money, food, hammers, bonus and promotions. At the peak there were more than 4 modders adding buildings all with little or no understanding of what the AI code for buildings actually does and going by what we were told was the way to get said buildings built by the AI.

Such misinformation is bad and explains some things.

I exclude you then I say that for some modders adding stuff was the only priority they didn't even think about the ai or actually testing the stuff they added in game.

Hunting Instruction is one of mine. I presume you mean perceived value ie the code was written to see no value in it. I was told that any free promotion was as valued by the AI code as much as and free bonus and designed my buildings to fit.

A bonus can be much more valuable because it can enable a whole chain of other things. Like units, buildings which enable units or buildings or give another free bonus and so on............

A single free promotion has no value compared to that. I already increased the value of free promotions from buildings a while ago.

In case of that particular building I already pointed this issue out a few times and any changes to give it more value or go another direction where declined.
 
In case of that particular building I already pointed this issue out a few times and any changes to give it more value or go another direction where declined.
Please remind me I am in the process of reviewing the whole hunting aspect and more ideas will be useful.
 
AI has lots of subdued animals on noble difficulty and seems to know what to do with them on Normal.

The AI code was originally designed for the Hunters to deliver captured animals to the city.

Have you actually gone into WorldBuilder, and checked the AI cities for how many Myth Effect buildings they have in the city, for example around the discovery of Sedentary Lifestyle? Disregarding the Myth Effects that don't come from animals, of course.
 
Don't care if we need to for a fix. But I'm going to let you do the honors.

That said, I DID find the problem with under-reacting in regards to crime and disease in the code. Sorry Joe, don't take this as I'm 'looking after you' or trying to audit your work, but after the fix I also have to change back the AI weight settings as they were dialed in just right before this bug showed up. I wasn't looking at it in suspicion of your changes, just in suspicion that something was probably wrong in the machinery and I was right. Apparently the problem was rooted in a part of the structure using the game era count (and one too low at that) rather than the player's era. This means the symptoms were visible now because the calendar was lagging and while this had always been an issue in the prehistoric, it was now an issue well and into and even possibly through the Ancient as well. Believe it or not, the date CAN make a difference in a lot more than just player role playing and spawns. That said, it probably shouldn't have been anything but the player's era being referenced there all along.

I'll be committing that later. There's other things I'm looking into here as well. And it MIGHT have to do with improper indexing.

Maybe I can speed things up and include this fix myself. You're simply saying "count" should instead be "value" right?

Theoretically, this MIGHT correct some things after the initial issue is resolved so saves may be recoverable. Hard to say yet. It might explain some of the bad behaviors we're seeing from the AI, yes.

Not sure it fully explains the settler thing but maybe. They seem to be training them then disbanding them a lot, which is really messing with their progress of course. And initial study suggests they are getting disbanded because there's no valid city spots being found where there are a LOT of valid city spots. That may not be a result of this bug. But it could sure explain some things like failure to move as they should, which could really be more at fault. I've only found the 'no city sites' issue showing up in the city AI sequence... have not yet seen what exactly takes place in the settler unit AI routine that actually leads to the disbanding.

Wasn't SVN 9927 close to v38 release? I remember prior to release the AI was being far more active and difficult on the world stage.
 
We have too many useless buildings that's the problem they where designed in spreadsheet and batch added without anyone questioning if they are really needed or provide some value.
The AI doesn't build buildings like this one at all because they are pointless and have no value. Hunting Instructions is a prime example of that it only gives one free promotion and I think it was 1Education per turn that makes it a prime example.
With all the other buildings and units there are lots of better things to build for the AI.
My jaw dropped a little at this... if this isn't valuable enough to build then something is wrong with the way we are asking the AI to evaluate buildings. This is by no means a useless building - it becomes my highest build priority as soon as available.

I have said this since Hydro starting putting in the "sports" buildings on, i "personally" see NO need for these buildings all along and ALOT, ALOT more like this . .
I want to make the sports buildings offer a little XP to various direct weapon type combat classes to reflect that society gets some unique benefits out of the games it promotes and plays. That said, limiting how many can be constructed in a given city might make it a bit more interesting than just a mass of stuff to build. I have a concept of how to make that possible but it's not an overnight thing to implement yet.
 
The AI code was originally designed for the Hunters to deliver captured animals to the city.
They do. They just don't do it as well as humans do. They are more likely to die along the way and they don't setup hand off chains so that good hunters don't have to walk all the way back to the city before handing off the animals to units dedicated to escort roles and getting back to the hunt. They don't do as well knowing when to hunt along the way home when they see something worth capturing either, and they tend to spend a lot of time waiting on healing when they could or should just get them home and they tend to not make quite as smart decisions as to whether to heal in place or run for a better defensible position when something dangerous approaches where they are hunkered down to heal.

Wasn't SVN 9927 close to v38 release? I remember prior to release the AI was being far more active and difficult on the world stage.
Yeah. But right at release it was a lot more active as well - unfortunately in many of the wrong ways, but also in some correct ways. We haven't noticed any problems with the AI performing missions so I don't really suspect that there was a bug there until later tweaks and I also don't have strong suspicion that it has had much to do with the weaker AI responses now. I'm not sure what may have changed that. In a lot of ways the AI is working better and more like it was intended to than it has in a long time... and yet, it's just more slowly reacting.

@All I'm kinda thinking that it's finally defending itself as strongly as it was supposed to be but that's hindering it a little because there have been SO many barbarians coming at them. Barb spawns, particularly neanderthals, and not just the cities, currently seems very high from what I am seeing. A constant degree of threat can really hinder the AI more than the player.
 
Just out of curiosity:
Lets say building X is required to build building Y, that is required to build building Z.

Can X building value be increased depending on how much buildings in chain requiring X are unlocked?
That is for example you unlocked Library (or other building used by lot of buildings), AI builds them normally.
But if you unlock 10th building needing Library somewhere in chain, then AI will try to get libraries in all cities as soon as possible.

For example omega crew requires one of +health (or -disease) buildings, so AI doesn't see it.
But with this building being unlocked by tech AI would be tempted to build its prereqs.
 
They do. They just don't do it as well as humans do. They are more likely to die along the way and they don't setup hand off chains so that good hunters don't have to walk all the way back to the city before handing off the animals to units dedicated to escort roles and getting back to the hunt. They don't do as well knowing when to hunt along the way home when they see something worth capturing either, and they tend to spend a lot of time waiting on healing when they could or should just get them home and they tend to not make quite as smart decisions as to whether to heal in place or run for a better defensible position when something dangerous approaches where they are hunkered down to heal.


Yeah. But right at release it was a lot more active as well - unfortunately in many of the wrong ways, but also in some correct ways. We haven't noticed any problems with the AI performing missions so I don't really suspect that there was a bug there until later tweaks and I also don't have strong suspicion that it has had much to do with the weaker AI responses now. I'm not sure what may have changed that. In a lot of ways the AI is working better and more like it was intended to than it has in a long time... and yet, it's just more slowly reacting.

@All I'm kinda thinking that it's finally defending itself as strongly as it was supposed to be but that's hindering it a little because there have been SO many barbarians coming at them. Barb spawns, particularly neanderthals, and not just the cities, currently seems very high from what I am seeing. A constant degree of threat can really hinder the AI more than the player.

Nah, my statement was more along the lines, perhaps 9927 made up a bulk of the issues we didn't want to see as a whole. Not saying remove it entirely, since its far too late for that, but rather a statement of "If the AI was performing well prior to v.38 and there were massive code edits just before release and release was broken, lets look at this stuff." And we just identified a rather big issue.

EDIT:
Is the barbarian spawn really that high? I rarely feel like there's enough barbs on the map to feel deeply threatened by them.
 
Last edited:
EDIT:
Is the barbarian spawn really that high? I rarely feel like there's enough barbs on the map to feel deeply threatened by them.
Well 10 barbarian cities on Duel map is a lot and 10 barbarian cities on Gigantic aren't that much.
10 barbarian cities spawning in first 100 turns feels differently on Eternity and Blitz.
Are barbarian spawns scaled by game speed and map size?
 
My jaw dropped a little at this... if this isn't valuable enough to build then something is wrong with the way we are asking the AI to evaluate buildings. This is by no means a useless building - it becomes my highest build priority as soon as available.

The CIV4 AI coding isn't good at all it only worked because the AI gets huge bonuses this is still true.

Compared to lots of other things that building has no value because for the AI only the total sum of all effects a building has for the selected BUILDINGFOCUS counts.
That building only gives one promotion to one class of units UNITCOMBAT_HUNTER. Free promotions only count for BUILDINGFOCUS_EXPERIENCE and for the AI BUILDINGFOCUS_EXPERIENCE has a low priority unless it suffers losses in combat. But even it that case other buildings might have a higher BUILDINGFOCUS_EXPERIENCE value if they give more then one promotion.
 
Nah, my statement was more along the lines, perhaps 9927 made up a bulk of the issues we didn't want to see as a whole. Not saying remove it entirely, since its far too late for that, but rather a statement of "If the AI was performing well prior to v.38 and there were massive code edits just before release and release was broken, lets look at this stuff." And we just identified a rather big issue.
Well, I guess I was trying to say it remains to be seen now that it's 'corrected' or reworked, how great an impact it actually had. I was trying to give some of the causes to suspect or not suspect how much impact we may have had from it.

Are barbarian spawns scaled by game speed and map size?
I didn't setup the scaling but it seems to me that there's a lot more animals and barbs spawning on faster speeds which seems completely the opposite of what it should be doing because I don't think it should matter what game speed you're on, the map should roughly have the same density of encounters on all settings.

My wife's game and feedback is what I'm going off of here - it is her suspicion that the barbs have severely hampered the AI. I'm not really sure. She's playing on Epic speed, Monarch difficulty.
 
@Thunderbrd you missed my question about making buildings more valuable for AI as more and more of other buildings, that require them gets unlocked.
 
The CIV4 AI coding isn't good at all it only worked because the AI gets huge bonuses this is still true.

Compared to lots of other things that building has no value because for the AI only the total sum of all effects a building has for the selected BUILDINGFOCUS counts.
That building only gives one promotion to one class of units UNITCOMBAT_HUNTER. Free promotions only count for BUILDINGFOCUS_EXPERIENCE and for the AI BUILDINGFOCUS_EXPERIENCE has a low priority unless it suffers losses in combat. But even it that case other buildings might have a higher BUILDINGFOCUS_EXPERIENCE value if they give more then one promotion.
This isn't quite Civ4 - Koshling has completely rewritten this stuff. But maybe you're meaning to say C2C directly. And I'm sure there's a lot of things to be improved on.

For example, XP should be a very high priority for the city or cities that tend to build the military and other units. I realize that it's probably not setup very well right now to select a 'best city for building explorers' but that's something it really should do and in those cities, anything that would benefit a hunter or recon unit should really be very high priority. Something I've known we needed to establish for a while now.

Because honestly, you are right that most cities shouldn't bother with this building, but the capital, unless another city has an odd reason to be better for focusing on training explorers from, should really consider it a very high priority to build this thing right away. Might even want to delay training some desired hunters until that's constructed, which is a trick I think we did implement on some unit training - to wait until all most available XP or promotion giving buildings are constructed before getting into training those units. I'm not sure where but it hasn't been done for such high priority trains like Hunters yet.

And of course, this building does get potentially selected to build if education comes up as a real need in the city. In the evaluation of how to address property control need, there's an attempt first to find applicable buildings to help with that need and build them first.
 
@Thunderbrd you missed my question about making buildings more valuable for AI as more and more of other buildings, that require them gets unlocked.
Sorry - I gave up in mid post trying to understand it. The English was too hard to follow on that one.

But trying a bit harder, I think I'm getting what you're pointing at and I have to answer that I don't know how we would achieve that effect without a lot of slowdown in AI processing. It's possible we could do something at game load that would cache this kind of value of what buildings a building unlocks by prerequisites, and I'm pretty sure that there is SOME added value from that already somewhere - I know it is implemented in civic evaluations so Koshling was capable. But I haven't really dug into the overall generic 'let's figure out the value of all the buildings and see which one comes up as best to build right now' function that deeply to know how effectively it looks at the value of the buildings being unlocked by a building. I only suspect it's either missing or weak due to what I've seen in AI behavior. And from what I've seen from where this kind of thinking is applied to techs and civics, it's a time costly process. So ... it might be improvable.

Project # 800243
 
Have you actually gone into WorldBuilder, and checked the AI cities for how many Myth Effect buildings they have in the city, for example around the discovery of Sedentary Lifestyle? Disregarding the Myth Effects that don't come from animals, of course.
The Myth Effect building means that the Myth was built by an animal in another city. That way you only need to look at one city to see what Myths have been built by the empire. And yes I did, but earlier than Sedentary Lifestyle but, I admit that was before v38 came out, so I may be a bit out of date on that.
 
The Myth Effect building means that the Myth was built by an animal in another city. That way you only need to look at one city to see what Myths have been built by the empire. And yes I did, but earlier than Sedentary Lifestyle but, I admit that was before v38 came out, so I may be a bit out of date on that.

I have some old games from half a year ago, and checked AI cities there, and some civs had many more Myth Effects than in my latest game, and earlier in the prehistoric, too. It is of course based on a limited dataset (the difference may be simply caused by coincidence) but my preliminary conclusion is that the current AI is less effective at collecting animal Myths than it used to be.
 
This isn't quite Civ4 - Koshling has completely rewritten this stuff. But maybe you're meaning to say C2C directly. And I'm sure there's a lot of things to be improved on.

For example, XP should be a very high priority for the city or cities that tend to build the military and other units. I realize that it's probably not setup very well right now to select a 'best city for building explorers' but that's something it really should do and in those cities, anything that would benefit a hunter or recon unit should really be very high priority. Something I've known we needed to establish for a while now.

Because honestly, you are right that most cities shouldn't bother with this building, but the capital, unless another city has an odd reason to be better for focusing on training explorers from, should really consider it a very high priority to build this thing right away. Might even want to delay training some desired hunters until that's constructed, which is a trick I think we did implement on some unit training - to wait until all most available XP or promotion giving buildings are constructed before getting into training those units. I'm not sure where but it hasn't been done for such high priority trains like Hunters yet.

And of course, this building does get potentially selected to build if education comes up as a real need in the city. In the evaluation of how to address property control need, there's an attempt first to find applicable buildings to help with that need and build them first.

There is no code to directly force the AI to wait until all most available XP or promotion giving buildings are constructed before getting into training some units and i'am against adding such code.
This would only make the AI code more complex and error prone. We already have too much code filled with errors as it is.


In case of the Hunting Instruction we already had this a few times and @Dancing Hoskuld was against all changes.

  • I would make the Hunting Instruction additionally providing something like +20% production towards Hunters.
  • The Promotion is important so it should be given by the tech Perisistence Hunting to all newly trained hunters even if you don't have that building.
  • The Hunting Instruction would still give the promotion to already existing Hunters.
This might sound like a really stupid idea from someone dumb but it would help the AI without any complex AI coding changes.
 
I would make the Hunting Instruction additionally providing something like +20% production towards Hunters.
Like it.
The Promotion is important so it should be given by the tech Perisistence Hunting to all newly trained hunters even if you don't have that building.
Don't like it.
The Hunting Instruction would still give the promotion to already existing Hunters.
Like it. Provided that the Hunters have to come back to the city for a round for the training, which if you're looking at using the tag I think you're talking about, would require that. Otherwise we're talking about a give free trait which gives free promo method. That seems more at least national wonder level.
 
There is no code to directly force the AI to wait until all most available XP or promotion giving buildings are constructed before getting into training some units and i'am against adding such code.
This would only make the AI code more complex and error prone. We already have too much code filled with errors as it is.
I wouldn't advocate 'forcing it', so much as really working on promoting that the AI identify the cities that it wants to build certain unit types from and more strongly and as a greater priority be compelled to construct those buildings that enhance such types of units. All cities can be more mildly concerned with such training boosts at a lower priority, nearly last priority really, but higher than just shifting over to gold or research process.
 
Back
Top Bottom