Shannon V. OKeets
From: Honolulu, Hawaii
ORIGINAL: Shannon V. OKeets
Up until now, MWIF has been using the supply routines from CWIF. Those routines are buggy, in that they are not current with modifications to the rules over the past 4-5 years. I also disapproved of their efficiency, since that will become vastly more important with the AIO exploring different moves for its units (and enemy units) and making judgments about how those moves affect supply. The AIO is likely to need to run the supply routines hundreds of times, not just a dozen or so as is true currently.
I have gotten some of the new routines to work: for determining all primary supply sources and making land connections from secondary supply sources to primary. Here are a couple of screen shots of one game example I am using for debugging purposes.
I think I have a pretty good idea about how you create the supply logic, and I like your solution. But this thing about "exploring different moves for its units (and enemy units)" I am not sure I understand what exactly you are trying to do.
I think that this is not really about moving for supply purposes but moving units in general. I have to admit I haven't read any details on how you plan to let the AIO move, but just tell me if I am off:
I think it's probably easy enough to prioritize which units to move if the side moving are attacking. Because in an attack the defense factors is known, and the AIO can run some sort of optimization routine to maximize its chance for success across all its attacks.
On the other end, I think that if nobody is attacking the situation is likely much harder to solve. Say Germany is fighting in the USSR, it's winter and snow, but the the USSR player is too weak or simply does not have enough white print yet to attack, so no side will attack in the snow. At the same time neither side has enough units to make a continues front all the way really, so both sides has some choices to make. And on what basis should the AIO prioritize to move which units where?
_ Some obvious choices is that the side with most units can try to creep through enemy lines. But for both sides the thing here is to try to take land or cut the supply of the opponent, while at the same time making sure that own freedom of movement is maximized, while opponent freedom of movement is minimized, and supply should hold,and there may be aircraft involved which should or shouldn't be overrun depending on whether the aircraft are mine or yours....
And on the bottom of this there is some computer AI that starts: say I move my units so there is an opening in the lines for the opponent 6-move ARM. The 6'move ARM may then move zero, 1, 2, 3, 4, 5 or 6 hexes into my territory next impulse, and he may go straight ahead or turn left or right at some point along that path. Would the AIO then evaluate the consequences for it's own and it's opponents both supply and later choices of movement for all these cases? Say that the AI has 10 units which could react to the 6 move ARM moves through. Then it could move none, any 1, any group of 2, 3, 4, 5, 6, 7, 8, 9 or all 10 units, each of which could be moved 1, 2, 3, 4, 5 or 6 hexes in any direction, which makes for an awful lot of possibilities for each unit - well actually just 7 choices for a 1-move GAR, but 127 choices for a 6 move ARM or MECH, but all the combinations here seems staggering, and by now we have still just evaluated the consequences of letting a single enemy unit move through the lines. Now let's evaluate the second one, or what about letting two enemy units move through my lines at the same time?
I have no idea if this is anything like what you plan to do or not. I am quite sure that todays computer can get through an awful lot of permutations by brute force. But for a front with maybe 300 units on each side where all units can move to an averagely 50 other hexes, all the ways the moves can be combined if you are going to think more than one step ahead and with multiple aspects to think of, both attack, control, supply, ZOC, victory cities, production, overrun moves and maybe more I forgot. This doesn't seem pretty.
I was just thinking that for an issue like supply calculating what the opponent actually may do may not be the best solution. Because considering all the permutation on how to move, and considering PARA-drops, invasions, partisans, reinforcements in cities you moved past but didn't take yet, and double impulses means there are that many choices that a more theoretical approach may be quite a bit more cost efficient. In general the best would be to give the AI some sort of idea of shape if it's area, and what shapes are good shapes and what are bad shapes. That might be hard too. For supply isn't the basic idea that you need to know whether or not the current supply chain is the single one possible or if there are two, or three or more? But I think it's possible to figure that out without considering where to the enemy may actually move.
Enough for now...
Exploring all the combinations and permutations (order in which things occur) of moves is not my intention. However, I do intend to have the AIO examine the possibilities of cutting off enemy units from supply. For that purpose, the new supply routines record the supply paths for each unit. Furthermore, they record how many units are using each link in the supply chain.
The record keeping is done for both friendly and enemy units and is used for evaluating the 'value' of a hex in some instances. This is no different than what human players do when they notice a critical hex in the supply paths for many units.
Given a hex to attack/defend, then the question becomes which units are truly cut off from supply when a link is broken. Most of the time, an alternative supply path can be found. That is the point where I expect most of the supply recalculations will be done by the AIO. It's a significant number but doesn't have anything remotely close to having a factorial involved.
On the other hand, during the normal game play (regardless of mode of play: Internet, AIO, Solitaire, etc,) there is the question of redetermining supply dynamically as a player completes the move for each unit. The effects on supply of moving air and naval units is relatively rare and easily detected, given a knowledge of all the current supply paths in use and the units that are out-of-supply. Land movement is another ball of wax though. There the movement of an individual unit can have massive effects on both friendly and enemy units. Additionally, it isn't all that easy to determine when a move might put out-of-supply and isolated units back in supply.
Actually, the issue of how to deal with updating supply for units during land movement has been an open issue for me for over 4 years, a while I have made some progress in improving my understanding of the problem and possible solutions, I am not overwhelmingly confident that my current (envisioned) solution is best.
Perfection is an elusive goal.