Assertive Seawall AI

Spain, England, Italy, and Dutch all seemed to play well. I would stick to Euro civs as the Asian and Native civs need some specialized attention.

Arhipelago was the map.

Ok. Archipelago still shouldn’t be playable yet. I’ve got some ideas on how to implement a way to take new islands but lots of problems are arising.

It’s not the island hopping y’all might be waiting for, but it is some other cool stuff:

  • Minor change to warship prioritization so ai builds more frigates in age 3
  • Sophistication added to warship attack plans. AI calculates desired fleet size based on target type (native fleets scaled accordingly)
  • Check for forts and towers and make galleons & monitors depending on what the enemy has
  • Naval attack time buffer removed (AI can constantly attack on water if it can find a target)

All the following moments are effectively AI vs AI:
Ships raiding fishing boats:

Warships attacking warships:

Warships attacking a dock/outpost:

Castles building next to docks:

In pursuit:

Last but not least, a decent sized naval battle out on the open ocean:


I’ve been playing some games with this and the previous update, you can really feel it coming together. AI now puts up a good fight at age 2. Still, I think some things need tweaking:

  • I’ve seen many times AI doesn’t use their wagons (any wagon) at age 2, and they will only use it at age 3. Outposts, TC’s, military wagons, etc, none will be used until age 3. As some AIS age up with the Governor (free outpost wagon), it really should be used as soon as it appears.
  • Not only the wagons, but it seems ai won’t even build outpost until age 3 (not sure about castles, war huts), when they should be going up at age 2, when my fleet is not that big and can be scared away with towers. This, in turn, will help maintain docks up longer, which translates in more sea eco and warships.
  • I’ve also noticed that, reaching age 3 and 4, normal outposts stop being a threat, especially if you have galleons. The Ai should try to update them to their appropriate age as a defence mechanism.
  • In my games, AI stills lags behind on fishing ships, and not necessarily because of raids, as I attack docks first before fishing ships. As a result, the AI tends to lag in the mid to late game.
  • The behaviour of changing dock location doesn’t seem to work ON SOME GAMES. At this point, almost all games have a point where AI changes location, but a couple of times they insisted on building it just in front of my ships and nowhere else in all the game.

Now, I know deck behaviour is finicky, but there are some shipments the AI already has in its deck but never sends:

  • AI always send their 2 Caravel shipment or equivalent first in age 2, but they usually always have a Galleon shipment or equivalent at age 2 that it never sends. It also tends to have sea upgrades, sometimes for ship attacks and sometimes for fishing gather rates, but they are never sent. In age 3, it usually has a Frigate or equivalent that it sometimes do use (I have to check, but I’ve seen Frigates appearing on top of my ships lol)
  • There is one card at least that I would argue should be in the AI deck and be used, and that is Schooners (or equivalent). This card reduces the cost of fishing ships, which would help it a lot, and some of their unique replacements for some civs, like the mexican one awarded with age up, also helps gather rates. Seeing as how the Ai tends to trip a bit economically starting at age 2, this card+the fishing upgrades would make them better.

I’ll upload some recordings later in the day so you can see some behaviour too. I still hasn’t tried it on Amazon or with Allies, those are my next tests.

1 Like

I was able to include most of those suggestions:

  • Add position influence for forts building near docks on island maps
  • tweaked values to tower placement near docks
  • Increased galleon shipment value
  • Tweaked new dock postioning values
  • research tower upgrade tech a little earlier on island maps
  • reserve resources for fishing boats on island maps

There’s still this issue where the towers keep building right next to each other.

As for Schooners, I haven’t seen anything excluding them so I’ll have to kick that can down the road. Admiralty, Extensive Fortifications, Heavy Fortifications, and Frontier Defenses are excluded despite seeming potentially useful, though.

I’m still working on the multi-island issue, but in the meantime I’m thinking of these two as well:

  • Garrison fishing boats
  • Varied fishing strategies

I can make the fishing boats scale to the number of fish, whales, and players. I don’t know how to tell a unit to garrison, but I can tell them to go to the closes tower or fort, which would be a step above what they currently do. Any thoughts on how that should be managed?

The wagon issue seems to basically just be a bug. There’s an existing rule that is supposed to handle it but it doesn’t work properly for whatever reason, even though it basically reads “is there an idle wagon? Build something with it”


