Latest Posts

Topic: News about AI

WorldSavior
Avatar
Joined: 2016-10-15, 03:10
Posts: 2094
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-05-30, 00:35

Nordfriese wrote:

@WorldSaviour: I changed my preparations according to your new lists.

Thanks for testing this lists face-smile.png


Wanted to save the world, then I got widetracked

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1954
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-05-30, 12:19

I´m happy to help face-wink.png

I just remembered I didn´t even present my own list yet! Here it is:

  • N-BAR: wood hardener, fernery, lime kiln, smelting works, 2×metal workshop, well, tavern, hunter, gamekeeper, barracks

  • N-ATL: sawmill, smokery, mill, farm, blackroot farm, bakery, spiderfarm, weaving mill, well, fisher, fishbreeder, hunter, barracks

  • N-EMP: sawmill, stonemason, tavern, smelting works, vineyard, winery, hunter, fisher, well, farm, brewery, barracks

EDIT: Sorry, typo. I removed the bakery from the list for empire. They don´t get a mill or bakery.

As you can see, I did not add mines. But I added barracks. Why? I watched some first test games to get an idea about the new AI and I noticed that one of them never built barracks and was after some first victories defeated by the other player. That is why I think barracks are important. The same player never built many buildings because he couldn´t get a basic economy as there was no place for an iron mine (Two Barbarian players on a balanced map; Presets). This is why I am suggesting to give the AI a mining infrastructure but not the mines themselves as basic economy.

I do not have test results for this list yet, so I don´t know whether this is a good idea or reduces performance.

Some side notes: AI seems stronger than in current trunk and doesn´t make as many really stupid mistakes. It still looks strange, though – for example when it builds 7 wood hardeners in the first half-hour and almost immediately dismantles 4 of them because it can´t supply them all. Or when it builds lots of training sites and sets their capacity to 0.

I also noticed that the AI knows exactly what resources can be found on which mountain without sending geologists. Does it cheat?

Edited: 2017-05-30, 13:07

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-05-30, 15:17

AI was never using geologists. It would be more complex to code than just query the content of ground. So yes, it is cheating here.

What can be considered - cancellation of "basic economy" stuff, after a fixed time or when enemy is spotted. In fact the timeout is already there 2 hours....

7 hardeners - this is really weird especially if it is during basic economy stage - must be a bug... (please confirm if this was during basic economy face-smile-big.png


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1954
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-05-30, 16:16

Yes – this is what the AI plays like on Crater map...

I´m more worried about performance on my current test map. It is a very simple, symmetrical map with some rocks and trees near the starting point and fertile ground. The AI builds up (more or less) a basic economy and then gets deadlocked with no logs. It only starts building rangers when there are no trees left on the map and no logs in warehouses, so construction never finishes.

I will add 1 ranger/forester and 1 lumberjack/woodcutter to every tribe´s basic economy for every list. Perhaps this will solve this problem.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1954
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-05-30, 16:49

Another request: Could a message be printed out when the game ends, like GAME OVER? If this is implemented, then I will have an almost automatically running way of testing many games in a short time.

Until then, I will have to watch individual games, which is good for getting an overview about the AI´s abilities, but I don´t think such few games are really statistically significant.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-05-30, 17:09

That should probably go in this file:

https://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/wui/game_summary.cc

I'm on the wrong computer right now face-wink.png


Busy indexing nil values

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-05-30, 17:44

GunChleoc wrote:

That should probably go in this file:

https://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/wui/game_summary.cc

I'm on the wrong computer right now face-wink.png

Indeed, AI has no idea, when the game is over. Also, it think there are already some logs to terminal when that game over window pops up.


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-05-30, 17:51

Nordfriese wrote:

Yes – this is what the AI plays like on Crater map...

I´m more worried about performance on my current test map. It is a very simple, symmetrical map with some rocks and trees near the starting point and fertile ground. The AI builds up (more or less) a basic economy and then gets deadlocked with no logs. It only starts building rangers when there are no trees left on the map and no logs in warehouses, so construction never finishes.

I will add 1 ranger/forester and 1 lumberjack/woodcutter to every tribe´s basic economy for every list. Perhaps this will solve this problem.

One points that is quite important. Basic economy stuff is activated only when game is started and is not preserved over save/load. This is yet to be implemented. So when the AI is initialized (game is e.g. loaded) in gametime after 60-th second, no basic economy is started. And as there are no more forced_after and prohibited_till flags the AI might mismanage the beginning of the game... So for testing I recommend do not use loaded games (unless loaded in first 60 seconds, or after basic economy is achieved)


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-05-30, 17:52

Also, there were couple of revisions during last days, so be sure you are always using latest commit


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1954
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-05-30, 19:37

I was not aware of the save/load restrictions. I have made a Java program to help with testing, and it works by launching Widelands with the --loadgame=… option. The savegames have been specially prepared – I started a singleplayer game and saved it immediately (~2 seconds) after the HQ was added. The maps contain a small, remote island where the human player starts, so AI isn´t aware of him. When AI has defeated an enemy, it has access to a port space, which can be used to send an expedition to the island, build a port there and conquer the human player (who is supposed to do nothing at all, so AI can easily defeat him. I only added this port space so that Autocrat games are not endless). Does this short delay also affect the basic economy?

There is no message printed when the Game Over window shows – at least, I did not see any with the --verbose option. A message printed out would be helpful; at the moment, I can only use the workaround of declaring the game as ended when no more output appears for a certain time. (I am currently on version 8139 and will run an upgrade overnight.)

The no-logs-deadlock does not appear any more since I added lumberjacks and rangers to the basic economy.

I assume it is not possible to pass an option on the commandline that starts the --loadgame at game speed 30x, is there?


Top Quote