Assertive Seawall AI

Es muy bueno tu trabajo, me da ganas de jugar con todas las civilizaciones y mil estrategias diferentes al tener una IA que no se basa solo en rush. Te levantaría un monumento y espero que algún día te contacten para ser parte de los desarrolladores de este maravilloso juego. :smile:

4 Likes

I appreciate it!

Also, just added a couple more fixes to The Great Turkish War, so the AI will stage its defense at the command post and build a couple military buildings around there. I would rather it built a full forward base there, but oh well.

5 Likes

First off, massive thanks for all the work you put into my favorite game of all time. Although KoTH is now definitely playable, I do wanna give some feedback from my experience with it.

I tried a bunch of KotH games this week and noticed that they only defend King’s Hill if they happen to stumble upon it. That’s when they begin to mass their army around it. If K.H. is out of the imaginary line between the bases, the AI will probably not find it and it seems that they will be just defend their base for the entire game. They don’t seem to be after my base at all, which makes sense because it’s not the objective.

Anyway, thanks again for your work. Rest assured that it’s appreciated, and this comment is only made with the purpose of seeking improvement on an already impressive mod.

1 Like

Thank you for the feedback! Most games I tested were on maps where the KoTH fort was in the middle and revealed, since my main motivation was getting it to work on the Age of Pirates Christmas Map. I’ll work on adding a couple tweaks to try and get the explorer to explore the fort on those other maps.


2024-01-27T08:00:00Z Found out my little KOTH fix wasn’t working. I just updated it so the AI can “guess” where the starting fort is. It should make them better at finding it, so let me know if you notice a change. I also tried to remove the retreat logic for team games within a certain amount of time from the victory. My retreat logic probably needs some tweaking in general.

I personally see a lot more action around the hill now, with my ally taking it with 11 seconds left only to lose again a minute later. This is on Sonora:

Im happy to report that I lost a 2v2 on Extreme by a trade monopoly. Fun game! I still havent tested land maps too much but I enjoy the way it retreats now: I’ve seen them use calvary as bait for my pikes, just to snipe them with skirms in the fog of war.

I also tried The Great Turkish War and The Eight Years War, I really liked them! In The Turkish War I saw the defender AI protects the Command Post more than anything, but I did see them move to protect certain sectors of the city. I’d have to test some more, but I would say maybe set them to protect the forward trade posts, and only if one falls to focus in the Command Post. Not sure how possible that is tho.

As for the Eight Years War, I had a blast. I would say maybe start the water aggression a bit earlier, as I had time to boom a bit at the start before their ships started to attack me, at late fortress / early industrial. That was the first time I felt pressured to buidl warships. I do have to say that once the attacks on the water start, they don’t stop, so thats good. In land, it keeps the pressure all the time, and each of the 3 enemy AI’s chose a distinct part of the wall, so I had to manage a lot of critical points early on. Once they made a breach tho, they seemed to concentrate on that point, which in a sense made the city “easier” to defend as I could focus on only one spot. and “harder” because I had to fight the combined strength of 3 armies at once. They did attack other parts of the wall with artillery and all, but not as strong. I also liked how well fortified their docks were.

As for the naval aspect, I’m afraid i’m seeing some setbacks in the AI behaviour. This is tested on Caribbean 2 v 2. In the current build, I’ve seen the AI won’t garrison their fishing ships in their docks when attacked, they will just move them to the docks and wait for them to be sunk. This nerfs the Ai’s ability to defend itself on water, as those docks pack a punch, especially with many of them garrisoned at once.

I’ve also seen that ai dock placement is still not quite right. Sometimes they only have one dock location and insist on building on the same spot even with enemy ships there, which ensure they will never have it back up. When you see the recording from the ai’s pov, you find out it tried to build a bunch of docks in one spot, which were blocked by my ships, which meant the ai keep sacrificing villagers in a task that would never be completed instead of destroying those foundations, getting the wood back and build them in another place.

Other times they choose 2 spots and neglect to build defences in one of them, and other times they will have 3 spots (the max I’ve seen), but won’t set up any defences until fortress age or beyond, and with fishing ships not garrisoning, its easy pickings. Other times, they will put the foundation of the dock, but never build them.
Many times the docks won’t have any outposts, barracks or castles nearby, sometimes they will. It seems to be a hit or miss. It’s good to see allies also setting up defences in their allies docks.

