Formula AI in 1.8

General feedback and discussion of the game.

Moderators: Forum Moderators, Developers

User avatar
Des
Posts: 116
Joined: November 7th, 2007, 7:58 am
Contact:

Formula AI in 1.8

Post by Des »

I read in the Google Summer of Code 2009 Wrapup about how the formula AI will be revamped in 1.8. However, I am curious as to how this will play out in the next version.

Will this change automatically affect how the AI recruits? If I begin a campaign in 1.8, will it be more of a challenge?

I notice some redundant AI recruiting in certain games (such as the World Conquest addon, a multiplayer campaign), where the AI will recruit mostly one type of unit (scouts, gryphons, Woses, etc...) to a point that they don't have anywhere near a balanced army. Will the revamped formula AI fix this problem for more interesting/challenging games?
Last edited by Des on January 26th, 2010, 1:51 pm, edited 1 time in total.
Redrock Gulch (Winter 2009 Map Contest Submission)

To rely on rustics and not prepare is the greatest of crimes; to be prepared beforehand for any contingency is the greatest of Virtues. - Sun Tzu, The Art of War

Rya
Posts: 350
Joined: September 23rd, 2009, 9:01 am

Re: Formula AI in 1.8

Post by Rya »

I really hope it gets improved.
Wesnoth
The developer says "no".

User avatar
doofus-01
Art Contributor
Posts: 3843
Joined: January 6th, 2008, 9:27 pm
Location: land of boot-licking, craven prostitutes posing as senators

Re: Formula AI in 1.8

Post by doofus-01 »

Des wrote:Will this change automatically affect how the AI recruits?
I don't believe it will automatically change the default AI behaviour, but it will make more options & control available for the content authors.
Des wrote:I notice some redundant AI recruiting in certain games (such as the World Conquest addon, a multiplayer campaign), where the AI will recruit mostly one type of unit (scouts, gryphons, Woses, etc...) to a point that they don't have anywhere near a balanced army
Rya wrote:I really hope it gets improved.
If you notice instances of specific, reproducible AI stupidity, report it in the development or feedback thread for that campaign/map/scenario/whatever. It's the fastest, possibly only, way these things will get ironed out.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects

Rya
Posts: 350
Joined: September 23rd, 2009, 9:01 am

Re: Formula AI in 1.8

Post by Rya »

If you notice instances of specific, reproducible AI stupidity, report it in the development or feedback thread for that campaign/map/scenario/whatever. It's the fastest, possibly only, way these things will get ironed out.
Well I once posted a suggestion about a general ai stupidity and I basically got a "AI is hard to improve, if you really think you know how then do it yourself" reply. It'd be nice if some things could be fixed like better protection of the ai leader and also making the leader recruit new units even though he's wounded.
Wesnoth
The developer says "no".

Caphriel
Posts: 994
Joined: April 21st, 2008, 4:10 pm

Re: Formula AI in 1.8

Post by Caphriel »

Yes it would, but improving the AI is hard :wink:

I think what doofus-01 was suggesting was that the AI settings can be tweaked for a single scenario to make it perform better in that scenario, if it does something consistently stupid in that scenario.

User avatar
Des
Posts: 116
Joined: November 7th, 2007, 7:58 am
Contact:

Re: Formula AI in 1.8

Post by Des »

doofus-01 wrote:If you notice instances of specific, reproducible AI stupidity, report it in the development or feedback thread for that campaign/map/scenario/whatever. It's the fastest, possibly only, way these things will get ironed out.
That’s just it, though—the problem exists at the very core of the AI’s behavior that it can’t be fixed by individual AI formulas. Dave himself said so in a AI revamp post for 1.7, and I figured it was why AI was being worked on in the first place.

AI opponents simply aren’t programmed to know how to recruit a balanced army throughout the game while countering your army with new recruits. Like Dave says, the AI is programmed to check moves “in phases,” which clouds its overall strategy. It might find an immediate advantage in attacking relentlessly (which it does an awful lot), without checking that grabbing a village would be a better choice instead. Very rarely will the AI take up a defensive position seriously, even when it is the better choice. Attacking/defending accordingly to the day-night cycle is also something it does poorly overall.

My question is: exactly what has been done to correct this thus far, and how will those changes affect gameplay in 1.8?
Redrock Gulch (Winter 2009 Map Contest Submission)

To rely on rustics and not prepare is the greatest of crimes; to be prepared beforehand for any contingency is the greatest of Virtues. - Sun Tzu, The Art of War

Yoyobuae
Posts: 408
Joined: July 24th, 2009, 8:38 pm

Re: Formula AI in 1.8

Post by Yoyobuae »

From what I understand:
  • The generic AI used for all computer controlled sides will get (or has already gotten, not sure) improvements. Some of the improvements include to compare possible candidate moves (instead doing them on phases) and group units in "squads".
  • Formula AI is a special language for campaign/scenario writers to control the behavior of the AI units directly. It replaces the generic AI when used. It can be used for example to have AI units patrol between points and such. I don't think a fully fledged AI has been made with it (or if doing so would be plausible at all)

User avatar
Des
Posts: 116
Joined: November 7th, 2007, 7:58 am
Contact:

Re: Formula AI in 1.8

Post by Des »

Yes, that’s it. Replacing the "phase" system the AI has now with candidate moves and allowing the grouping of units into squads.

Is there a dev that can confirm this revamp of the generic AI will be included in 1.8, if it hasn’t already been implemented?
Redrock Gulch (Winter 2009 Map Contest Submission)

To rely on rustics and not prepare is the greatest of crimes; to be prepared beforehand for any contingency is the greatest of Virtues. - Sun Tzu, The Art of War

