Need Help Deciphering AI Water Behavior

Update:

Now that I have a working version, I’ve uploaded it into the mods page. If you have any feedback on how the AI should be behaving I would appreciate it!



I’m digging through the water AI and trying to find ways to convince the AI to make more ships, but I’m not super familiar with how the AI behaves in these games. Can anyone help me with any of their known “quirks” or things that could be better? It’ll help me translate what I’m seeing in the code with what happens in game.

Some things I’ve potentially noticed:

  • AI doesn’t build more than 1 dock until age 4 (on hard and expert)
  • AI doesn’t build warships until age 3
  • AI waits until you have a dock or warship close by before training any
  • AI only attacks docks with >3 ships (excluding when a scout boat goes by)
  • AI only matches warship count +1 caravel

Edit:

  • Whether or not the AI even builds any docks is a roll of the dice, even on island maps
  • All docks are local to starting town

Make backups and give it a whirl at your own risk.

aiEconomy.txt (138.0 KB)
aiMilitary.txt (234.9 KB)
aiBuildings.txt (150.8 KB)

Location:
…\AoE3DE\Game\AI\core
You also have to change the extension from .txt back to .xs

  • attacks with >2 warships in age 2 (still >3 in Age3+)
  • attacks enemy warship if there’s no dock
  • we check if there are any nearby warships and if we have less than 2 or 3, depending on age (to build more)
  • Prioritize ships in the following order - Age3: Caravel, Frigate, Monitor, Galleon. Age4: Frigate, Caravel, Monitor, Galleon.
  • Hard and above on water spawn maps makes 2 docks Age 1 and 2, 4 Age 3 and above. Below Hard makes 1 and 2, respectfully
  • 3 More Frigate or 1-3 Caravel or equivalent amount of war ships than enemy depending on difficulty
  • If it’s a good time to fish, try to build a forward dock
  • Don’t fish until age2 transition. Unless it’s an island map. Then it’s always a good time
  • Docks are high priority on island maps

I’ve made some testts in the Caribbean map, some feedback:

  • AI seems to take a bit to get to age 2, generally after 5 min of the game. As they can only start attacking at age 2, having the advantage to send or build a warship before can harm the ai strategy at the long run.
  • I also think it should be more aggressive in age 2, especially on island maps. Controlling the waterways is very important on these kind on maps, so the AI should try to control it from the beginning, even before committing to a big army. I also think it should attack the player’s navy before the docks, although i understand that can be cheesed against the ai.
  • I like how the AI now starts to send big armies to attack me, but they always land them on the TP island, and by the time they do it, I already have a foothold and all the TPs already claimed. One downside though is that it doesn’t seem to be able to retrieve an army it has already sent to another island, and the units sometimes will be waiting by the beach forever for a transport that won’t arrive.
    -I think it also should try to build more than 2-4 docks if it can spare the wood, and try to space them out to control fishing grounds.

I’ll test some more games and tell you what else i can think of. Thanks for the mod!

Thanks for the feedback!
I allowed the ai to build docks before aging up, I’ll revert that change.

I’ll look into the aggression. I’m curious if I can turn its 1 boat exploration parties into 2-3 boats, effectively making them patrols.

I think something weird is happening where they spot you on the TP. I’ll look into whats going on there.

What’s the ideal dock count per age? I can open it up to any number or even add more as it spots enemy ships. Maybe I’ll do something where it builds 2/3 as many docks as you have warships.

I’ve figured out how to make varied dock positions but I’m still fighting with it to do that only on condition.
I’m also looking at getting the AI to build towers along the coast and next to docks.

I’ll keep an eye out for your next update.

I allowed the ai to build docks before aging up, I’ll revert that change.

Yup, I think this is also the problem.

I’ll look into the aggression. I’m curious if I can turn its 1 boat exploration parties into 2-3 boats, effectively making them patrols.

That would be awesome, more naval power in age 2 could work wonders, but I think this has to be specified for island maps, as with hybrid yoy don’t need to secure the water to move troops.

What’s the ideal dock count per age? I can open it up to any number or even add more as it spots enemy ships. Maybe I’ll do something where it builds 2/3 as many docks as you have warships.

Maybe 1/2 could work? The idea is the ai can heal ships and keep a decent production in case their navy is missing.

I’m also looking at getting the AI to build towers along the coast and next to docks.

If you can get this, it would improve Ai in water a lot, as right now they don’t deter landings.

1 Like

Thanks for the feedback! I’ve reverted the age1 dock issue and gotten the AI to vary its dock placement a little bit when it can see your ships. It seems to work a lot better when the AI starts toward the center of the map, otherwise it just spreads the docks up against the back of the map.

I also uploaded the mod so it can be downloaded from the mod page in-game.

1 Like