Another thing I noticed, more to the economic side, is that at least on Caribbean the AI still has a land centered economy, in the sense that they build too little fishing ships, no more than 9 or 10 sometimes, and over rely on canoes and caravel class ships to fish, when canoes have a third of the gathering rate than fishing ships. This ships in turn won’t defend their own docks when they ae under attack, even if they are close. Also, having access to fish and an infinite source of coin with whales, they shouldn’t be bothering with estates or farms until all of them are occupied or for some reason they can’t have access to them. Even the fish, their side of the ocean usually still contains most of them when the game ends. It seems the ai still considers traditional source of resources rather than water ones. I think the ai should build a water economy in these type of maps, and with the appropriate shipments they really can get some fast resources. enough to age up faster than now and have access to better ships and artillery to defend. The fishing ships can be defended with the warships and also building outposts and docks nearby for them to garrison.

I’ve noticed the AI tends to do better in these maps once it reaches fortress, although they never have an economic presence in the water even then, and I’ve noticed they start to build more defences on fortress, so im not sure if there is something preventing the ai to behave properly on that age. And the issue with some wagons not being used persist.

The migration mechanic is still not quite there yet, but as this is absolutely new on this game and not even the developers have implemented it or seem to want to, its understandable that it will need some tunning. As always, I’d be glad to test any changes you might think of to help the mod move forward.

I’ll post some screenshots to better illustrate some points:

3 Likes

Thank you for all the awesome feedback! I’m going to have to chip away at this over the next few days. I’m glad you had a blast on the historical maps! The fixes were pretty easy to implement, but hopefully they make a noticeable improvement.

I’m going to respond to these as I fix them:

2024-01-29T08:00:00Z

Looks like I messed this up when I made the caravels attack nearby warships while fishing. It’s fixed now, it’ll be uploaded on the next update.

I put a couple updates in to rework the dock placement. It’s similar, but uses a test point closer to the shore so it should help with the issues you mentioned.

I put it back in! Just the 1 ring for now. I need to figure out how to prevent walls from conflicting with each other before I put too many in.


2024-01-30T08:00:00Z

I’ve completely redone the logic that puts towers near docks. The AI will try and put roughly equal number of towers to docks on each location, preferring docks that are closer to the enemy (as a tiebreaker). If they don’t find any suitable docks to defend, they can now properly dot the coast with towers, favoring the direction roughly toward the enemy (~145 degrees). Towers are also less likely to clump up now:

Also fixed a taunt from the AI related to walls, so they will now correctly taunt you about your (or your ally’s) walls.

I don’t know if I mentioned it here, but most chats (especially the banter ones) seem to go through a filter to prevent you from getting spammed, so you won’t see every chat an AI player tries to send.

2024-01-30T08:00:00Z All changes listed above are now uploaded, but don’t worry, I’m still chipping away at all the other comments.


I went through and fixed the water booming. 11 mins in, and the team has a commanding lead on water so Frederick is doing a big boy boat boom. He’s at 27 of a max of 40 (now increased to 50):

image

A shot of India’s fishing boat production (I counted 35, including some off-screen):

It seems to be paying off, with Akbar having the high score. It also probably helped that he sent all the upgrades for his boats also:
image

I may have to play around with the numbers more, but this is certainly better than before. The number of boats relates to how many fish and whales there are within the radius, and the higher the priority the more likely the AI is to build fishing boats over other things. The choice depends on the civ’s disposition and how big of a lead they have on water. As such, some civs will never do the Big Boy, at least until I add more variation in the starting dispositions. There’s 4 strategies for boat booming:

  • Big Boy
    • Max boats: 50
    • Priority: High
    • Radius: Big
  • Double Dock
    • Max boats: 35
    • Priority: Medium/High
    • Radius: Medium
  • Single Dock
    • Max boats: 25
    • Priority: Medium
    • Radius: Medium/Small
  • No boat boom
    • Max boats: 10
    • Priority: Low
    • Radius: Small

Also, an example of one of the wall taunts:

image

2024-01-31T08:00:00Z Updated the mod again to include the boat boom.


2024-02-01T08:00:00Z Added fixes to king of the hill and the retreat conditions. The hill should get attacked more now, and throughout the whole game.

2 Likes

These last changes are so good! I haven’t really tried yet the new water booming, only very superficially, so this feedback is for the build before that, but the changes you introduced made a big difference!

