Important Dates

Latest Posts

Topic: "Northmen" Tribe Page

Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-13, 23:41

for the AI all buildings are just inputs, outputs, performance, count of such buildings, is/not basic building, is output needed, count of stocked inputs/outputs..... this info is pretty generic. Probably per tribe training would provide some benefits but I dont think that big. But I am not explicitly against this, but the amount of training would grow up...


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 10:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-08-15, 10:53

Does the AI cosider the work area of buildings when adding them? This can affect the productivity of a building, it is highlighted in ther Frisians as they have a number of small buildings that have large work areas that are only effictive if keep free, like the claypit and berry farm.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-15, 12:16

Indirectly, there is "space_consumer" flag in ai_hints section.....


Top Quote
Nordfriese
Avatar
Topic Opener
Joined: 2017-01-17, 18:07
Posts: 2041
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-08-15, 12:36

Tibor wrote:

Indirectly, there is "space_consumer" flag in ai_hints section.....

… but the AI doesn´t always seem to consider that. In training games, I often see a barbarian AI build a reed yard and surround it with roads, so the productivity stays at 0%.

Could you please provide a list with the flags the AI currently considers? Which flags are needed to make it understand the pairing of buildings such as berry_farm/collectors_house or clay_pit/aqua_farm? And can the AI understand buildings like the reindeer farm now (recruits workers and produces wares) so I can remove it from the basic economy?

On the frisians graphics development side, I finished drawing images for all the buildings now. No animations, workers, ships; the buildings still need some improvement. I tried and failed to make better images for flags and fences; I did make new road textures as well as images for ponds and wares. Graphically, I´ve done all I can for the frisians.

There was a remark about the wooden tower´s buildcost. This is difficult. It now has a buildcost of 5 logs and 1 reed. If it were more expensive, it would be nearly useless. Cheaper, it would be too good with its high vision range.

I am now working on finding better amounts for starting wares. When this has been improved, I think there is nothing left to do except some minor fine-tweaking.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-15, 13:25

Nordfriese wrote:

Tibor wrote:

Indirectly, there is "space_consumer" flag in ai_hints section.....

… but the AI doesn´t always seem to consider that. In training games, I often see a barbarian AI build a reed yard and surround it with roads, so the productivity stays at 0%.

Building of roads is stupid, AI picks only starting and end flags and let the inner algorithm connect them. And it does not consider space consumers here at all, f.e. because he does not know where the road will be placed. Space consumers are considered only when building new buildings and perhaps when dismantling buildings.

Could you please provide a list with the flags the AI currently considers?

Probably some housekeeping here would be needed. I can run grep through conf files and provide some list, but cannot do it now.

Which flags are needed to make it understand the pairing of buildings such as berry_farm/collectors_house or clay_pit/aqua_farm?

no flags. AI pairs "renews_map_resources" flag with outputs of a productionsite and a match constitutes pairing...

And can the AI understand buildings like the reindeer farm now (recruits workers and produces wares) so I can remove it from the basic economy?

No, the change in the code would be needed.


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

Tibor wrote:

for the AI all buildings are just inputs, outputs, performance, count of such buildings, is/not basic building, is output needed, count of stocked inputs/outputs..... this info is pretty generic. Probably per tribe training would provide some benefits but I dont think that big. But I am not explicitly against this, but the amount of training would grow up...

but the tribes still are completely different, with totally different wares. I can't believe there is only one AI for all of them. Even those wares that are equal in all tribes have very diifferent price and demands, like barbarian meat being dirt cheap and empire meat being expensive, or atlanteans needing lots of wood and frisians needing little of it. The algorithms may be the same, but the numbers have to be very different for all tribes.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-15, 16:55

king_of_nowhere wrote:

Tibor wrote:

for the AI all buildings are just inputs, outputs, performance, count of such buildings, is/not basic building, is output needed, count of stocked inputs/outputs..... this info is pretty generic. Probably per tribe training would provide some benefits but I dont think that big. But I am not explicitly against this, but the amount of training would grow up...

but the tribes still are completely different, with totally different wares. I can't believe there is only one AI for all of them. Even those wares that are equal in all tribes have very diifferent price and demands, like barbarian meat being dirt cheap and empire meat being expensive, or atlanteans needing lots of wood and frisians needing little of it. The algorithms may be the same, but the numbers have to be very different for all tribes.

At the end, everything is just numbers and similiar stuff:

  • preciousness in conf file
  • actual quantity in warehouses
  • target quantity
  • do we have producers (how many)
  • do we have consumers (how many)
  • is it critical building material?
  • are current producers able to produce more?
  • does production needs resources (renewable or not), space or other inputs
  • production of some wares is induced by basic buildings....

This is kind of information AI needs and should be able to proceess to make decisions.

What further inputs would you suggest?


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3317
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-15, 18:39

There is a list of flags (sort of) in this file:

http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/ai/ai_hints.cc

It's undocumented though.

Edited: 2017-08-16, 06:59

Busy indexing nil values

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2725
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2017-08-15, 21:19

Hi everybody, sorry for starting the discussion. I now have tested the Ai values from Nordfriese with empire and barbarians on crater against me playing babarians. Although there were slight differences the two tribes acted pretty much the same. So it may be related to my scenario map. As I am trying to understand the principle of Tibors work I think that the one AI fits all depend on the configuration of the tribes buildings. Perhaps after we established a pretty good AI we could tweak the values to make the tribes even more balanced regarding AI performance.
So I am not recommending tribe based training anymore. Although the Ai should be evenly trained with all tribes including frisians in their latest state. But unfortunately this won't solve the weak performance on my map within my scenario. I will test the map outside being a scenario if there will be a difference. If anyone could try the map with babarians in red space I would be thankful for the results.

@ Tibor: As my babrians had lots of building material in their HQ and were not building anything else than military buildings the amount of building material available could be a factor that will allow more constructionsites and a surplus of buildings than actuallyy needed to outproduce an opponent.
Another factor for good AI behaviour might be to increase the target amount of wares in the economy with time or an equivalent (number of warehouses, number of buildings whatever) if the same restrictions in the economy as for human player apply.
Third input that might be considered in combination with material available is the space (or building lots) available. As my weakly performing AI had plenty of space as well as they expanded very good but without enforcing the economy.

Just my five cents
regards
hessenfarmer


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-15, 21:52

@hessenfarmer

Did you take concept of basic economy into consideration? Perhaps some of basic buildings is still missing so building of other productionsites is prohibited (except for foresters or so...). There should be some hints in logs...


Top Quote