AI coastal defence

Tekamthi

Emperor
Joined
Aug 12, 2016
Messages
1,671
Is it just me or is coastal defence a particular weakpoint in AI tactics right now in VP?

Don't get me wrong, I love having useful navies, and am working on my own mod mod to hopefully bring a little more AI accessible depth here; but I often find the AI makes a disappointing showing from the shore against even a modest naval force executing a very simple attack.

I'm playing a 43-civ deity marathon hotseat game with my housemate right now... this is an extreme setting I realize, as this game will probably span 6 months or more, but it has emphasized what I've noticed across many settings lately. An effective human coastal defence looks drastically different from the AI's attempts, much moreso than any similar disparity between ai/human land borders.

I had a terrible start in this game as Iroquois with relatively little forest to work with, most of it spread around hills and mountains, with incans to the south, celts to the southeast, and babylonians to the east. Add a bad decision or two along the way and skip forward to the 1700s, and I've only just finally stabilized the region, and due to several millenia of various struggles am solidly a 2nd world leader in maybe 5-6th place overall. I've had to face a strong naval invasion from 1st place arabia across a small ocean generally once per era of military units. I am always one era behind w/e arabia brings in these fights. My own small, outgunned navy was annihilated early on trying to engage in open ocean and has since been relegated to coast guard duties only, but I've nonetheless held off these repeated invasions rather easily by building a network of roads along the coast and 2-3 citadels on key peninsulas or juts of land, a few forts at key beaches or 1 tile inland, and a team of infantry/mounted archers and ranged ships, w/ 1-2 mounted melee units to mop up the odd enemy that makes it ashore.

Contrast this with the AI's coastal defence against similar invasions. There are no coastal roads, no forts, no citadels. Most island-locked civs seem to build large melee armies, which they then serve up eagerly to the first human frigate navy looking to XP feed on its beaches and coastal tiles. Embarked melees are still common in this scenario.

I wonder if the AI could treat its coasts somewhat more like it treats its land borders, where it places the odd fort and citadel, maybe connect at least some basic roads to these (i'd love to see AI roads into border forts/citadels generally, this is another disparity in human vs ai behavior that seems very common) and focus ranged units over melee to these areas. These alone might go a long way to allowing the AI to make a respectable showing here rather than embarrassing itself and depleting its entire army for almost no damage as it currently does.
 
If you have datas (save, logs, ...) about suicidal embarquation, and useless land armies, post them on Github, it migth help to correct the AI logic.

Lets talk about roads :
Teaching the AI how to put roads is a nightmare. And previous attempts to teach him "tactical roads" were a failure. Teaching it when a road is useless and can be removed is even harder, so the AI ended-up with a lot od useless roads and not enougth money to maintain them.
Main problems are :
1) Computation time ! Most of what you do with you mind is very long compute if you don't use heuristics (which are hard to find, and never perfect) or machine learning (out of the question for this mod)
2) Data storage. Complex tactics usually need you to store some data from one turn to the other, and you need to ask yourself what to store, how to store it, when some data have to be recomputed because of new informations. In order to illustrate how much simple data storage was a problem, the fact that you keep line of sight on tiles you see until the end of the turn was added because the AI used to forget the position of ennemy units.

More generally, the AI does not have a good understanding of any tactical situation (better than vanilla, but still not good), meaning that the AI will generally be unable to find a solution to its problems. And defensive strategies are far more complex to implement than offensive strategies, especially against hight speed units such as a fleet. So yes, coastal defense is one of the few things the AI is still weak at.
 
Very convincing argument why there wont be any "war roads." But what about coastal forts/citadels? And what about a higher ranged land unit compisition when engaging in a coastal war?
 
If you have datas (save, logs, ...) about suicidal embarquation, and useless land armies, post them on Github, it migth help to correct the AI logic.
....
More generally, the AI does not have a good understanding of any tactical situation (better than vanilla, but still not good), meaning that the AI will generally be unable to find a solution to its problems. And defensive strategies are far more complex to implement than offensive strategies, especially against hight speed units such as a fleet. So yes, coastal defense is one of the few things the AI is still weak at.

Totally fair points.

Maybe I could boil it down to this as a starting point: The AI does manage to put forts and citadels down in at least the right areas often, if not always the perfect tile, and recognizes land borders in some way for this purpose. Rather than a broad tactical road analysis, could the road logic simply be to connect at least the citadels to the nearest city, so the AI can reasonably rotate units in and out of these improvements? It seems to try to move its units to forts and citadels more often than not w/o roads already, and has come a long way in recognizing the value of citadels from vanilla, though w/o roads they lose out on much of the value of an otherwise well-placed (sometimes) fortification. On deity at least it seems the AI is rarely lacking in gold for a little more maintenance. Would the presence of a fort/citadel within say 2-3 tiles of a border not create somewhat of a simple, binary condition to connect roads to? Then have certain coastal border situations trigger the same land border logic for fortifications....