User avatar
Des
Posts: 116
Joined: November 7th, 2007, 7:58 am
Contact:

Re: Formula AI in 1.8

Post by Des »

...or not...
Redrock Gulch (Winter 2009 Map Contest Submission)

To rely on rustics and not prepare is the greatest of crimes; to be prepared beforehand for any contingency is the greatest of Virtues. - Sun Tzu, The Art of War

MDG
Posts: 378
Joined: June 7th, 2007, 11:18 am
Location: UK

Re: Formula AI in 1.8

Post by MDG »

Have you tried asking on IRC?

User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: Formula AI in 1.8

Post by Crab »

Des wrote:Yes, that’s it. Replacing the "phase" system the AI has now with candidate moves and allowing the grouping of units into squads.

Is there a dev that can confirm this revamp of the generic AI will be included in 1.8, if it hasn’t already been implemented?
new candidate-action based ai will be included in 1.8, as a default one (it'll replace old default ai).
no work towards 'grouping of units into squads was done'.
the main good thing is that is now possible to work with the ai as a 'collection of components', which can be written using different languages, like c++ and formula ai ( and in 1.9 - we'll add lua support). So, it'll be possible to tune the ai by changing/extending only a specific part of it, using formula_ai.
There'll be a guide about 'how to do it'.

User avatar
Des
Posts: 116
Joined: November 7th, 2007, 7:58 am
Contact:

Re: Formula AI in 1.8

Post by Des »

Crab wrote: new candidate-action based ai will be included in 1.8, as a default one (it'll replace old default ai).
no work towards 'grouping of units into squads was done'.
the main good thing is that is now possible to work with the ai as a 'collection of components', which can be written using different languages, like c++ and formula ai ( and in 1.9 - we'll add lua support). So, it'll be possible to tune the ai by changing/extending only a specific part of it, using formula_ai.
There'll be a guide about 'how to do it'.
Excellent. Thanks for getting back to me. I've always thought of 1.8 as having those changes...just wanted to be sure I was hyped up for the right thing in mind. Sounds great.
Redrock Gulch (Winter 2009 Map Contest Submission)

To rely on rustics and not prepare is the greatest of crimes; to be prepared beforehand for any contingency is the greatest of Virtues. - Sun Tzu, The Art of War

User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: Formula AI in 1.8

Post by Crab »

Des wrote: Excellent. Thanks for getting back to me. I've always thought of 1.8 as having those changes...just wanted to be sure I was hyped up for the right thing in mind. Sounds great.
Note that at this moment we're not using all the possibilities that the 'candidate action' system opens to us. This might still change, but, as of now, candidate action-based ai still uses 'static' priorities of candidate actions, the same order of stages as old ai, so it doesn't compare 'attacking relentlessly' action to 'grabbing a village' action - although in the new system it *can* do so (the difficulty lies in the need to implement a suitable set of evaluators to allow such a comparison)

User avatar
Des
Posts: 116
Joined: November 7th, 2007, 7:58 am
Contact:

Re: Formula AI in 1.8

Post by Des »

Crab wrote:Note that at this moment we're not using all the possibilities that the 'candidate action' system opens to us. This might still change, but, as of now, candidate action-based ai still uses 'static' priorities of candidate actions, the same order of stages as old ai, so it doesn't compare 'attacking relentlessly' action to 'grabbing a village' action - although in the new system it *can* do so (the difficulty lies in the need to implement a suitable set of evaluators to allow such a comparison)
So let me make sure I get this right:

In 1.8, we'll see a new AI system in place--a system in which the AI can choose between candidate moves as opposed to a phase-based system we currently have. But all these changes are under the hood, meaning that players won't see improved AI until further development of this new system takes place. Is that right?

Will the default AI not be improved even slightly for the release of 1.8?
Redrock Gulch (Winter 2009 Map Contest Submission)

To rely on rustics and not prepare is the greatest of crimes; to be prepared beforehand for any contingency is the greatest of Virtues. - Sun Tzu, The Art of War

User avatar
Crab
Inactive Developer
Posts: 200
Joined: March 18th, 2009, 9:42 pm

Re: Formula AI in 1.8

Post by Crab »

Des wrote: So let me make sure I get this right:

In 1.8, we'll see a new AI system in place--a system in which the AI can choose between candidate moves as opposed to a phase-based system we currently have. But all these changes are under the hood, meaning that players won't see improved AI until further development of this new system takes place. Is that right?

Will the default AI not be improved even slightly for the release of 1.8?
Yes, In 1.8, we'll see a new AI system in place--a system in which the AI can choose between candidate moves as opposed to a phase-based system we currently have.
Yes, with the further development of the new system there'll be more visible effect of all those changes that were done.
Most of the actual parts of the new AI are taken from old ai, so there'll not be big improvement in the AI for 1.8. There are some changes in targeting, and some bugs are fixed, and some classes of bugs are absent. There's a new, improved, experimental recruitment thing written by Dragonking in formula ai, but it requires some bugfixing - I don't know if they'll be done for 1.8 or not (however, I do use that recruitment in some of LoW scenarios -and it works great, noticeably better than old recruitment). And, especially on big maps, new ai is better - it beats old ai with a win ratio about 2:1

However, we now have three important advantages:
1. it is easier than before to customize the ai for a particular scenario.
2. we can tweak a part of the ai and compare untweaked ai with tweaked ai, figuring out 'which is better' via multiple ai-vs-ai battles.
3. we can use multiple languages for different parts of the same ai. for example, we can use both c++ and formula_ai to create an ai. And, right now, I have a prototype of lua ai engine - and using lua as a scripting language will bring out the possibility of 'ai is an addon, improved versions of which can be developed by anyone and downloaded from addon server' paradigm, which will be a very good thing.

Post Reply