Directing the AI with Events
The current AI does good job of managing combat, it has trouble with good purchasing and strategic direction. I think that some of this should be handled by the mod itself.
The starting point would be an isAI condition, to allow AI specific events, this could be used to simply provide bonuses to the AI but it could also be used direct some new triggers
paidPurchase: Gives a list of units to be purchased, as long as resources and factory space is available. For example, "infantry:5:armour:1" means buy 5 infantry then 1 armour.
percentPurchase: Direct a specific percent of the player's resources toward the purchase of a specified unit type. Drop fractions. For example "transport:25" with 30 pu's would mean to spend 7 on building transports
limitPurchase: Buy units of a specific type until resources or factory space runs out, up to a specified limit including units already on the board. Specify number of units to build. For example "Fighter:1:6" means build 1 fighter up to a maximum of 6.
transferUnits: Removes a unit list from a specified territory and places them in another territory. Allow options of all and allow negative numbers to retain. For example:
"infantry:3:armour:1" means transfer 3 infantry and 1 armour (if not all available, send what you have)
"infantry:-1" means transfer everything except 1 infantry
It would also be useful to have a resourceLevel condition which specified whether it is min or max, player,allied,enemy, resource name and quantity. For example "min:allied:PUs:60" would fire if the player and his allies had a combined PU total of at least 60. An additional condition for income would generalize economic victory
These triggers would have uses other helping AI players.
This all works within the existing game structure, so it would not be hard to implement.
I like the basic idea the details and options could always be discussed and expanded on. I wonder if this system could also be the means to finally get the AI to use "Actions and Operations"?
@Frostion I am not sure what you mean by operations but political actions could be governed by this system as well. The AI often engages dumb political actions because it has no guidance at all.
"Actions and Operations" is a step, normally just before the political actions step. I believe not many maps use it, but maps like Iron War and Warcraft use it to throw resources around between players and make special purchases. But sadly the AI don't ever press any of the buttons here and just skip the step automatically.
I imagine that the AI could be given som scripted "motivation" with the system you are talking about. Even if it was just a % likelihood for AI to press a button it would be great Better than skipping.
@Frostion @RogerCooper He probably means user actions?
Yes delegate="userActions" is the same thing. Ingame it is just presented like this:
Sorry for any confusion ... now back to topic
I submitted the feature request on GitHub. We will see if anyone takes it up.
On a related note, I think that with user actions, there should be a default AI percent, to give the AI some guidance on whether to do something.