This is the worst over simplification of a problem I've seen in a while.
First of all this is some seriously complex software, finding niche cases like this can be incredibly difficult and can be the result of hundreds of thousands of lines of logic spread out across a huge code base. Software isn't built as one gigantic script of if else statements..... in fact the worst sort of programming practice is to do what you described above.
There may well be problems with the AI but what you think should be an easy fix here or there is just not true. Especially in a codebase like Civs that's grown for decades. Rest assured it's a much more complicated issue than you'd imagine
Hi!
I’m certainly not disagreeing with you. The UPT tactical aspect of the game is super complex. It is probably the single most complex thing to program properly. I am aware of that.
However, It is not a matter of changing its tactical combat behavior. Its a matter of changing its built behavior. If you limit its unit options, or change its built priorities, it is less likely to make tactical blunders.
For instance:
Map = 60% land tiles
40% = water
If only 7% or less of the total amount of water tiles is ocean (or if ocean tiles are highly fragmented), let AI prioritize ranged ships other than subs. This is a very simple map calculation and a solution to at least
minimize builts of “useless ships”.
The other way around, if map has huge chunks of ocean tiles, make subs more likely.
Problem with civ is that AI builds same kind of units in every city regardless of the location/characteristics of that particular city. If city is adjacent to a lake, don’t build subs. Simple.
You can’t build an observatory in a city without an adjacent mountain. AI will not do it because its a simple rule. Same thing. Simple coding.
(What if AI shares the lake with an opponent city? It will still not put a sub in a lake. Who on earth puts a stealth boat in a lake?)
In the eind, AI turns might end up taking a bit longer to calculate, but so be it.
Although a queen is a more powerful piece, sometimes “upgrading” your pawn into a knight, is the better option