Jolly Joker wrote:For several reasons I could list, if someone wishes so I think that letting the AI simply cope human behaviour is impractical.
I think that the way to build the best AI possible would be a way akin to the way a Random Map generator works. Modules or Templates of AI behaviour should be written, that could be combined. For example, there might be different AI modules or "modifier" for different behaviour depending on
a) map size
b) number of human/computer players
c) Objective (kill all, find Asha's Tear/Artifact, TaKe Object and so on)
d) race
e) difficulty level (starting resources)
On top of that there might be something like a personality modifier (variations in acceptable battle odds, for example, making one AI more careful than others).
Furthermore, something like "failsafes" might be interesting. Just for the heck of it I'd like to see a feature telling the human player while he is waiting for the AI to finish its turn:
"Reloading... AI lost main hero in a miscalculated fight..."
I tend to agree with JJ that at a certain point [that point is debateable] we should stop using hueristics && AI and fall back onto canned sets of scripts in some manner or another. Then we can allow the AI to slightly modify these scripts as appropriate but the script would act as a decent guideline ....
BTW: The failsafe that you're talking about would be a very nice feature for map makers so they can test their maps and [without doing a map reveal or other cheat] know what's going on.
********************************************************
As far as a good set of AI goals I would shoot for:
1. The AI should give the human its best effort. The AI should try to win in other words.
2. The AI should give, as much as possible, an appearance that it is playing by the same rules that we are.
3. The AI should be as configurable as possible to tailor it's behaviour to what the player wants. I.E. if they want it to cheat like mad to give a more competitive AI then good. If they want a minimum of cheats then that should be allowable also.
*******************************************************
If I was a HoMM playing AI and I had [literally] infinite resources I would:
1. Build tier 1-7 creatures in order as soon as possible.
2. Build structures to increase production [wells/castle/etc.] ASAP.
3. Build spell tower to increase spell casting power
4. Build any special buildings that increase total army power.
5. Build any defensive structures [walls/moats/turrets/etc.] possible
6. Build economic structures.
There can be exceptions to the above but 1-6 is the general order of importance that I would assume that you'd use for most factions. If you want hueristics instead of scripts I would tend to give HIGH weights to buildings that would directly impact my army strength [creature producers, enhancers, spell towers] ... I would give lower weights to economic structures because in this example you don't even need them.
As JJ points out there are lots of factors that would change the above ... map size / personality type imposed by map maker / hints given by map maker / available funds / expected duration of game / etc. These can change the weighting of everything dramatically. If we can come up with a good way to handle turn-by-turn dynamic weighting of building values I think we can end up with a decent general purpose building system.
**************************************************
While I'd love an AI that can hold it's own with a human I'm perfectly happy with "cheats" [bonuses] that don't break the illusion that the AI is playing by the same rules that humans are.
As was pointed out I think that AI should, at least, have perfect map knowlege. By perfect I mean that they know everything POSSIBLE that there is to know about the map [creature counts / join disposition / # of resources in a pile / amount of $ in a chest / terrain that they'd fight on if they attacked neutrals / etc.]. Granted you might choose not to act on all of the information but the information should be available to the AI should it be needed ...