Quote:And the biggest speed bump is that the AI is simply SLOW at crossing planes, even if we get this algorithm correct.
That's somewhat true and unfortunate (though with 9 towers and the AI being allowed to send multiple stacks into a tower it's actually not that bad... yes it's at most 1 stack per turn per tower still but it was much worse than this.)
However it's not relevant. If the AI is slow to move into the other plane, it's also slow to come back. So going to the wrong place is even less desirable.
Also, no, the units being built won't really satisfy the AI's needs for the home plane. Going through the tower is slow but, building up quality stacks is slower. Especially doomstacks.
It's a bit harder to judge this based on my recent games because the Myrran wizard will have tons of troops piled up so yes, they will have a lot left over on Myrror even if they do enter the tower. But that's not a case that matters, in that scenario there won't be another player on Myrror anyway.
I have doubts about a wizard starting on the same plane as a human, will have so much troops built up that the towers can't swallow most of them. And those freshly produced troops will not be properly organized, they'll be easy to destroy before they form larger stacks, or they'll attack without waiting for more units.
Then again, if the troops already left then starting to keep them when the war is already on is too late indeed. As is trying to send them at that time.
So we have a timing problem, we'd need to predict the diplomacy status in advance. That's not something the AI can do.
Either way, I find it the most important that the AI should base their plane shifting decision on similar goals as their diplomacy.
-So we generally wanted the AI to fight other AI and refuse peace if they are winning it, so stronger AIs get to eliminate weaker ones and become even stronger. (This would imply go towards the weakest enemy)
-But wanted them to not fight and make peace if neither side is really winning and the war is in a standstill (this means the AI should go away from strong opponents to minimize battle opportunities)
-We wanted the AI to always be prepared to strike back at the human because the human is allowed to attack them any time, and if they don't meet enough resistance, they won't have fun / win too easily.
...based on this, and what you say, maybe we want to keep the AI a simpleton and go with "always go towards the human player's plane", based on the number of their cities. It might be a bit excessive though, and during the early game, the AI not racing with the human to expand into the other plane (during peace) is a mistake... but do it and they are vulnerable to an attack from them, idk...
heck, the AI won't expand into the other plane through military, they do it by settlers. Military won't do a thing.
Problem is, let's say the human allies with an AI and both declare war on the other plane. The human will rightfully ask "why is the AI not going to the other plane to attack our enemy"...
And then we are back to weighting everyone based on their treaty status and being human or not. Except, we also want to look at different things and in a different direction. (AI shouldn't even care about other AI during a WP or alliance. They'll never fight each other. During neutral/war, they should prioritize the enemy with the most cities but fewest units in a plane and go to that plane. Against the human the AI should prioritize the plane where the human has more cities, but this shouldn't outweight AI wars if the AI is not at war with the human...)
This is getting crazy overcomplicated and we aren't even near the solution or using actual numbers. We'll need some more generic rules to separate the possible cases instead (there aren't all that many?) and figure out how the AI can recognize each. Weighted priorities won't work for it.
Something like
0. If the stack contains a settler, go to the other plane. (the settler will keep swapping planes until it manages to find a target on either side)
1. If the AI is at war with or hostile towards the human, go to the plane with most human cities.
2. Otherwise if the AI is at war with or hostile towards any other AI, go to the plane where that AI has the most cities.
3. Otherwise if it's before turn 200, go to the other plane (where the AI doesn't have a fortress)
...do we even need this? Unsure. The AI might conquer neutrals or hunt lairs there, and will generally need some troops to defend their cities if they sent settlers, but it might make them too weak against an attack on their home plane. Albeit if the attack does come, the units will be coming back as soon as they have no targets on the other side so maybe it's ok. At this time period we are talking about much fewer stacks than in the endgame.
4. If none of these apply then go to where the human has most cities anyway.
would that work? Am I missing any important case? Are we ok with not distinguishing between war and hostility? I'd be rather annoyed to see the AI dedicate all their forces on me when we are not at war but they are with someone else, so probably not.
then...
0. If the stack contains a settler, go to the other plane. (the settler will keep swapping planes until it manages to find a target on either side)
1. If the AI is at war with the human, go to the plane with most human cities.
2. Otherwise if the AI is at war with any other AI, go to the plane where that AI has the most cities.
3. If the AI is hostile towards the human, go to the plane with most human cities.
(4. Otherwise if the AI is hostile towards any other AI, go to the plane where that AI has the most cities.)
5. Otherwise if it's before turn 200, go to the other plane (where the AI doesn't have a fortress)
6. If none of these apply then go to where the human has most cities anyway.
Maybe we don't need step 4? If we don't go there, we won't trigger an unnecessary AI war. Yeah I think skip step 4.
Wait, one more thing. Jihad hostility. Those need to be before normal wars... but also need to be based on fortress location.
0. If the stack contains a settler, go to the other plane. (the settler will keep swapping planes until it manages to find a target on either side)
1. If the AI has Jihad hostility towards the human, go to the plane of the human's fortress.
2. If the AI has Jihad hostility towards another AI, go to the plane of that AI's fortress.
3. If the AI is at war with the human, go to the plane with most human cities.
4. Otherwise if the AI is at war with any other AI, go to the plane where that AI has the most cities.
5. If the AI is hostile towards the human, go to the plane with most human cities.
6. Otherwise if it's before turn 200, go to the other plane (where the AI doesn't have a fortress)
7. If none of these apply then go to where the human has most cities anyway.
...anything missing now?
1 can be abused by Move Fortress, but if the Jihad was triggered by SoM, it's necessary even at that price...
Did we do anything to make the AI go into the towers during Jihad or did we merely allow them to attack enemies there ignoring strategic strength? I think the latter?