I think I got the wagon issue fixed-ish. Portugal, age 2, TC right next to docks as it should be. Inca was a little slow to the ball but started using its wagons 30 seconds or so into Age 2. I think the issue was that the original function would assign wagons to an existing plan in the queue, but that plan might not show up for a long time. I just commented that part out so the wagon will follow the other logic and build right away, whatever it is.

Also, Inca joining the fight to… fish? You can’t tell from the picture but that’s the enemy dock.

If you can see it, there’s some fishing boats hiding under the TC:


Oh boi this is slick! Keep up the good work!

1 Like

I took a little break from AI coding and messed around with RM scripts. This is a reskin of Amazonia to convert it into the grand canyon (at least that’s the idea):

Are y’all interested in some new water maps?

I’ve been thinking a lot about why water maps aren’t played that much and I’ve been thinking about how the current options of water maps don’t encourage the kind of gameplay that the naval combat was designed around.

Ideally I’m looking to make a map or two with clearly defined choke points to force water vs base defense combat.

1 Like

Hi! Hope you are enjoying your break from coding lol. I-ve been kinda full lately but I tested the last iteration of the mod. The AI now is a challenge in water, especially in age 2. I really liked it, and it forces me to spend resources stopping their ships.

Sadly, it seems it still has problems sending its galleon or equivalent shipment. I haven’t seen the ai build or send them in any of my games. They do send the mercenary ships and, when they age up to fortress, they also send the frigate. I’m still seeing they send their unit shipments after their first navy shipment when they don’t need them. AI usually have the 2 ships, a galleon like ship and some water upgrade card, many times extra attack. Those should have a higher priority, as a galleon in age 2 would help them defend a lot. As of now, they send the 2 ships, 700 coin and then their 2 unit shipment, disregarding some more important.

Also, in many many games, I still haven’t seen the AI build defenses in age 2, not near the docks nor anywhere. I do llike how they build 2 in a dock, is extra defence, but it should also build them in other patches of land, and then reinforce with artillery or alike. As many times the AI doesn’t build defences until age 2, and they don’t send their upgrades or galleon, they tend to fall behind at late age 2. Many times they don’t even age to fortress, when they should.

Another thing i’ve noticed is that the ai keeps struggling with dock locations, even more than before. In a previous build, the ai were more consistent in changing dock location. Now, they many times keep sending their villagers to a place where all my ships are. maybe some tunning here and there.

One thing that surprised me was a game against Inca, when I saw the ai had landed a villager in the trade post island to build a TP there, first time in my life playing AOE3 I’ve seen the ai doing something similar. Also in that same game, I saw the AI build in age 2 a forward barrack/outpost at a far corner of its ow island, which would have work as an amazing defensive base, except i was already at age 4 and one monitor was enough to destroy it. That makes me think the functionality is there, but that there is something preventing it to work most of the time. As always, some recordings:
Record Game 2023-02-07 22-05-53.age3Yrec (9.2 MB)
Record Game 2023-02-01 13-08-41.age3Yrec (9.1 MB)
Record Game 2023-02-07 05-57-22.age3Yrec (10.1 MB)
Record Game 2023-02-07 21-15-01.age3Yrec (8.8 MB)

I’d love to try some too, I have an interest to resuscitate water maps in this game, and AI and new maps would work amazing. Hope you can update the mod soon too!


Oh it’s all coding, lol.

Good! I’ve had a game on Amazon go into a stalemate but it’s still a ways away from playing well enough to beat people. I’ve noticed the land attacks have gotten more rare since they usually only attacked in the beginning anyway. I’ve got

Is there a good condition we can make to send it? It’s basically always best to send 2 caravels first thing in age 2, but I don’t know if the strategy with the galleon shipment is as clear. Maybe if the AI is one of the attacking personalities and they’ve spotted enemy towers they could send it? Idk, something along those lines.

I’m not sure what’s going wrong. The AI is supposed to have a limit of 2-3 in age 2 but maybe the resource priority is preventing it from getting queued.

I think one of the big issues is the unit shipments they keep sending. I’ve throttled their military production but they still send unit shipments, so 3 shipments later they’ve sent 2k resources worth of land units they never use.

I’ll tweak the parameters again. I think I know what’s causing these issues but it’s kind of finicky and it depends on where the fish is located.

I wish I could take credit for it but this is the dev’s work. Maybe I need to look into this more to get Caylon and Archipelago to work.

Cool! I’ve got a couple maps I want to make so I’ll see if I can get them to work the way I want to.

