June 3rd, 2017, 09:33
(This post was last modified: June 3rd, 2017, 09:36 by Seravy.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
That's completely not the order things happen though.
90% of the stuff done is continent based. This procedure is not so it can either be at the top or the bottom after the core continent loop. Top would make it override attacks which is bad, so it can only be at the bottom.
Which means it can only happen after building standard offensive stacks.
Existing main procedure looks something like this (tho this was in the AI topic) :
-Reset all orders except on settlers (global)
-Disband if low on maintenance.
-Shift Plane (global)
-Ships leave cities (global)
-For each plane and each continent do
-Build list of available stacks (continent)
-Nonmilitary units leave cities (continent)
-Spirits move to node or meld (continent)
-Settlers move or build (continent)
-Move to purify (continent)
-Move to build road (continent)
-Make list of possible targets (continent)
-Attack targets (continent)
-Intercontinental stacks attack targets (continent, but to intercontinental targets in range of 12, not using the local target list)
OR go to the main action continent (also only procedure that recognizes wind walking)
-Board ships
-Make list of available units, observing garrison requirements (continent)
-Send units to focus point from the top of the list as needed (continent)
-Move to garrison (continent)
End of continent loop
-Non-Naval stacks on sea, attack intercontinental targets or go to the main action continent. (this is actually the same intercontinental procedure as above, except for the "sea" continent as the input stack data - originally it was way different though.)
-Naval stacks on sea, transport, disembark, or attack targets
-Build "doom" stack
In each step, stacks marked "garrisoning" are skipped, only stacks marked "small stack" or "large stack" can be sent to do something. Procedures that work with individual units usually do not have this restriction (such as sending to meld, purify, etc) but some might, I don't remember.
Posts: 5,010
Threads: 17
Joined: Aug 2016
Right, but that doesnt mean you can't do my list. All it takes, is during step 1, you add conditional limits: ignore fortress units (as you have), then, ignore most expensive unit in each city, and ignore the 3 cheapest units in each city. If there are four or less units in a city, none of them are valid for doomstack.
June 3rd, 2017, 10:38
(This post was last modified: June 3rd, 2017, 10:53 by Seravy.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
Yes, that can be done, though the "make normal stacks after doomstack" part cannot.
If we go in that direction I rather use my original idea though - instead of amounts, make it "normal units in garrisons are invalid". It's not the same as leaving 1 fantastic and 4 normal units but 9 normal units might even be better and it's much easier to implement.
The main remaining question is, do we absolutely want the AI to have that summoned creature stay in the garrison or not - which is better for the AI, having 9 cities each with an extra Efreet or Sky Drake, or, to have one additional stack of 9 of those attacking things. (note if the summoned creature is not flying, it can still stay inside.)
A few other possibilities are :
-Certain personalities leave all units in garrison, while others do not.
-During war the AI leaves all units in garrison, during peace the do not.
-Or the opposite, during war they don't leave them in garrison but during peace they do.
-Or even, consider the strength of the enemy (astrologer) for the decision.
(in all cases "do not" can mean they leave the normal units only but use the fantastic. Or alternatively, base it on cost, 199 and below stays in garrison, above leaves for doomstack.)
Edit : checked, there are 34 bytes of free space remaining unless we move the whole thing to another location. I don't see another large enough free area to put it elsewhere either. So we have to keep it simple. Probably only limit it based on personality and the unit's cost of normal/fantastic type. (for reference the existing procedure is ~1000 bytes long.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
Time to do this.
First of all, units outside of node/city garrisons should be allowed to be use by any wizard. There is no drawback to using otherwise idle units for making good stacks.
On the other hand, it's better if normal units are never pulled from garrisons by any wizard. Once there are enough units, the excess will be pushed outside and will be used anyway. This slows down the wizard's offense by about as many turns as it takes to fill their cities with 9 of their preferred garrison units - assuming javelineers/halberdiers, that's probably around 15-20 turns. I believe that's a fairly good deal in exchange for having hard to defeat forces in their cities, and being able to hold conquered territory instead of losing it quickly.
This leaves heroes and fantastic units.
For heroes, I think it's best if they can always be used. A hero is either something the enemy cannot kill, in which case it should be on the move, or something they can, in which case leaving it in the garrison isn't useful. A moving hero can gain exp, and if stacked together with powerful rare creatures, the human player might prioritize the creatures, increasing the chance of the hero's survival (especially if there are multiple heroes in the stack).
Which leaves room to have various decisions for fantastic units only.
Aside from the low-end common creatures, fantastic units are generally always more powerful than the normal units the wizard has at the same time, so a cost based limitation is not helpful. (The relative power of using gargoyles when the wizard has swordsmen is the same as using great drakes when it has paladins, kinda.)
So it leaves deciding this based on war status or personality.
War status is problematic. The human player can start a war any time - but the effects of stackbuilding aren't immediate. So basing it on that is probably also not good.
So only personality is left. Now, we could just drop this as well and say the AI always uses fantastic units for offense, but that would be boring, and it's not necessarily always the best strategy.
Maniacal : These beat the human player through curses. If they can stall human invasion, even for a few turns, that is worth more for them than conquering a human city (which is probably already wrecked anyway). I think they should keep the units in the city.
Ruthless : They might send them out anyway through Jihad hostility, so might as well send them immediately instead of later.
Aggressive : The name implies the wizard prefers to attack. Send them out.
Chaotic : Well designed garrisons do not fit a chaotic wizard, and ready doomstacks make much more impact when the wizard randomly breaks an alliance and attacks next turn. Send them out.
Lawful : The human player is likely to maintain lasting peace with this wizard - garrisons are not important and the units can help the wizard expand faster and get ahead of the human player - so send them out.
Peaceful : Same as above, as it's even more true. They also don't use much curses, so they have to be able to appear as a threat through military force.
Meaning only Maniacal has a reason to hold back fantastic units in their cities to defend - which might make the game more balanced, as these wizards are very likely to pick a fight and would be hard to defend against if they used both curses and doomstacks effectively.
Note that even if they don't send the fantastic units out, once the required garrision is filled, the units will be able to leave the city for land stack building, which then allows them to reroute and be used for the doomstack instead. (this can slow down the land stack building by a few turns for that one unit - until it leaves the continent or joins the doomstack, it will be repeatedly chosen to head for the land stack focus point then rerouted to the doomstack. I think this is acceptable as it only affects one unit and only for a very few turns - the other 8 land units will be gathered normally.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
Oh, also, what about the Shadow Demons? Should the AI leave them on the primary plane or keep sending them to the other one?
Posts: 5,010
Threads: 17
Joined: Aug 2016
I like that. The only thing I might do is have chaotic sometimes keep them as garrisons; and sometimes even send city troops out. They are chaotic. Change what their priorities are every.. 10-20 turns, so that they aren't just bouncing around. (I would really like to see chaotic doing more things, on different patterns, just to be different.)
Posts: 5,010
Threads: 17
Joined: Aug 2016
IF you had space, I would suggest actually making interplanar doomstacks - shadow demons, and anything with planar travel; send 1 or 2 across, then build a doomstack (6-9 units) and send it across all at once. send 1 or 2 more across. I rather doubt you have nearly that much space though. But realistically, you want to send a stack across, not just piecemeal them. So, if you can't do anything that complicated (I suspect you can't), I would keep them on the same plane, and wait for a stack to form naturally on the other plane. But I'm REALLY unsure whether this is the better way to go, so I'm not worried at all if you choose the other route.
June 4th, 2017, 13:26
(This post was last modified: June 4th, 2017, 13:30 by Seravy.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
If kept on the same plane, there won't be units on the other plane to form a stack naturally - death has no other access to plane shifting unless it also has Life books.
Question is, is the early access to the other plane worth the risk.
And yes, I don't have space for anything that detailed.The AI doesn't even have a "do I need to go to the other plane" check implemented. It always assumes it wants to go to the plane which does not have their fortress and that's it.
...I think I'm going to decide this based on what we want the human player to face.
So we have
Option 1 - Shadow Demons change planes.
-The human player will not see shadow demons stacks of the wizard they are actively fighting.
-The human player might encounter shadow demon stacks belonging to a wizard on the other plane - one the player is still unable to reach or fight against, while they curse the player's cities and might even destroy all their cities if the shadow demons stack is large enough to be unstoppable.
-The distribution of AI wizards between planes will be different from intended - if an Arcanus wizard uses it, they might claim half of Myrror and weaken the Myrran wizard by their presence (and possible even fight it!), but might get eliminated easily due to having less presence on the more contested plane if failing to do that. If a Myrran wizard uses it, they have to compete for Arcanus territory when Myrran territory is still uncontested and more valuable.
or Option 2
-Wizards the human player is actively fighting can have powerful regenerating shadow demon stacks, or shadow demons in their garrison.
-The Myrran doesn't have to compete with Arcanus wizards for territory (unless they play Life), so it has a better chance to be really strong.
I think option 2 is much better.
Posts: 5,010
Threads: 17
Joined: Aug 2016
I'm inclined to agree, and since that's also how I play as a human, I think it's good. You don't send over anything that can't by itself conquer strong cities/medium nodes. Sending a few shadow demons can't do that. If you COULD send over a stack of 6+ shadow demons, that would probably be fine since it could form a doomstack on that plane instantly, but that's about the only time I would do so.
June 11th, 2017, 08:46
(This post was last modified: June 11th, 2017, 08:47 by zitro1987.)
Posts: 1,333
Threads: 23
Joined: Feb 2012
Interesting, 1-2 turns after a fairly-weak wizard declared war in 1417 due to my hostilities (final wave, evil omens), it attacked a poorly defended town with a doomstack of 4 good heroes and 4 mid-tier units.
|