Latest Posts

Topic: News about AI

Tibor

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

As there was some comment about empire and marble, I did small comparison - trunk vs my branch, all players empire, 4 hours, and here are the results:

trunk:



AI branch:



Performance of AI in my branch is roughly the same or bit worse than in a current trunk, I will have to think about it :(

The uneven performance of AI players in my branch can be explained (at least partially) also by a random mutation when initializing those players...


Top Quote
Tibor

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

I figured out the mysterious issue with the buildings, I believed it was about gaining new buildings, but instead it was used when AI is scanning vicinity for enemy sites. AI needed to find out if the site is militarysite and tried to find it out via building observer. Now I get this info via building description.... So indeed it was my fault...


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-05-18, 19:48

Glad to hear that you found the problem face-grin.png


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-05-22, 22:46

Hi,

Last week I spend some time with new concept of "basic economy". This is something that should be an intelligent replacement for forced_after and prohibited_till flags.

The basic economy is set of building that particular tribe has to built and than it can develop as he wish. Small productionsites like quarries, lumberjacks, rangers are excluded from this. Also this approach is intended to prevent running out of some critical wares. The policy is that only one of "basic buildings" can be built (saws are exemption - 2 are allowed). Here are lists:



1: basic buildings:
48 / barbarians_wood_hardener
49 / barbarians_lime_kiln
50 / barbarians_reed_yard
51 / barbarians_bakery
53 / barbarians_micro_brewery
56 / barbarians_tavern
58 / barbarians_smelting_works
62 / barbarians_metal_workshop
65 / barbarians_farm
74 / barbarians_ironmine


2: basic buildings:
85 / empire_stonemasons_house
86 / empire_sawmill
88 / empire_bakery
90 / empire_vineyard
91 / empire_winery
93 / empire_tavern
100 / empire_farm
111 / empire_marblemine


3: basic buildings:
14 / atlanteans_fishers_house
20 / atlanteans_sawmill
21 / atlanteans_smokery
22 / atlanteans_mill
23 / atlanteans_bakery
32 / atlanteans_farm
34 / atlanteans_spiderfarm
35 / atlanteans_weaving_mill
36 / atlanteans_crystalmine

As usuall, all concepts have corner cases. E.g - what if particular mine is not in vicinity? What about upgrades? Should be there a max time after which the AI gaves up this concept?

On some maps, the basic economy can be achieved in 25 minutes. On some it takes 1.5 hour. So as I said, this is no silver bullet.

The building is set as basic in its lua conf file, with flag "is_basic".

So as usually, comments are welcomed. There are also some logs about this basic economy in terminal, if you run it from a command line


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

"Basic economy" sounds like a nice idea, but why do the lists look exactly like this? And maybe it would make sense to introduce different basic economies for different situations? (depending on win conditions and distances to other tribes for example)


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-05-23, 07:17

WorldSavior wrote:

"Basic economy" sounds like a nice idea, but why do the lists look exactly like this? And maybe it would make sense to introduce different basic economies for different situations? (depending on win conditions and distances to other tribes for example)

Of course, I dont insist that the lists are final. Everybody can test various lists, because no recompilation is needed, only editing of lua files.

As for two or even multiple lists - this again brings complexity, though I understand that the idea have some merits. We would need also some heuristics how to define what list to use. And somebody would need to compile and these lists...


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-05-23, 15:01

I would like to suggest the following changes, and this might be the very basic:

.

barbarians:

barbarians_wood_hardener

second wood hardener

49 / barbarians_lime_kiln

well

no reedyard

no bakery

no micro_brewery

56 / barbarians_tavern

58 / barbarians_smelting_works

62 / barbarians_metal_workshop

no farm

74 / barbarians_ironmine

coalmine

fisher or 2 hunters+ 2 gamekeepers

.

empire:

85 / empire_stonemasons_house

86 / empire_sawmill

no bakery

90 / empire_vineyard

second vineyard (extremely important!)

91 / empire_winery

93 / empire_tavern

no farm

111 / empire_marblemine

fisher or 2 hunters, or at the strange maps where it's not possible: 2 farms+1mill+1 bakery+1 well

.

atlanteans

no fishers_house

20 / atlanteans_sawmill

second sawmill

no smokery

no mill

no bakery

32 / atlanteans_farm

34 / atlanteans_spiderfarm

35 / atlanteans_weaving_mil

well

no crystalmine

.

some comments:

the atlantean crystalmine is rather one of the last buildings which is necessary face-wink.png The AI builds it too early in general.

maybe it would be better to include more small buildings in the lists? They are in most cases more important than bigger buildings.

and the marble economy would be a little bit weak if there is just one mine. Probably another mine would be needed - and in this case also a toolsmithy - or many stonecutters for support...


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-05-23, 17:00

@WorldSavior:

I see you reduced the lists a bit - this is good, the basic economy is intended to be as minimal as possible and be achieved as soon as possible.

Small huts are excluded from that limitations (cutters, rangers, quaries, fishers, quarries)

Also current code rules are "one building per type only" with hardcoded exemption for sawmill, but that can be changed, of course, though these buildings are really intended for "security" only to avoid material lock, ideally for first 20-40 minutes of game and then AI will follow own rules, so I would not make that very complicated....

Have you tested your suggestions with my branch? I will wait till you confirm me that your lists work good enough...


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-05-23, 18:04

Tibor wrote:

@WorldSavior:

I see you reduced the lists a bit - this is good, the basic economy is intended to be as minimal as possible and be achieved as soon as possible.

So maybe the lists should be even smaller? face-wink.png

Small huts are excluded from that limitations (cutters, rangers, quaries, fishers, quarries)

You already told that face-wink.png

But those buildings are often really "basic", and some of them are the most important ones face-wink.png

Also current code rules are "one building per type only" with hardcoded exemption for sawmill, but that can be changed, of course, though these buildings are really intended for "security" only to avoid material lock, ideally for first 20-40 minutes of game and then AI will follow own rules, so I would not make that very complicated....

Okay... But the current code rules seem to be very suboptimal face-wink.png

Have you tested your suggestions with my branch? I will wait till you confirm me that your lists work good enough...

No, of course not face-grin.png

But I think that some things are pretty obvious! For example that Atlanteans should not give high priorities for a crystal-mine-economy before they have build a good wood economy, a cloth-economy and a tool-economy. (Super rare exception: Maps without cuttable stone, of course)

Or that a lack of a second vineyard can slow down the Empire like hell (especially if it builds a farm, which is usually not really important but costs 2 marble columns)

Or that barbarians will suffer if they don't focus early on tools, or if they use only one wood hardener, or if they might forget hunters/fishers etc. face-wink.png


Wanted to save the world, then I got widetracked

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

But I think that some things are pretty obvious! For example that Atlanteans should not give high priorities for a crystal-mine-economy before they have build a good wood economy, a cloth-economy and a tool-economy. (Super rare exception: Maps without cuttable stone, of course)

Or that a lack of a second vineyard can slow down the Empire like hell (especially if it builds a farm, which is usually not really important but costs 2 marble columns)

Or that barbarians will suffer if they don't focus early on tools, or if they use only one wood hardener, or if they might forget hunters/fishers etc. face-wink.png

In my experience, barbarians don´t suffer from having just 1 wood hardener. I only ever build 1 of those in the beginning and my blackwood supply is steady enough (if I give highest priority to logs in the wood hardener). Also, I think the fernery is pretty important and should be added to their basic economy.


Top Quote