Latest Posts

Topic: AI-Training

GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-05-02, 07:34

Tibor wrote:

GunChleoc wrote:

I don't want to touch the graphics right now, because I have too many related open branches that would conflict with a change there.

there is one interested aspect here - game autospeed is calculated based on game FPS, so I dont know how deep with removal of graphics you plan to do....

There would still be an FPS. It would be faster though, because the processor would not take up any time calculating and drawing the graphics. Getting rid of the graphics will be a big project though, so don't expect it any time soon.


Busy indexing nil values

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

Tibor wrote:

hessenfarmer wrote: What I meant is that the AI is blocking a lot of spots by its weird road layout. I think the problem is that Ai is only calculating path cost from unconnected flag to connected flag found and it should calculate path cost to nearest warehouse. this might help probably.

I understand, but that means AI will need to calculate also road distance from 1-5 candidate flags to nearest warehouse..... This means CPU utilization... while candidate flags are gathered with one A* algorithm, this would mean additional 1-5 (depending on candidate flags count) A* algorithms. Or rethink it somehow completely...

maybe storing the cost with the flag would work. So we only need to recalculate these values when a warehouse is build. However Nordfriese currently tries to build a swcenario AI which seemd to built a better road system, although I did not analyse the difference Perhaps I'll find to look into that as well.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-05-02, 09:18

hessenfarmer wrote:

maybe storing the cost with the flag would work. So we only need to recalculate these values when a warehouse is build. However Nordfriese currently tries to build a swcenario AI which seemd to built a better road system, although I did not analyse the difference Perhaps I'll find to look into that as well.

Do you mean that each flag (not on AI side) will store distance to nearest warehouse? Or it should be done on AI side on flag observer? I can imagine to have this info with expiration time, so it would be recalculated when flag is to be considered as a candidate and if the info is older then X minutes. Also note that not only new/lost warehouse, but change in road network can change distance to nearest warehouse...


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

Tibor wrote:

hessenfarmer wrote:

maybe storing the cost with the flag would work. So we only need to recalculate these values when a warehouse is build. However Nordfriese currently tries to build a swcenario AI which seemd to built a better road system, although I did not analyse the difference Perhaps I'll find to look into that as well.

Do you mean that each flag (not on AI side) will store distance to nearest warehouse? Or it should be done on AI side on flag observer? I can imagine to have this info with expiration time, so it would be recalculated when flag is to be considered as a candidate and if the info is older then X minutes. Also note that not only new/lost warehouse, but change in road network can change distance to nearest warehouse...

I meant to store this on Ai side only. However this was just a quick thought and is not fully elaborated. I agree about the triggers for new distance though. Having done this every x seconds (expiry time seems to be a good idea in this case.


Top Quote
Tribal-Chief
Avatar
Joined: 2018-12-09, 17:16
Posts: 62
Ranking
Likes to be here
Posted at: 2019-05-02, 11:10

Tibor wrote:

The current state of AI is that it ignored starting conditions and win condition. E.g. we have "basic buildings" concept and if we want to adjust to different starting condition first thing we would need is specific basic buildings for each condition. This is 80% of success. Also different win conditions - this is for further discussion.

My opinion until we have good playing "general conditions AI" it is too soon to bother with wind conditions and so on...

AI makes thousands (or at least hundreds) decisions during gameplay and I see no way how every single could be real-time scored and evaluated as good or bad. What we can do is only some "general evaluation", without analyzing what decisions helped or hurt that final result. If you have an idea how to evaluate decisions like: "in 1:23:45 we attacked building at 12x23 with 8 soldiers", or "in 0:12:34 we built ranger on 98x67" just say your opinion.

BTW what is the game you have experiences with?

I did not mean real time scoring of every decision, rather at the end of a game the AI scores its dna file with bonus/malus scores depending on whether it won a game, or its position in the score list, if it had partially got towards the win condition, if it got stuck and did not grow during the game etc.

I cannot coment on the projects I am working on due to NDA's, apart from Quest which in pre alpha sandbox stage and currently not public.


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

Just for information to everybody. I am currently analysing the Ai and its behaviour again. So far I found 3 bugs which would not vanish by training but need to be solved in the code first:

  • AI does not expand into enemy owned but unguarded territory (fix already figured out see bug report on Launchpad)
  • the actual stocklevel of a buildings output is not taken into consideration for the neededness of a building (fix strategy is add more weighted inputs to take this into consideration)
  • AI currently does not build second carrier recruitment (not completely confirmed but higky probable, same fix as for buildings output but with worker output instead).

With these bugs fixed the AI performance might increase a good step. Branch will follow over the weekend.


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: 2019-05-02, 12:42

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.

  • AI currently does not build second carrier recruitment (not completely confirmed but higky probable, same fix as for buildings output but with worker output instead).

Yes. Only exception might be Frisians, because of the multiple purpose of reindeer farms.

With these bugs fixed the AI performance might increase a good step. Branch will follow over the weekend.

Sounds good


Wanted to save the world, then I got widetracked

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-05-02, 12:56

Tribal-Chief wrote:

I did not mean real time scoring of every decision, rather at the end of a game the AI scores its dna file with bonus/malus scores depending on whether it won a game, or its position in the score list, if it had partially got towards the win condition, if it got stuck and did not grow during the game etc.

I think some "absolute score" would be needed for this. Otherwise I have no idea how you can compare scores from various maps and even consider strength of opponents as this should also reflect in the score...

Edited: 2019-05-02, 12:57

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-05-02, 12:58

hessenfarmer wrote:

With these bugs fixed the AI performance might increase a good step. Branch will follow over the weekend.

My humble experience says that even great improvements in AI code lead to negligible improvements in AI actual play.... face-smile.png

But it is great that you are spending your time on this...


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-05-02, 13:21

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? Which map? could you provide me a replay / savegame?

  • AI currently does not build second carrier recruitment (not completely confirmed but higky probable, same fix as for buildings output but with worker output instead).

Yes. Only exception might be Frisians, because of the multiple purpose of reindeer farms.

Yes. and this makes this critical as frisans are favoured in this case However I hope to make the AI produce that much that it really needs second carrier.

With these bugs fixed the AI performance might increase a good step. Branch will follow over the weekend.

Sounds good.

let's see how this turns out before starting to celebrate


Top Quote