ORIGINAL: jwilkerson
... I want something that plays like I do .. that thinks like I do ... that can react to circumstances ... that looks at data across time (trends) and not just "what are we doing this turn". Each level of the AI essentially solves the same problem ... how to I accomplish my mission with the forces I have available, given what I know about the enemy and given what I know about terrain, weather, supply, etc.
... I've learned that experienced game players have a lot going on "under their hoods" ... I think we do this mostly without realizing we do it! As I've tried to break down what I do and why I do it - I've realized how much I am doing that I do not even know I am doing!
...I'd say at least four people - game players who are willing to analyze and write down how they play- and do this a lot for the first year - from all this we synthesize the AI "algorithms" ...
I can only totally agree with what you are saying. There are many aspects to writing a good AI for solving a given problem, and all starts with understanding the rule set, i.e. how as a human player your logic approach is structured. Sort of like a complex, branched tree taking into account the parameters from pilot fatigues to weather or available of reinforcements within an interval that you believe you ought to have back-up available within. The better you can describe your thinking (the more systematic it is, aka the better it fits into a logic diagram), the better you can teach the AI to do the same. Which means that input from the more experienced players is essential. The knowledge that the really best players here are very systematic in their procedures and planning (even when improvising), and essentially have their routines set in mind, is clear evidence that you can also create an AI that could essentially do the same -- if you can put your routines down to paper and reflect even on all the parameters that you perhaps only subconsciously take into account.
Now once you'd start to explore your own logic from the very first turn where you define your global strategy, goals, industry etc. to any given turn in the long run and tried to write "a very detailed rookie guide", you'd probably lose yourself in details soon. It is doable, but it will require to make some approximations -- for example ignore those things that even amongst human players is considered more chrome than of important effect.
Start out with the key things it needs to do, keep it object-oriented and well-structured code so it can be expanded on systematically. Which is were the 2nd art comes in -- writing something that is systematically expandable and allows add more and more cases previously ignored, or refined existing ones by adding more subcases. That's where I most often struggle since I never really studied informatics. And I also often trip over my own codes because when sometimes one realizes that AI does poorly one learns that there were more parameters that one subconsciously checked, and need to be implemented as well. The code will grow, and as many things in AIs interact with or depend on others (say the loading/unloading of LCU, HQs, supply on the availability of transports, and in turn on the availability of enough escort ships, air cover, the target's properties, the preceding bombardment TF..., so if the BB gets into some issues, this may for example need to get feedback all the way back to the set-up of the amphib TF), it sometimes grows into a chaotic underbrush that one needs to clear out later if one again wants to systematically improve that. I think very good coders are a key to getting all those "thinking routines" but into a systematic code.
Lastly, you also want the code to run quick, which is perhaps less of an issue with a turn based game. Yet I wouldn't want to go back to old commodore times with the Chuck Krogel games, say Battle of Chickamauaga, where the computer spent sometimes plotting for almost 2 hours. So plenty of your routines, like sorting units by ranges, capacities, wherever you have large vectors or arrays, or where multiple loops are concerned need to be optimized using efficient codes/routines/functions or using some more approximations and "cheating/tricks".
ORIGINAL: jwilkerson
that can react to circumstances ... that looks at data across time (trends) and not just "what are we doing this turn".
Ultimately you'd perhaps end with an engine consistent of two (interacting) parts, just as one (or at least I) approach the game: A "parent" routine that determines all the strategic level issues, checks whether the previously chosen targets remain viable/were achieved/were failed so new offensive of defensive goals can be chosen, looks in which local theaters/bases supply is short or resources need to be gathered etc. And a more local "child" routine that checks TFs, bases, adjusts air transfers, CAP, sweeps, supply runs etc. for each local theater.
Now the most difficult part might be what you mention with trends, for e.g. following the enemy dispositions over time. And over what time interval for deriving what information? I think that would be a hard task. They'd be very different for the strategic AI, and the local AIs.Yet even if the local AI's would only take the present setup and the last turn into account (plus some "see thru fow" checks to prevent worst screw-ups), and not include any long-term trend, it may already react much better to a situation than any static scripting that has its assets given prior to game start.
One could define a "AI knowsabout" level based on detection that decayed (exponentially) slowly, say forgetting any unit only after it hasn't been spotted again for say 4 weeks.I would probably allow it some tiny cheating capabilities, maybe be a benefit in the detection levels, to the quality of recon assets, or add a small chance (or not so small, to be tuned...) let it see any unit randomly from time to time. The you need AI to calculate a threat level based on the "known" assets, for each mission type, and have that evaluated for example to predict where the player has weak LCU/air/naval defenses, or where AI spots the player build up units that combine amphib offensive with naval bombardment, CV and/or LBA sweep, cap or bombing and supply/engineering capabilities above a threshold. AI may have to weight that by distance, as obviously a huge ampbib/BB/CV fleet sitting at San Diego won't be much of short-term threat to say Adamans. And the naval parts of it none at all to inland bases in Burma. Maybe you have to use hindsight and experience here to smartly define theaters, which AI could use to evaluate its local situations -- like we for instance know that any invasion in the DEI will likely come via OZ. The theater determination might be really tricky, but maybe one can come up with something based on geography and years of AARs here.
I think a good AI is doable, but it may take a long time even if one finds a team that was willing to remove the present AI engine from AE and implement one that would purely run on external scripts to resolve moves, allocations and orders. For implementing the core scripting commands it would need "only" skilled coders, but for creating the AI it would need a dedicated team like the one that brought us AE: with experience with the topic, time, doctrines, but also with the real playing experience and experience with the habits that other people have shown over the years here. At best, a commercial venture could perhaps provide the core scripting engine and a very basic set of scripts that maybe on par with the present scripts we have, being able to handle anything "standard" in a crude fashion, and perhaps with more cheating trick than would be needed with a more refined AI. If we had that, I am pretty sure I'd abandon a lot of other projects for that.