Currently Online

Latest Posts

Topic: News about AI

toptopple
Avatar
Joined: 2013-10-30, 08:11
Posts: 156
Ranking
At home in WL-forums
Posted at: 2016-12-21, 18:19

I don't quite understand. In what relation is the current state with your experiments with the genetic algorithm?

I tested your branch with Gold Rush and report major things.

1. Building organisation appears improved, in particular wood supply has a far better standing now and buildings use space more efficienctly.
2. Major AI problem: street reorganisation fails completely (missing). This leads to a lot of unused space, funny courses and retarded deliveries.
3. Major AI problem: military buildings are disassembled pretty soon after erection. This makes the tribes more peaceful as they lack attack capacity. On the other hand they disassemble even in the face of the enemy and consequently lose the battle.
4. (Almost) no farms built. All 3 AI players thought they can get through with one farm. I still wonder how ATL produced bread for their soldier enhancements which actually took place. A suspicious mystery! ;)
5. Still lingering AI problem: colony space remains unused for the economy. No mines built, no farms built. This may have to do with the farm confusion reported above.
6. Expeditions went good and a bit more timely than hitherto (first ship about 1:15h gametime).

Edited: 2016-12-21, 18:22

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-12-21, 21:31

The branch ai-post-b19-2 contains partialy redesigned AI that uses (partially) parameters generated by genetic algorithm. It contains DNAs of 4 "personalities" and when AI is initialized it picks one of them, mutate it a bit and crossbread with another AI a bit. The picture showed that in the time of its generation, 3 AIs were close relatives and one a bit distant - not mutch. So every AI is now slightly different -though it might be not mutch recognizable.

But to your points:

  1. logic of roads was/is not affected by changes, it is managed by the same algorithm as before, I am not sure if genetic algorithm can be used here - perhaps...
  2. This is exactly what I noticed. It is bit strange that it evolved this way, part of AI vs AI problem is that they are all very similar and such mutual training can lead to some idiosyncratic behaviour, but I will look at this issue... Perhaps modification of fitness function would help here...
  3. Building of second and further production sites is a challange. It would need more and longer games, because such second and next buildings would make the difference after about 2nd hour or so, so it would need games lasting 4 or more hours - and it is a problem - I dont have capacity for such long trainings and many of them...
  4. Should not be affected by this changes...

So thank you for your feedback I will investigate mentioned problems (because I of course agree with you)...


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-12-22, 14:57

Is there a way I can help with training when I'm back home? I could let my Linux machine run overnight and e-mail the results to you or something.


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: 2016-12-22, 22:28

Gun, thanks for offer, I am running the training games quite a lot of hours on my PC - daily, my PC would be mostly up anyway. Usually it is about 6 hours daily. What would be nice is to have a PC running around the clock for week or more weeks. So no, I will not bother you, it is not worth the effort...

Part of "problem" is that I do changes to code quite frequently and that implies further training, I already did some changes based on toptopple comments and consequently "performance" of AI dropped and additional training was needed. AI's performance is back now - roughly, as it is impossible to run two distinct AIs and let them fight together I cannot easily compare if it is now better then few days ago... I am going to push retrained AI to launchpad soon...


Top Quote
Tibor

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

OK, after so much struggle I have the AI again in a shape you can compile and try.

bzr branch lp:~widelands-dev/widelands/ai-post-b19-2

What I reworked:

* AI is now more willing to build more productionsites of the same kind
* militarysites building/dismantling is more sane
* changes to rangers and lumberjacks
* and more I can not recall now




I stugled a lot with fitness function and in theory it offer us a possibility to re-introducing defensive player - fitness function would be only military strength, so AI would sacrifice land expansion and reduce attacking (I presume). But as I said the training itself is extremely time consuming and having two AIs would increase needed time, not 2-fold but still.
Try only normal AI, other two will have to be additionally modified and they are probably the same as normal AI but I am not sure.

So please try who is interested.


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-03-02, 23:40

Tibor wrote:

OK, after so much struggle I have the AI again in a shape you can compile and try.

bzr branch lp:~widelands-dev/widelands/ai-post-b19-2

Last time when I installed a development version I suddenly could not go back to build19 and this got me into trouble, so I'm not sure if I should try it now again. But maybe I can make some comments nevertheless...

What I reworked:

  • AI is now more willing to build more productionsites of the same kind

That might be very good face-smile.png

  • militarysites building/dismantling is more sane

That might be great! I've seen that the build19-AI builds not enough militarysites, especially at the border, especially towers. The build18-agressive-AI was better there (even though that one build to much buildings at the borders :-P)

  • changes to rangers and lumberjacks

That might also be good. The build19-AI does some funny mistakes concerning those buildings.

And in general: I don't know if that is still up-to-date, but the build19-AI builds never horse/ox/donkey farms. And it builds rather a second Arena than a second trainingscamp which is rather weakening it than improving. (Atlanteans seem to be more or less okay. They often build 2 labyrinths and one dungeon (or the other way around? don't know), but I've already seen one who build 2 of each face-smile.png )

Edited: 2017-03-02, 23:41

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-03-02, 23:56

If you compile yourself on linux, the entire stuff should not get out of the directory where you compile, so there should be no issues, but let other say their experiences.....

When talking about improvement I meant in comparison to previous state of this branch. The change here is so deep that some aspects were done from scratch. But mainly productionsites and militarysites. Trainings sites were not touched much. So I dont dare to claim it works better than build 19 or current trunk (but both have basically the same AI). In fact I have not done 1:1 comparison, but this should have different "characteristics" for sure. It is up to others to say how it compares.

EDIT: I dont claim it is production-ready, but it works just good enough for looking at.

Edited: 2017-03-02, 23:58

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-03-08, 00:51

Tibor wrote:

let other say their experiences.....

I didn't say that others shouldn't say anything

Trainings sites were not touched much.

So my feedback about the second arenas/colosseums might be very helpful. Especially a second colosseum is a big mistake


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-03-08, 11:46

So what should be limits for trainingsites? Max one of each type? Or max 3 trainingsites per player?


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2017-03-08, 21:02

Tibor wrote:

So what should be limits for trainingsites? Max one of each type? Or max 3 trainingsites per player?

You have to differentiate here. colosseum only gives 2 promotions to a soldier, while training camp gives 8. so you could have 4 training camps and 1 colosseum and they would all work fine. So if we were to code for hard limits, i would suggest 1 colosseum 4 training camps for empire, 1 arena 3 training camps for barbarians, and 2 labyrinths plus 2 dungeons for atlanteans.

still, considering that ai tends to lose terrain against humans, building some redundancy could be good. it would be good, if it wouldn't affect the efficiency of everything else. maybe consider coding the ai so that it can make buildings above the hard limit, but it will keep them stopped and with no resources inside.


Top Quote