Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
AI Excessive units strategy

As previously explained, the AI uses the "quantity" approach to overwhelm the players with lots of units. This works fine but... there is an exception.
Sometimes the AI just has too many units, in the sense that they cannot reasonably be used up in battles and instead end up just blocking paths for the AI.
In Hadriex's last game, the AI had 8x9 units surrounding almost all of its cities, blocking paths to the remaining unopened towers and blocking summons from appearing in cities. The game ended up this way because the human player had no cities on arcanus, all other wizards were dead, and the game dragged on until turn 400+. The few open towers were not enough to "swallow" all the units produced in the 20 AI cities.

So I'm thinking of teaching the AI a trick to deal with it, by adding the following city production rule :

If AI global owned units>X and units owned adjacent to the city>Y then do not produce units. If buildings are no longer available, build trade goods. If this is picked when the AI already has over Z gold, immediately convert the excess into mana through alchemy, during the city production decision (do not wait for the Alchemy procedure to handle it next turn.). Then the excess mana should allow the AI to put their MP slider to 0% and spend on skill and research. We might want to make cities that have special resources like adamantium exempt form the rule or use a larger number for Z.

How about it? (Also we need a good X, Y and Z number. I think something like 1000,30 and 18000 could work well.)
Reply

Why the global bit? If you remove it you can prevent crowded islands issues. And extend this to summoning - if a city is in those conditions don't move there the summoning circle.
Reply

One more thing to consider. If the AI does not keep producing units, and does not reach the global max unit cap, the procedure to disband weaker units won't trigger - in other words the quality of units won't naturally increase by the newer, better units replacing the old, weak ones.

So maybe we really should not have an X in the above - and probably should have Y depend on the actual number of land tiles. However, that means it'll be handled entirely locally, and the AI might trigger a gold conversion in a situation where it's not needing to as it doesn't have a massive amount of such cities set to trade goods. The global part was to ensure the AI only picks the global strategy of "make trade goods, convert to gold" if it is indeed global and not a single city.
Reply

One thing to note. In my lunatic games, the leading AI regularly has 20000+ mana by 1410 (current game is 24700 mana in 1408). So I'm not sure this would actually do anything in some circumstances.

I'd much rather see something where 'crappy' units get sent to their death. Like, if ai has > x units, send the oldest non garrison units to the nearest target, regardless of strategic strength.

Make an open tower a target. If all towers are open and no other targets exist, but allies control all towers, make one target (the one that is the least valid target based on normal targetting rules) a target regardless of alliance status. It's not a city, so attacking won't auto trigger wars, even winning won't auto trigger wars, and controlling a tower is a completely valid thing to do despite alliances, ESPECIALLY in those circumstances. (If possible add a diplomacy message telling allies that this will happen.)

In the situation you're talking about the ai has enough spell skills to defeat any neutrals anyway; and if the nearest target is human, again, 9 units plus spell skill is actually dangerous.

I'd make x like... 800. Wait base on land size, so.. 500+100*land size.
Reply

Probably a combination of both ideas:
*if cities have excessive units around, stop producing, and also sacrifice weaker units by attacking players or lairs with a higher risk algorithm as its likely these units will not survive.
*if all buildings done and gold excessive, converting to mana and increasing research/skill is useful as well.

Reply

Quote:but allies control all towers, make one target (the one that is the least valid target based on normal targetting rules) a target regardless of alliance status.

The AI would take back the move on execution because it CANNOT attack allies. We can't change that.
Attacking stronger lairs would likely do literally nothing better than disbanding those units, but the units might be blocked by other weak units and fail to do it. Disbanding or not producing more seems better.
The "roadblock" might be something different from a tower, for example an ally surrounding the entire continent, or the wizard somehow not having any ships or simply not being at war with anyone.

Attacking things using units is not something the city production procedure is capable of - that would require a new attack procedure or an alternate condition in the current continental attack targeting (which I don't know if it has space for this, I suspect not.)
Reply

Don't know how to fix it, but i will miss the time i conquered a tower that was surrounded by 8 mighty myrror stacks on the other side - all of which attacked the next turn.  well 5 of them attacked before my stack was finally gone.  Unrelated but the best AI attack was 2 fire storms the same turn, followed by not 1 but 2 tough stacks attacking a city.  all 4 attacks were required, it was impressive
Reply

So far I implemented this, but I think behavior on when not to produce units will need further improvements :

Quote:-When all land tiles surrounding the city including the city tile itself are mostly filled by own units, the AI will have a 90% chance of not producing a unit there. For cities with 1 or 2 land tiles (usually tiny islands) there is no restriction. For the third tile and each additional tile afterward, at least 2 “slots” must remain free of units. (this algorithm likely still needs improvement.)
-When the AI picks Trade Goods in a city, if it already has over 20000 gold, it will immediately convert the excess into mana
-When the AI has over 25000 mana, it will always set mana production to zero and replace it with skill or research based on previously used priorities to get rid of any mandatory mana production wasting resources. (This should prevent the AI from wasting resources. This is also maintenance safe - the AI disbands for lack of maintenance before they move their units, so even if they used up all their 25k mana crystals in combat, they won't ose units and next turn, will distribute power before maintenance and ensure they have the income to not lose the units (and likely will use alchemy as well). )

It probably should be a 100% chance of not producing a unit, as by the time the at least 3 tiles fill up (25 total units) to trigger it, the city likely has everything built, so it's not necessary to "upgrade" the garrison by producing better units - it likely already has the best ones. Even if not, summoning will replace the most obsolete units eventually.
The number of "slots" left open probably could be better done as well. 2 seems the absolute minimal to ensure units pulled to stackbuilding points can leave the city (albeit during jihad up to 4 can be pulled at a time) but that still means the city is completely blocked from up to 8 other directions.
Reply



Forum Jump: