Latest Posts

Topic: News about AI

soulless
Avatar
Joined: 2017-04-09, 13:20
Posts: 22
Ranking
Pry about Widelands
Posted at: 2017-07-21, 17:46

Tibor wrote:

After some changes I can see that military power grows now (though performance varies), so who is interested can try new version in ai_dna_dump branch...

I played again a quick islands at war and that looks better. The ai built smithy and smelting works early and military power grows in early part of the game. But the well problem remains. And this is a big problem. Again only one well and never a new one. At the end, after about 5 hours, the ai had around 70 wheat in warehouses / headquarter and no water. And every wheatconsumer was full of wheat and in state "no water" except mill which was in state "no flour needed". And the ai had only 2 farms to fill the warehouses with that much wheat. And of course military power only grows very slowly after a while because no water, no meals for the miners and not bread for arena and training camp.

And I had a idea. Perhaps it is impossible or to difficult but the source-file is named defaultai. Perhaps it is possible to add the b19-ai as oldai and than select ai per player and do some ai-only games with new vs old ai to train the new one? Because old ai also had it's problems but to train the new one to reach a good state could be perhaps something to think about. Of course sometime, when there are to many changes in widelands, the old ai must be kicked but for training the new ai ... if this is not so complicated? I don't know, just head the idea because if there is a default normally there are other options.


Top Quote
Tibor

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

soulless wrote:

Tibor wrote:

After some changes I can see that military power grows now (though performance varies), so who is interested can try new version in ai_dna_dump branch...

I played again a quick islands at war and that looks better. The ai built smithy and smelting works early and military power grows in early part of the game. But the well problem remains. And this is a big problem. Again only one well and never a new one. At the end, after about 5 hours, the ai had around 70 wheat in warehouses / headquarter and no water. And every wheatconsumer was full of wheat and in state "no water" except mill which was in state "no flour needed". And the ai had only 2 farms to fill the warehouses with that much wheat. And of course military power only grows very slowly after a while because no water, no meals for the miners and not bread for arena and training camp.

Indeed, it is time to tweak wells a bit, I already did some changes in code and going to compile and see how it works (and how AI copes with the changes)

And I had a idea. Perhaps it is impossible or to difficult but the source-file is named defaultai. Perhaps it is possible to add the b19-ai as oldai and than select ai per player and do some ai-only games with new vs old ai to train the new one? Because old ai also had it's problems but to train the new one to reach a good state could be perhaps something to think about. Of course sometime, when there are to many changes in widelands, the old ai must be kicked but for training the new ai ... if this is not so complicated? I don't know, just head the idea because if there is a default normally there are other options.

Yes, this is not new idea - to allow multiple AI alongside. I would welcome this. Only entire AI folder would need to be mirrored, because there is so much changes in other files. If somebody implements this I would commit to upkeep old version updated when needed - due to changes in the rest of widelands code


Top Quote
Tibor

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

OK, changes pushed to the branch, more training needed for things to settle down, but you can test it anyway...


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2017-07-21, 23:24

Hi did some further matches on trunk AI cause I can't compile for windows. This led to some questions:
1. Now the AI is building mill and brewery as empire, which they did not in the past. The log contains different values for some AI_DNA values due to mutation. Does the AI evaluate and safe the new values? cause since then they build these buildings every game and I haven't change a thing.
2. Had a look in the code on lp out of curiosity. I recognized that empire is building a pig farm very early, this is due to it beeing identified as a hunter according the code (outputs only one ware and this is meat).
3. Is there a windows build available for your branch to test?
4. The expansion of the AI is already very good and if they improve really on the economic side they might become a real challenge. As I play frisians currently they could be a Pain in the a.. already when attacking early. Even more if they keep on learning while playing against a human player and so adapting to it. will they do so?

Edited: 2017-07-21, 23:24

Top Quote
soulless
Avatar
Joined: 2017-04-09, 13:20
Posts: 22
Ranking
Pry about Widelands
Posted at: 2017-07-22, 15:35

Tibor wrote:

OK, changes pushed to the branch, more training needed for things to settle down, but you can test it anyway...

The well-problem is gone and it was very funny to watch the replay. He started to built more wells eary, I counted 15 after a while. Than, as he had about 600 water in stock, he started to dismantle every well. But as one well is forced he immediately started to built a new one. Than dismantled that after a few minutes because all the water in stock, than built a new and so on face-smile.png
So water was no more problem. But he did not built more than 2 farms so every wheat-consumer except piggery and sheep farm because meat and wool are not needed, were in state wheat missing.
And there was enough marble and building spots available.
One other thing which I found curios was that he built 5 arena and also 3 training camp but he did not upgrade one arena to a colosseum.
So military power was better than before but because of missing wheat not that much and because he upgraded no arena also the trained soldiers where not that strong.

Edited: 2017-07-22, 15:35

Top Quote
Tibor

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

hessenfarmer wrote:

Hi did some further matches on trunk AI cause I can't compile for windows. This led to some questions:
1. Now the AI is building mill and brewery as empire, which they did not in the past. The log contains different values for some AI_DNA values due to mutation. Does the AI evaluate and safe the new values? cause since then they build these buildings every game and I haven't change a thing.

NO. AI is not self-learning. What "a trainer" must do is to pick well-performing AI and copy its DNA to be used as a one of 4 sources for next games.

  1. Had a look in the code on lp out of curiosity. I recognized that empire is building a pig farm very early, this is due to it beeing identified as a hunter according the code (outputs only one ware and this is meat).

Oooooops. So this is nice example how can a bug go unnoticed for long time, thanks for noticing this. I fixed it and also added a check that there is just one lumberjack, hunter and well. I hope there will not be a tribe that violates this...

  1. Is there a windows build available for your branch to test?

I dont think so. I am not able to compile for windows. But I hope the branch will be soon merged into trunk...

  1. The expansion of the AI is already very good and if they improve really on the economic side they might become a real challenge. As I play frisians currently they could be a Pain in the a.. already when attacking early. Even more if they keep on learning while playing against a human player and so adapting to it. will they do so?

As I partially said in point 1, AI is not able to learn within a single game. AI needs simple scheme: change is DNA -> fitness score.


Top Quote
Tibor

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

soulless wrote:

Tibor wrote:

OK, changes pushed to the branch, more training needed for things to settle down, but you can test it anyway...

The well-problem is gone and it was very funny to watch the replay. He started to built more wells eary, I counted 15 after a while. Than, as he had about 600 water in stock, he started to dismantle every well. But as one well is forced he immediately started to built a new one. Than dismantled that after a few minutes because all the water in stock, than built a new and so on face-smile.png

This is something that should settle with training. But the "last well" issue is indeed a bug in logic, I will look into this.

So water was no more problem. But he did not built more than 2 farms so every wheat-consumer except piggery and sheep farm because meat and wool are not needed, were in state wheat missing.
And there was enough marble and building spots available.

Again, more training, if it will not help, I will make some manual changes...

One other thing which I found curios was that he built 5 arena and also 3 training camp but he did not upgrade one arena to a colosseum.

The same as above...


Top Quote
Tibor

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

And here is small example how DNA changes propagate and evolves

postimage

If you look at the map from the game, part of players grow fine, the rest grow poorer. This probably matches two branches in DNA graph and perhaps one of the branches will go extinct after this game. Unless there is some not obvious advantage that slowly-growing players possess.

EDIT:

When I looked at the map about one hour (of gametime) later - territories of all players were roughly equal. It seems two branches have just slightly different expansion policy but with similar results.

Edited: 2017-07-22, 21:30

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-07-23, 11:17

Regarding the hunter, requiring that the building has no inputs will exclude the piggery.

If Windows builds are needed, you could request a review with a note that it's just for the AppVeyor builds and not really ready for review yet. This will trigger the Windows builds for us.


Busy indexing nil values

Top Quote
Tibor

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

GunChleoc wrote:

Regarding the hunter, requiring that the building has no inputs will exclude the piggery.

This is exactly how I fixed it face-wink.png

If Windows builds are needed, you could request a review with a note that it's just for the AppVeyor builds and not really ready for review yet. This will trigger the Windows builds for us.

I plan to require a merge review in few days anyway, so windows build will be made then


Top Quote