Delnar_Ersike
Prince
Features like these are much easier said than done. Humans can often just look at a battlefield an be able to see whether they're in a good position or not within a few hundred milliseconds, but an AI would have to run a boatload of calculations to do the same thing. There are a lot more actual factors that go into determining which positions are best for defense, especially considering rivers and the blocking of ranged attacks by rough terrain, and having all the AIs constantly calculate these each turn would slow down turns significantly even if I knew where to start.It requires that the AI have any idea whatsoever that it's at a disadvantage. When it is, I think it should place a higher value on fortifying infantry units on difficult terrain tiles adjacent to its cities. This should significantly slow advances into an AI's territory and substantially help city states, which often have fewer units and can't afford to be making too many risky assaults.
On the plus side, I can make the AI realize that it is better off fortifying on a tile than attacking with a melee unit: it's already in as a part of the newly remade DangerPlots, though it still has a few small issues (if a unit is already fortified, the AI does not currently consider that it will lose its fortification bonus if the unit attacks).
That's kind of the problem with wonders and the flavor system: a lot of wonders are so conditional that a flavor system is never good enough for them.Oh, and is it possible to tell the AI that if:
1. All religions have been founded and
2. It didn't found a religion that it
3. Should not attempt to build the Hagia Sophia?
Basically, everything the AI can produce or build has a set of flavor values that is multiplied by the AI leaders' intrinsic flavor to produce final flavor values, which then get summed up and compared with one another to determine what the AI wants to produce. For example, Barracks have one flavor value, Military Training, so whether the AI wants to build Barracks in their cities relies primarily on the value of the leader's Military Training flavor. Note that currently, flavors for individual buildings cannot be changed throughout the game, so eg. Barracks do not get Happiness flavor if the AI selects the Autocracy tenet that makes Barracks give +2 happiness. Buildings that unlock future buildings also don't get any additional flavor modifications: Celts AI does not give any additional priority to amphitheaters, even though they are required to unlock the Celts' UB opera house replacement.
Wonders have the additional problem of their effects being very situational: AI cities will assign Petra the same flavor values whether the city only has one flatland desert or 6 desert hills. Pyramids get the same flavor whether the AI has two workers for five cities or five workers for two cities. Terracotta has the same flavor whether the AI has five units around the city or no units.
Once I have a closer look at flavors and the flavor system in general, you can be sure I'll have something in place that will reduce the AI's willingness to build wonders that give free GP's if it couldn't use those GP's for anything worthwhile. Right now though, I'm concentrating on my DangerPlots and TacticalAI stuff. Plus, I have a life outside of modding, and currently that life will contain four fairly difficult exams in the near future.
In the meantime, I discovered one more problem with the way the AI handles attack targets: because attack targets are looked for at the beginning of the tactical AI's turn, any units that are not visible to the AI at the beginning of its turn are never attacked on that turn. Once again, this hurts naval combat the most, not just because it gives submarines a huge advantage, but also because there are more cases of naval units discovering an enemy unit during their turn due to their high movement speeds. Between this and the AI's inability to handle units that can push or withdraw (Winged Hussars, Slingers, Scouts with Survivalism III), guess what's going on the chopping block next for v10's TacticalAI changes...