Latest Posts

Topic: News about AI

GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-28, 09:18

As the AI gets better, we'll definitely need more dumbing down. I would already get my ass kicked by the old AI, so we will have to consider noobs like me in oder not to scare off new players face-wink.png


Busy indexing nil values

Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-08-29, 10:07

As is usually the way, once I get myself committed to helping with something life gets in the way, I will be as good as offline until November at least so cannot test much at all.

I have run some AI tests, using normal against very weak, same tribe. There is virtually no difference between them, on games that ended without deadlock there is a 50% of either side winning. Testing done on a variety of maps from small to large on several releases up to but not including the last release.

Edited: 2017-08-29, 10:08

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-29, 12:00

Thanks for testing! I hope that the reason that you will be offline is that something good is happening in your life.


Busy indexing nil values

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

Training is going wonderfully now, I often get several major improvements in just one generation. Just a couple of remarks about the AI behaviour:

  • The problem that AI builds lots of metalworkshops is probably related to the last change in helpersite algorithm. I´ve managed to train AI to the point where it builds not 40 but "only" about 10-20, but that´s still too much, as it usually can´t supply them all. It also comes with the catch that having not many metalworkshops generally means that the AI builds too few wells. It shows this kind of irrational behaviour only for barbarian metalworkshops. AI also likes to build helpersites but no using site, for example several gamekeepers but no hunter nearby.

  • May I suggest considering some major changes to the road building algorithm. Stupidly built roads often increase transport times by more than 10 times, and they tend to block space-consuming buildings like farms. Also, AI is prone to getting nearly deadlocked with stuffed-up bottleneck roads and doesn´t build a second road even if there is lots of space and it would shorten transport times significantly.

  • Barbarian AI often builds a battle arena long before it even has a brewery. Also, it builds its first training camp and battle arena simultaneously, which often means that each site gets 2 gold and neither is finished. Some minor changes to the prohibited_till flags might help. Incidentally – what unit are those flags measured in?


Top Quote
Tibor

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

Hi, I am back finally...

as for dumbing down the AI there are two ways:


Top Quote
Tibor

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

Nordfriese wrote:

Training is going wonderfully now, I often get several major improvements in just one generation. Just a couple of remarks about the AI behaviour:

  • The problem that AI builds lots of metalworkshops is probably related to the last change in helpersite algorithm. I´ve managed to train AI to the point where it builds not 40 but "only" about 10-20, but that´s still too much, as it usually can´t supply them all. It also comes with the catch that having not many metalworkshops generally means that the AI builds too few wells. It shows this kind of irrational behaviour only for barbarian metalworkshops. AI also likes to build helpersites but no using site, for example several gamekeepers but no hunter nearby.

To me it looks like a dead branch of evolution - few days ago you mentioned some good mutation in regard to metalworkshops happened but obviously the effects are not that good. But I will do some changes to code and hopefully with further training things will settle down... The problem is the fact that metalworks is upgradeable and it is treated differently....

  • May I suggest considering some major changes to the road building algorithm. Stupidly built roads often increase transport times by more than 10 times, and they tend to block space-consuming buildings like farms. Also, AI is prone to getting nearly deadlocked with stuffed-up bottleneck roads and doesn´t build a second road even if there is lots of space and it would shorten transport times significantly.

Yes, I know about this issue. But - it is complicated... Road algorithm is not controlled by genetic algorithm... AI tries to build a road from a flag filled with material, but sometimes it is not possible.

  • Barbarian AI often builds a battle arena long before it even has a brewery. Also, it builds its first training camp and battle arena simultaneously, which often means that each site gets 2 gold and neither is finished. Some minor changes to the prohibited_till flags might help. Incidentally – what unit are those flags measured in?

These flags are in seconds. And feel free to modify them. When the training will be finished (or your spare time spend) you can propose new branch with new wai numbers and changes to aihints there as well...


Top Quote
Tibor

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

@Nordfriese

Also, can you please provide your latest wai files? I need them to debug metalwork issue...


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

I just had a look at the values for the prohibited_till/forced_after flags. They´re a mess. They appear to be mostly arbitrary; many dependencies between buildings are not considered at all. These flags seem to be the reason why empire AIs are particularly deadlock-prone. The barbarian quarry is prohibited_till=240 and forced_after=0, which is not the most logical combination.

I´ve made a branch which contains the latest training results and my suggestions for better flags. For now, I only adjusted ports, militarysites and trainingsites; my suggestions for productionsite ai-hints will be pushed tomorrow. I´m revising them completely.

Of course, the new hints will need to be tested before merging them into trunk. I expect there will be some trial-and-error before I find a set of values that solves all the problems of the current flags without creating new difficulties.


Top Quote
Tibor

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

Nordfriese wrote:

I just had a look at the values for the prohibited_till/forced_after flags. They´re a mess. They appear to be mostly arbitrary; many dependencies between buildings are not considered at all. These flags seem to be the reason why empire AIs are particularly deadlock-prone. The barbarian quarry is prohibited_till=240 and forced_after=0, which is not the most logical combination.

prohibited_till and forced_after are things of pre-basic economy time. And basic economy is meant as a better replacement. So I would suggest to use them as little as possible.

I´ve made a branch which contains the latest training results and my suggestions for better flags. For now, I only adjusted ports, militarysites and trainingsites; my suggestions for productionsite ai-hints will be pushed tomorrow. I´m revising them completely.

Of course, the new hints will need to be tested before merging them into trunk. I expect there will be some trial-and-error before I find a set of values that solves all the problems of the current flags without creating new difficulties.

I personally am not eager to test them, if there will be another volunteer it would be great.... But I personally trust your judgment...


Top Quote
Tibor

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

So I am testing wai files from your branch, with code from current trunk, and nothing strange here in regard to metalworkshops - after 3 hours they have 2 or 3 metalworkshops. Is the problem map-specific?


Top Quote