The new logic for placing outposts and docks is working very good: the ai in that build picked 2 or 3 places for their docks even if one of them was not being attacked, and seemed to used them at the same time, meaning they could keep training fishing ships to improve their economy in a safe dock or warships to provide support for a dock under attack. A much better behaviour.

But even when being very aggressive, it is on this build very hard to take down the docks because of they way they are fortified. Now that fishing ships garrison again and have always at least one outpost nearby, using my shipment of 2 caravels to take their water economy is no longer possible. Making it so that they build outposts along the shore is a great addition, and as a result you can’t just send your ships to undefended areas to land because the enemy will fire at your ships and have a heads up on the landing.

I’m also happy to see that the Ai is now using its wagons very reliable, and whilke sometimes there are some they dont move, I’ve noticed that they are only waiting for the right time to use them. For example, sometimes they will have a trade post wagon sitting at base until they discover a free trade post socket and then they send it, even shipping them to other islands. And they seem to take as a priority to build the trade posts in the route. I’d love to see that change applied to other maps with the same configuration, like Honshu for example, with its island featuring a trade post position.

Just these additions helped the AI a long way, so much so that even without the new fishing logic, i consistently saw it advance to the fortress and industrial age, and not in bad times either. This in turn helped them too because they got artillery and bigger ships, and all together made for a more engaging naval experience. I think tinkering a bit with the decks so they get Extensive Fortifications for more outposts could help them too, but Im not sure how viable it is to improve deck logic.

Now for some other things I noticed too. These are not specific to that build but quirks I didn’t notice the first round around and wanted to point out too.

  • I think I’ve identified some of the problems with landings. I had this game where the enemy took control od the route very early on, and my yellow ally very relliably send a force to destroy a trade post, then instead of going on foot, it packed his army in the same ship and send them to the next trade post, effectively saving time lol. They did the same with the next 2 trade posts, always moving them on ships. I was very impressed, but sadly it ended there, as that army never made it out of the island. But I saw a ship getting nearby, probably wanting to pick them up, and then it seems that it received some other instruction and started doing that other thing instead of picking them up, and then forgot about them forever. This is also what happens with explorers and settlers after they build the trade post or sometimes other buildings on different islands.


    The army stranded on the island at the end of the game

    But it doesn’t happen only when picking them up, but in the landing too. Take a look at this ship, which picked a sizeable army and was ready to deploy them on enemy shores, but it got distracted fighting instead of making sure the army get to the shore. By the the naval confrontation ended, the ship had so low health that a cannon fire from an outpost sunk it and with it all the army. So it seems that the ai at this point knows how to pick units and land t hem, but as far as I can see, most times they start doing another thing before finishing their previous task.

    Another consequence of this is that many armies stay on shore and become easy pickings for enemy ships:

  • Pease see this video

In it you can see two other things with landings that need some tuning. First, see how the Ai is trying to move a sizeable number of units to my island, but it is using a fishing ship when it has bigger ships available. I think fishing ships should be the last resource for moving units, first being big ships and second Canoes only when the total number of units to move is under 20 or the limit the canoes have. Fishing ships I belive should only be used to move units when no other option is available, as their main task is to improve your economy.

Second, you can see how they end up landing a lot of units on my island, but they never attack, they move them on the shore and the they put them back on the ships and retunr them to base. I hadn’t moved a single villager and if it were to attack me there and then, I would have lost completely, but it didn’t even tried. It happen to other AI too.

  • in this other video, you can see another repetitive weird behaviour of the AI. Sometimes it seems that it tries to attack a trade post with ships even when they are out of reach. I’ve seen it happen frequently. I know its the TPs because once I destroy them, they ships move to another place and stop trying to get to that spot.
  • Sometimes I’ve seen Ethiopians placing their Mountain Monasteries with no mines bellow them. At first I thought the mines were depleted on its island and maybe it didn’t knew how to ship them, but they had 2 mines nearby, so I don’t know.


  • To close for now, I also have to report that, while the ai sometimes tries to land and sometimes launches naval attacks against enemy docks, there is a lot of time in between, and its not odd to see the ai horde ships in one place and never move them, or move them at the 30 or 40 min mark.

For now that’s it, I want to test more the new fishing logic and will be back with more feedback. As always, every update seems to really improve things more and more.

2 Likes

