Latest Posts

Topic: News about AI

Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-09-03, 10:18

I pushed the new aihint values to the branch now. I got rid of nearly all forced_after; very basic buildings have no more prohibited_till flags. I´ll watch how AI performs with the new flags during training rounds and adjust them according to my observations; when it works well, this can be merged into trunk.

The metalworkshop problem has already been improved by training. It appears only under certain circumstances: There must be lots of space (often on Big Eden, never on Dolomites); this only starts after several hours of gametime; and even then, AI doesn´t always build that many metalworkshops. I think now that probably this issue can be solved with more training and no coding changes needed. Other issues such as "gamekeeper but no hunter" surface less often as well now. The only major AI problem that can´t be solved by training now is road building.


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-09-03, 10:28

Nordfriese wrote:

I pushed the new aihint values to the branch now. I got rid of nearly all forced_after; very basic buildings have no more prohibited_till flags. I´ll watch how AI performs with the new flags during training rounds and adjust them according to my observations; when it works well, this can be merged into trunk.

Great. In fact forced_after flags are too conflicting to basic economy stuff, e.g. when building is not a basic building, basic economy was not established yet, but the building is being forced by the flag...

The metalworkshop problem has already been improved by training. It appears only under certain circumstances: There must be lots of space (often on Big Eden, never on Dolomites); this only starts after several hours of gametime; and even then, AI doesn´t always build that many metalworkshops. I think now that probably this issue can be solved with more training and no coding changes needed. Other issues such as "gamekeeper but no hunter" surface less often as well now.

OK, I will do nothing then, I am glad it settled down....

The only major AI problem that can´t be solved by training now is road building.

OK, I will keep it in my virtual TODO list..


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-09-04, 18:21

I held some more training rounds and the results are very promising. With the new prohibited_till/forced_after values, the AI performs slightly worse on …unusual… maps like Archipelago Sea (hardly any building space) and No Metal Challenge (players 2-7, because so much building space is unreachable). Its risk of getting stuck without space has increased a bit for such maps.

On normal maps, it performs better now. For Empire the change is particularly noticeable. It used to do lots of stupid things like build two farms, a tavern and a vineyard before anything else; this is no longer the case. It rarely gets stuck anymore. Barbarians and Atlanteans start training their soldiers a bit later now, but after they start, it´s slightly faster/more efficient than before.

There are a few behaviour changes that look a bit stupid, but they never do any harm as far as I can see. For example, AI now often waits a long time before building a quarry, but it always does it in time so it doesn´t run out of granite/marble.

I think the branch is ready for merging into trunk now.


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-09-04, 18:29

Nordfriese wrote: It used to do lots of stupid things like build two farms, a tavern and a vineyard before anything else; this is no longer the case.

What's stupid about that? face-wink.png


Wanted to save the world, then I got widetracked

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-09-04, 18:54

WorldSavior wrote:

Nordfriese wrote: It used to do lots of stupid things like build two farms, a tavern and a vineyard before anything else; this is no longer the case.

What's stupid about that? face-wink.png

Do you usually start a game by building two farms? face-wink.png

It often caused the AI to get deadlocked with no space to build military buildings. What I mean to say is that the AI built too many buildings before it had enough space to afford them. And if it didn´t run out of space, it ran out of logs before it finished building a forester.


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-09-04, 19:48

Nordfriese wrote:

WorldSavior wrote:

Nordfriese wrote: It used to do lots of stupid things like build two farms, a tavern and a vineyard before anything else; this is no longer the case.

What's stupid about that? face-wink.png

Do you usually start a game by building two farms? face-wink.png

No, I don't do that. You're clearly right when you communicate that this is suboptimal. I just wouldn't call it stupid, as it is still no big mistake and the AI is able to do things which are really stupid face-wink.png


Wanted to save the world, then I got widetracked

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-09-04, 22:11

From my point of view, your branch looks good. If anybody is willing to test it - just go on.


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-09-07, 08:40

Nobody to test it? This is significant improvement and should merged without unnecessary delay...


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-09-07, 17:27

In the last training session, I noticed two things.

  • I never found any change of AI behaviour that affected the performance in a negative way, except for the regression on unusual maps I mentioned above. As I usually watch about 30-80 different AIs per round, I believe that the chance I overlooked something here is rather small. At least, no AI ever performed significantly worse on a normal map with my new values than any AI did before I changed the ai_hints.

  • The said regression is already getting better by training AI on such 'difficult' maps. So I´m confident that if there is a negative effect after all, it can be solved just by training the AI a few extra rounds.

A Question as I´m not familiar with launchpad: Can I just push the new wai files to the branch or will the open merge request make this more difficult?


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-09-07, 21:08

Nordfriese wrote:

A Question as I´m not familiar with launchpad: Can I just push the new wai files to the branch or will the open merge request make this more difficult?

Yes, you can push new commit any time, even now. No consequences... I did it many times during merge review....


Top Quote