AI players should focus on priority enemy

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
sacredceltic
Posts: 55
Joined: October 20th, 2013, 4:07 pm

AI players should focus on priority enemy

Post by sacredceltic »

One simple way to always beat AI players is to let them annihilate each other as they are busy to attack all the others at the same time while you human can focus on an enemy of your choice.
So my suggestion would be to enable AI players to evaluate which enemies they should focus on, rather than attacking every other player at the same time.

For example, when you are located in a corner, you focus first on eliminating your enemies on your direct borders, rather than go attacking everybody in the middle of the map. But the AI players don't focus.
Another example is when you are located between 2 enemies, you usually want to defend on one side while attacking on the other, in order to avoid having to spread your attacks on 2 fronts. But AI players don't have that ability.

I suggest that a simple pre-analysis of the location should do the trick and command a strategy : either attack or defend against each given enemy, and that strategy should hold while the enemy is still alive. Each time an enemy is eliminated, the strategy should be reviewed...
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: AI players should focus on priority enemy

Post by mattsc »

Hi sacredceltic, thanks for posting your ideas and welcome to the forums. Unfortunately, some of the things you write aren't as easy as they sound. In particular, making the AI defend a position (as opposed to straight attacking) is quite hard as the computer lacks the human brain's pattern recognition capabilities. Thus, implementing what you suggest in the AI in general is anything but a simple task. On the other hand, doing it for a specific scenario by modifying the AI behavior is quite possible and can already be done by the scenario designer. A few specific comments:
sacredceltic wrote:One simple way to always beat AI players is to let them annihilate each other as they are busy to attack all the others at the same time while you human can focus on an enemy of your choice.
So my suggestion would be to enable AI players to evaluate which enemies they should focus on, rather than attacking every other player at the same time.

For example, when you are located in a corner, you focus first on eliminating your enemies on your direct borders, rather than go attacking everybody in the middle of the map. But the AI players don't focus.
Another example is when you are located between 2 enemies, you usually want to defend on one side while attacking on the other, in order to avoid having to spread your attacks on 2 fronts. But AI players don't have that ability.
These all fall into the "can already be done" category. Check out the options at AiWML, for example the [goal] tag. However, I would argue that what you describe is not always the best strategy or even desired. For example, depending on the scenario, having two AIs fight it out among each other might be how the scenario creator intended it to play out and be the only way to win for the player.
sacredceltic wrote:I suggest that a simple pre-analysis of the location should do the trick and command a strategy : either attack or defend against each given enemy, and that strategy should hold while the enemy is still alive. Each time an enemy is eliminated, the strategy should be reviewed...
First, again, if this is meant as a general strategy that should work in all (or most) scenarios, that analysis is anything but simple. The second problem is, as already mentioned, that there is no good defensive mode in the Wesnoth AI (at least not in general; there are things that can be done in specific situations).

Now, having said all that, I would encourage you not to believe me :D and try things out yourself. Check out the already mentioned AiWML for simple options to modify the AI. You can see what some of us have done for specific behavior in the Micro_AIs. There are also a couple MP AIs under development in the AI-demos add-on that, when finished, will play quite differently from the default AI, but they are currently quite far from being finished. If you want to try writing some AI code yourself (as I said, don't believe me and try it out yourself), that can be done (relatively) easily using the Lua AI functionality. A little help getting started can be found here. We are always interested in people working on this, so by all means, if you find anything or have other ideas (the more specific the better), please let us know.
Post Reply