Currently Online

Latest Posts

Topic: AI-Training

WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 1606
Ranking
One Elder of Players
Location: North of Germany
Posted at: 2019-05-02, 13:31

hessenfarmer wrote:

WorldSavior wrote:

hessenfarmer wrote:

  • AI does not expand into enemy owned but unguarded territory (fix already figured out see bug report on Launchpad)

I tested that with rc20. Just dismantled the castle of a castle-village, but the AI expanded into that territory.

Were there any other military buildings in that vicinity?

Of course not

Which map?

Barren Island

could you provide me a replay / savegame?

I don't have your mail adress. The replay would be easy to reproduce, crater map would also be good for testing.


“It's a threat to our planet to believe that someone else will save it.” - Robert Swan

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 1337
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-05-05, 01:30

Hi everybody,

have uploaded a branch which in my opinion makes AI better by fixing some issues. Mainly it builds now much more Productionsites. This needs some AI-training though.
If you want to try it out
https://code.launchpad.net/~widelands-dev/widelands/AI-fixes

regards hessenfarmer

Edited: 2019-05-05, 01:31

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 1337
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-05-15, 10:03

hessenfarmer wrote:

Hi everybody,

have uploaded a branch which in my opinion makes AI better by fixing some issues. Mainly it builds now much more Productionsites. This needs some AI-training though.
If you want to try it out
https://code.launchpad.net/~widelands-dev/widelands/AI-fixes

regards hessenfarmer

Short update on this AI now builds second carrier recruiters properly


Top Quote
teppo
Joined: 2012-01-30, 09:42
Posts: 395
Ranking
Tribe Member
Posted at: 2020-04-21, 06:23

Is there was a way to run the training in loops, without human interaction? If yes, how is that done?


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1332
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-04-21, 07:39

teppo wrote:

Is there was a way to run the training in loops, without human interaction? If yes, how is that done?

Yes, it is how it is done. Generally you need a score to pick the best AI from multiple AIs, and then some scripting that would move winning wai file to data/ai to be used for next round.

The biggest issue is a score. The code has some score inbuilt, but the score is quite esoteric thing. So you would redirect console output to the file and parse to get the score. If you are familiar with C++ you will probably want to make own modifications to the score formula.

I usually run 9 games with 4 AIs in each game in 1 round, and than pick one WAI for each position, that means from 9 random AIs and use it as a source for next round.

We can discuss more just ask.


Top Quote
teppo
Joined: 2012-01-30, 09:42
Posts: 395
Ranking
Tribe Member
Posted at: 2020-04-21, 16:50

Tibor wrote:

teppo wrote:

Is there was a way to run the training in loops, without human interaction? If yes, how is that done?

Yes, it is how it is done.

Yes.. how? Just adding --ai_training as command line parameter does not do magic. I suppose that one needs to at least declare which map to use. I have a vague memory of doing that long ago, but cannot figure out how now.


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1332
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-04-21, 16:56

I am using bunch of saved games, but saved within first few seconds, so that AI DNA is reinitialized. I tried it with just maps, but there is no a way how to start a network game purely from command line.

The savegames are made the way that first player is 'me' - but nobody plays there, so you need map with one extra idle spot in this setup.


Top Quote