The land AI seems to be a tad more aggressive in the late game.

1 Like

2024-03-12T07:00:00Z
There should be a few improvements:

  • AI staying closer to the Hill on KOTH
  • Builders less likely to get stuck in buildings on Archipelago
  • Late game ships should be less likely to clump up and idle
1 Like

What if I just deleted these guys? Would that be a bad solution?

Hello,

I played 3 games after updating the mod today, and i felt to much easy now to win againts Hard AI, like i get double his score after 20 minutes of playing. I don’t know if it has been done on purpose…
He’s still rushing me earlier in the game, but then it’s like he stops for a while to develop his army and economy.

By the way, keep going with your mod!

1 Like

Thanks for the feedback! It’s definitely not intentional, though it could always be some combination of factors. Sometimes the AI is “rushing” but then it isn’t good at it, so it winds up just kind of flopping. Can I ask what map it was, and which civs you were playing against? The most recent change was intended to make attacks stronger, although potentially less frequent.

Yes of course. I was playing Italians for 3 games againt Ottomans in Mediterranean, Mexico in Sahel and Japanese in Guianas. And yeah queekly in the games i get over their score, it’s unusual for me… and it’s over after 25minutes, shorter than usual as well. I put here below some screenshort from the game against Japan.

Here, the numbers of villagers :

Here the total of gathering ressources :

And then the military score :

But, if i’m alone to feel what i’m trying to explain here, it would means that i improved my skills, but i have some doubts…

Did you notice a forward base made early, like Age 2? If yes then I think I know at least one issue going on. The extra walls and towers in that fb was really hurting them, so I kept that fb more bare-bones.

Sería posible hacer que los Lakotas construyeran más tipis? Prácticamente la IA no los usa para potenciar su economía ni el ejército.

1 Like

It’s definitely possible! Do you have a good build order or rule of thumb I can follow? Would you just scatter a few in your base, or would you look for specific spots to put them like next to mines, etc.?

1 Like

Emm potencian la recolección de los recursos naturales y de las granjas, mejora el ataque de las unidades que defienden los barracones y establos. Con el envío de la metrópolis “territorio amigo” mejora la velocidad de ataque y da más rango a las unidades a distancia. Con “expansión nómada” de tercera edad aumenta la velocidad de creación de unidades. Con la mejora del botón grande “Carrera del circulo rojo” aumenta su área de efectos y de visión, siendo muy útil para el control del mapa. Vamos, yo los pondría hasta en la sopa abarcando tantos beneficios.

1 Like

Yes they did in age 2, like before the update (or maybe earlier i don’t really know). And talking about walls and towers, i started to change my strategy since i updated the mod, like i will build 4-6 towers as soon as possible next to my town center, i dont know if it can be due to that also. But in the screenshort you see, and it was also the same case against Ottoman and Mexico, i dont rush them, i just defend my town as usual at the begening of the game, and then i attack them and when it happens it seems to me to be quite easier to get inside their town and win the game. But i dont want to suggest any modification if i’m alone to say that.

1 Like

@IvanZvania Thanks! I think what I’ll do is just fill up the starting base and forward base with a few, and make sure those cards are in their deck. That should cover most use-cases of the teepees unless there’s another use I’m not considering.

@DesertPage65411 I’ve also noticed the AI randomly seeming weak, and I think I narrowed it down to excessively built up Age 2 forward bases. They were trying to build a tower, plus walls, plus another 2 towers… I changed it last night so they only make 1 tower. That should improve their performance, but please let me know if it doesn’t so I can look for other issues.

@IvanZvania I’m not sure when the next update will be, but teepees will be included!


@IvanZvania Updated 2024-03-17T07:00:00Z to include Lakota teepee building. Lakota will now build 1-2 teepees at the start, and scatter some across their base, typically near wherever their villagers are. They’ll also put a couple in their forward base when they make one.


Another note: I’ll be focusing on smaller, more incremental changes over the next few weeks so if you have any ideas, let me know!

3 Likes

I played again two games against Japan and Ottomans, the same happens : I defend my town for around 15minutes and then i attack, can get easy inside his town and win the game. In both of the game (25 minutes each one), the AI get stuck in age2. I feel now it’s easier than before, indeed because he’s building less towers at the age 2. But yeah, now i’m sure, something change and it’s too easy for me to win compare before the update.

1 Like