Having issues with the DE AI on custom maps

I recently created a Helms Deep Siege Defence map, where the players have to hold out against increasingly powerful forces, controlled by the AI. to give the players the feeling of a truely endless horde, I set both of the AI’s up with near unlimited resources, a starting force, a well defended base, production facilities, villagers etc. Now a lot of the times this works perfectly well, the AI attacks in large but manageable waves, slowly overwhelming the defenders as their resources dwindle trying to hold off the goth tide. Unfortunately I have grown increasingly frustrated with the AI’s overall unreliable behavior, in about 1 of 4 games it either does not attack with its units, does not even build any more units or waits until 50 min + to attack in which case only one of the two AIs is actually attacking, while the other stays inactive. I have tried to apply a quick fix by giving the AI orders like attack player 4, produce more infantry and so on but that didn’t seem to have any noticeable effect either. Now I would be grateful for any help on how to control or manipulate the standard AI into staying consistent when it comes to how they act, instead of having to pray every time I load into the map, not knowing if the AI will play along or not. There also appears to be a connection between this strange behavior and multiplayer as the AI does what it is supposed to when I play alone.

I also have problems with the AI in multiplayer
My way to solve it is to use the “No Unit movement AI” and just set a bunch of triggers
The best way is to do it like this:
Create a looping trigger:
Conditions:
-timer (set the times as u like)
-accumulate attribute (ammount of food)
-accumulate attribute (ammount of gold)
Effects:
-Create garrinsoned object (militia inside barracks for example)
-Unload (unload barracks to a gather point)
-Tribute (sends the resources the units costed to make to GAIA)

Create another trigger for the gather point:
Conditions:
-Units in Area ( lets say you want an army of 15 men, then set it to Military and 15)
-timer
Effects:
-Attack move (send the army of 15 to attack as a group)

You can make it with resources or without, depends on how you want… There is an AI mod that makes it collect resources and make villagers but doesnt move or train military units: https://www.ageofempires.com/mods/details/820/

Or you just make it automatic without resources
good luck!