Man I have been busy! I had to take a short break from game development most of which was a non-fun-mostly-work trip to Spain. I have been working all morning on my ideas for the AI. I wrote some notes to myself for what I wanted to include and then I typed out some equations and pseudo-code for the parts I'm planning. My notes/principles of design below, modified to better suit your perusal:
I want to try and make an AI for each
enemy type that agrees with that enemy's design. I also want to make not
necessarily a "learning" AI, but an AI that adapts by recognizing
trends in common tactics. So for a kill the leader mission the leader's
guards have a "intercept and disable" function that recognizes when player
units come within a determined coordinate threshold and then the guard
moves to attack them. I think that's pretty simple and straight forward.
If multiple units come forward multiple guards are dispatched, but what
if the player creates a hole in the formation the guards must recognize
to go all in at once, but then a player can circumvent them. They have
to then recognize the new strategy and cluster about the leader. The
leader being the most powerful unit has to recognize when the player has
killed enough enemies that the tides are turning so that it can deploy
and thwart the player, but at the same time be aware of his own delicate
position. Arrgh very vexatious! All the "what ifs" and countermeasures
will make for a very confusingly prioritized code so I have to think of a
way to simplify it into something like a trend recognition program or some other machine learning algorithm that
can "learn" from the most recent turns, and then detect and project player strategy, thus
deploying simple countermeasures when they are apt. I might need to build
something like a common strategies bank and counter measures. I was thinking what would be kind of cool for you guys is
the enemy commander could announce your strategies like he's commanding
and countering your troops ex: "They're trying to flank our position! Phalanx formation". Some commanders would also be purposely stupid I guess by not
giving them full access to the array of possible counter measures. The
algorithm along with the strategy bank will be the most complex aspect
of the AI by far. I'll have to find a way to simplify highly variable player choices to a recognizable trend or strategy profile. It will have to
analyze trends between multiple coordinate points as well as player vs.
enemy class, and unit statistics. In short design a macro thinking AI like chess AIs. The only easy part will
be the basic micro AI types, "Archer use distance formula to determine distance
between self and enemy if within range always fire when out of range
move closer, when within "d" distance move back, prioritize proximity
and for units within same proximity lowest max health." Simple.
I might be over thinking the algorithm I do that when I get excited. I always try to use the most complex math possible. Hmmm.
No comments:
Post a Comment