Thanks for the detailed reply. I do have a save, I'll try to track down which one shows this best through the afternoon here, and get it on github.
 
Last edited:
I have the same feeling. I also played Iroqouis my last game. I was placed alone on an island so had pretty decent start. The only way I could attack someone was using navy. And I attacked cities one by one (America and Ottomans). I sinked their navies very quickly (they were just moving around and their attacks weren't coordinated at all), then instead of moving all units to the coast they sat inside the continent and watched me attacking city turn after turn. But when I got into the continent by capturing the city I met a wall. Attacking city on the land was at least 5 times harder than from coast. I hope You could balance it somehow.
 
Totally fair points.

Rather than a broad tactical road analysis, could the road logic simply be to connect at least the citadels to the nearest city, so the AI can reasonably rotate units in and out of these improvements? It seems to try to move its units to forts and citadels more often than not w/o roads already, and has come a long way in recognizing the value of citadels from vanilla, though w/o roads they lose out on much of the value of an otherwise well-placed (sometimes) fortification. On deity at least it seems the AI is rarely lacking in gold for a little more maintenance.

This has to have already been tried right? If not, sounds awesome. If it works, then we could also get them to connect citadels to nearby forts (adjacent+1) and citadels (adjacent+3), but not fort to fort.

This way they don't have to "think" about making war roads, but have an automatic network of roads centering around their citadels. The road range could also be lowered if maintanence is an issue.
 
as somewhat of a bandaid i created a coastal fortress building available at metallurgy vaguely reminiscent of civ 3's, except working with existing VP framework of course.. requires harbor. 2 maint, +2 city def, + 10 hp, upper end of era cost, cuz most importantly it adds the minefield movement penalty effect much earlier (flavored same as minefield)..

Seems like a decent fit so far, and as a kind of "dumb" area effect the AI is now a little more capable around its coastal cities at least. I should note that we are also using hex conquer 'n release mod as one of only 2-3 small add-ons, and the combined effect here results in a coastal invasion alternative to the city-first approach of finding a lightly defended beach, capturing a few tiles, fortifying, and building forts or citadels to establish a solid foothold... the AI makes use of this to an extent, too, as they are more inclined to rush troops onto shore a little further away from cities and earlier than human usually prefers, and they get somewhat rewarded for this behavior with these rules in place... the added coastal city defense might stagnate naval game w/o this, hard to say....

Anyway so far this has created an interesting back and forth in our game between the early frigate-rush-dominance, followed by some stability as most get this building in place eventually towards the end of the renaissance, followed by the 2-range industrial dominance from cruisers again that don't need to get in as close to cities and are less affected by the movement penalty. I think minefield was too late and too expensive to be super useful on its own.

Lagging well behind the other human, I'm also hoping this might help me hold onto my coast as I will surely face at least one arab-coalition invasion w/ air before I get my own AA fully established....
 
Well, it looked like a simple way to narrow the gap between humans and AI. Just a suggestion, though.
 
G I wonder if you've looked at england w/ Great Lighthouse since attack and move change to naval? Seems to favor human very heavily, especially at SoL. This is where we've noticed most pronounced AI deficiency in our game.. human england has enjoyed dominating of course, and has helped clear the coast of arabs once or twice so I'm happy, but has conceded its just TOO easy. human SoLs w/ 7 moves was unstoppable - now with more movement from the industrial era policy branch and +1 range at cruiser, they rarely face any real threat of even taking any damage, and can roam around w/o any melee escort.

In addition to moving up the 'minefield' effect, we are playing GL obsolete at dynamite (still a concession on civ 1-4's magnetism, I've argued :p), but with added sea TR +1 tourism & +6 range bonus to compensate. Human england will upgrade bulk of SoLs anyway -- however with treasure fleet yet to come and an england 1st in production capacity, there was no avoiding some kind of compromise was needed here, even on top of moving up the minefield effect.

On the other side of continent I have finally just tamed a hostile coastal babylon w/ great wall. I shudder to think of doing this over again with added coastal hp from latest update :p

w/o massive movement dif and 2-attacks on every ranged boat, naval game has been a lot more enjoyable/challenging elsewhere...
 
Last edited:
That's when you found what I call "core wonder". In this case England (and also Netherlands).

Changing one wonder because of one or two particular Civ is not necessary in my opinion.
 
The Netherlands UA doesn't stack w/ GL though, nor does it result in his UU not taking any damage in most fights... William is still powerful with GL as he should be, but it doesn't result in nearly as dominant an effect as with england... williams boats still have to stop next to w/e they hit on their first attack even if they can move a little faster.. england though is +1 faster out of the gate, hits twice AND w/ an early promo can now almost always move out of range again to end its turn.. the result is unmatched in any VP UA/UU/wonder combo that I've played so far, though admittedly I've got about 25 civs I've never tried here yet. The GL effect went unchanged during summer's naval change, and I don't think its really been considered here.

I'll be playing with some changes I described above regardless moving forward, and I'll eventually get something packaged into a proper mod mod for anyone with similar concerns, but I'd encourage the community to have a close look at the england/GL situation.. there is just no legit way for the AI to fight back from what I can see, and this isn't fun.

The GL change we made is fairly small... if anything GL is even more powerful in early game up to dynamite obsolescence now (TR tourism/range bonus we added seems a little more inline with reality which we like too). Didn't obsolete the promo itself, so england's navy will retain a very fast, elite core unless they get sunk. And if you look at the tech tree closely, obsoleting this naval wonder at dynamite encourages GL owner to take a very niche path all the way to dynamite-free atomic era and penicillin to put GL buff on subs (the logical part of my brain has always had trouble with civ 5's great-lighthouse-accelerated subs and carriers, but this obscure path to them seems a tolerable compromise).

Anyway maybe I'm too biased having played civ 1-4's magnetism-obsolete GL for so long, but w/ treasure fleet available around the time dynamite is in-play, I don't feel that keeping GL navies to end-game adds anything (again... why do navies care about a lighthouse, no matter how great, after radar and satellites etc?? why doesn't the great wall get the same treatment?)

Really the most important change to help out the AI in this game was moving up minefield movement penalty to a late-renaissance/early-industrial building. There is good historical basis for coastal fortifications and batteries becoming a more important factor in warfare around this era. In a perfect world I'd add a dmg penalty to the actual minefield now too, but alas my lua and c skills aren't there yet...
 
Last edited:
As the only wonder in the game that buffs navy I prefer current version. Both extra vision and extra movement on the sea so far has won me plenty of battle when playing not-Netherlands or not-England. I too am biased about Great Lighthouse because of that unique effect it gave to your empire; more efficient navy. Haven't played civ 1-4 though.

As a side note, perhaps in the future you will be interested playing another civ and discover another close to OP wonder, especially early wonder. Cheers.
 
As the only wonder in the game that buffs navy I prefer current version. Both extra vision and extra movement on the sea so far has won me plenty of battle when playing not-Netherlands or not-England. I too am biased about Great Lighthouse because of that unique effect it gave to your empire; more efficient navy. Haven't played civ 1-4 though.

As a side note, perhaps in the future you will be interested playing another civ and discover another close to OP wonder, especially early wonder. Cheers.

Yeah I hear ya on how nice GL is playing as non-naval powers... when grabbing it against this human england (as I find myself playing very often against with this friend), it essentially cancels out this part of their UA for the entire game and allows me to breathe a little easier almost from the start. To be honest though I still find this maybe too powerful an effect (in all previous civ games it was basically same buff as now, but obsolete at equivalent of VP's navigation). I don't think my GL change is really gonna help the AI too much though, cuz the promo will still be active for a long time and in our game we already have other + movement + sight options from policies and treasure fleet in play (I'm guessing you don't count TF/grand canal as a wonder, but it does put a UB in one of your cities, and is one-of-a-kind like a wonder w/ basically a same but better version of the GL promo). This GL change will just put a cap on the growth of the most elite of this near-invulnerable force england has accumulated, and make the human behind it play a little more cautiously while nonetheless dominating the naval game til the end.

Anyway to anyone else looking for quick fix to weak AI naval opposition, I'd focus on the change moving minefield effect on an earlier building.. the GL stuff is secondary. If anyone else adopts this change and comes up w/ something creative & relevant to do with the minefield afterwards, I need suggestions!

RE: other civs w/ OP wonder combos... I haven't found any yet that match this through trialing maybe just under ~20 VP civs so far... I suppose I don't look for yield multipliers the same way if that's what you mean, since AI is more adept at benefiting from these when contrasted to military effects (ie AI w/ GL is nowhere near as strong as human)
 
Last edited:
Top Bottom