Do you ever wish your AI would help build walls along your coastline to prevent pesky invasions?

It’s not without issues, though:

I may be overdoing these walls:

Maybe I’m crazy but I like these little harbor defenses and enabled a few wall types in the latest update:

1 Like

I think sending it after the 700 coin or after the 2 caravel shipment might work nice, as the objective is to gain the upper hand in battle. As I age up with the governor, I have a free outpost, so it might work nice for them to send it early.

I played a game against sweden in your latets update and they did built an outpost in age 2 in their docks, very early too! But another game with aztecs and they didn’t make their barracks/outpost.

Yeah, sending land units in age 2 is futile, they don’t use them and by the time I land, im already at 4 age while they are at 2 and my army is much stronger. Also, I’ve seen in recordings that the ai sometimes have the resources to age up from 2 to 3, but they never do. In this kind of island games, aging up fast allows you to use more powerful ships and get better defences in the form of TCs and upgrades.

I will keep testing this to see if i can help.

I’ve seen in your latest update you’ve introduced code for the AI to migrate in Ceylon. I don’t know if its enabled yet, but if you need help testing it, let me know and I can boot some games there.

I love what you are doing with maps. Those wall defences look good. It also makes it sol if I destroy a dock with units to protect them from outpost, they can’t just run to the enemy base. Hope to see how more does the AI can do, this is very interesting progress tbh!

1 Like

I decided to tie it to the number of enemy towers, so the more enemy towers the AI sees the more likely they are to send galleon shipments.

Sweden might have aged up with the governor. The war hut/blockhouse civs are weird. Sometimes it seems like they build using the barracks logic. I tried moving the Inca war hut over but it didn’t work for some reason. It would be nice if the AI built towers earlier but it looks like there might be some weird reasons why they aren’t, so I’ll keep it in mind going forward.

I effectively turned off military unit shipments until age 4, and penalized the ones in age 4. That should get things rolling better. The only exception is if the AI town center is threatened, then it’ll still send them.

Depending on the personality of the AI, they were probably programmed to wait a while before aging to Age 3. I took that off for island maps, figuring there’s no point in “rushing” on water, though I could look into reverting this later if we want some AI to try and land military units earlier. It just seems so futile since it’s so hard to follow that attack up with anything.

I do, but I turn it off because it’s nowhere near functional. I’ve rewritten it a couple times and it gets worse each time. Part of the problem may be that I’m trying to solve Archipelago and Ceylon at the same time, when Ceylon is much easier to solve.

Thanks! It’s almost more for the eyecandy than gameplay but it looks so cool to watch them fortify the dock positions. I’ve got some other ideas along these lines that I want to try to implement, we’ll see how it goes.


I’ve tested a couple more games (sorry for taking so long lol), and what i’ve noticed is that the biggest problem the ai has now is that they try to build the dock in the same place every time. It used to work better in this regard, the ai some versions ago did build the dock in different places and i had to look for them, but now i’ve seen it build in the same place, even with my ships stationed right there on the beaches spamming troops from the spanish shipment lol.

I’ve also started to see the deck building logic, so maybe I can test some things there and maybe help you with that part of the ai :smiley:

1 Like

here’s the deal, its a great script, but i’ve seen the ai not taking a chance to kill my landing on amazon when it had much more army, it did target ships properly, but not land units, kinda like reverse of what the default AI tends to do, pretty much an edge case

1 Like

That’s a good point. I think I can just expand the bubble that triggers a defense response to include the whole island (or more of it at least). I’ll definitely take a look.

Yeah this is a big one I need to fix if I want this AI to actually beat people on water. What happened is when I made the AI make ships, it was making both ships and a land army early on and falling behind because of it. Originally the AI would stall out and stop transporting land armies in the late game, so when I throttled the military production early on to keep it competitive on water I cut out the only time it would land units.

dw, everything else about this script is rock solid (could’ve been in aoe4 state but it clearly isn’t), take time with this, well aware its a pain to get it to work properly
otherwise, mad respect for this one, always wished for an AI like this

1 Like

Alright, I’ve tried to get the AI to respond in defense to any attacks that land on its island, as well as a few other things. It’ll only go after an army that it sees, so let me know if you experience any difference when trying to land troops.

The main thing I’m focusing on now is getting the AI to launch land invasions again.


Love it, will test it as soon as I get home

1 Like

will check when time lets me ty for the update

1 Like