Topic: News about AI
hessenfarmer |
Posted at: 2017-08-19, 18:31
What exactly are helper productionsites? How are they identified? I would be very pleased if you could explain this. Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-19, 18:51
You can use any other word for these sites, but generally there are such that do not produce anything but supports other productionsites produce something, like ranger -> cutter -> log. They have own codepath in AI code, own scoring and so on
The issue here is score. AI was considering helpersites, but they got consistently too low score and other building won over them. This is what I am going to change in new branch.
I am also for as short list of basic buildings as possible - but lists were discussed here on forum and I dont intend to interfere here....
There is function review_wares_targets() for this, and has been there for long time... maybe it needs a revision....
One of purposes of multiple warehouses is shortening transportation routes and provide some security for situation than one of warehouses is destroyed.. Top Quote |
GunChleoc |
Posted at: 2017-08-20, 11:28
I just approved the helper sites branch, so it should hit trunk soon. I have just had another idea for the helper sites: Have an ai_hint for sites to define their helper sites. For example, Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-20, 18:08
No, no new hint is needed, AI is able to pair supporters and producers right now and is doing it. When placing supporters (helpers), part of score is affected by nearby producers like here: http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/ai/defaultai.cc#L2593 http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/ai/defaultai.cc#L2623 similarly when placing producers, the score reflects also supporters, like here: http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/ai/defaultai.cc#L2535 http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/ai/defaultai.cc#L2554 Of course the binding is not strict, because that would bring more issues then benefit. Top Quote |
Nordfriese |
Posted at: 2017-08-20, 18:26
In the training rounds with frisian AIs, I noticed two issues with helper sites:
Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-20, 19:55
I am not familiar with frisian buildings and relations, but generally:
Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-20, 21:18
I can imagine new ai_hint flag like:
that would build a productionsite only if there is at least one helper in vicinity... this could be quite easy and unobtrusive. In regard to clay - is this new map resource like stone or water? AI then need some code to count it in vicinity of buildable fields and particular building would need hint similar like quarries have.... Top Quote |
GunChleoc |
Posted at: 2017-08-21, 10:49
The scoring is working and will be trained, it's just the positioning that I noticed. Rather than waiting with a productionsite until the helper is finished, I'd say try to find a spot for 1 helper in the vicinity at the same time as the production site is placed, and place it immediately. If you build the helper first, you might have trouble building a lumberjack if the gamekeeper already has spammed a lot of trees, for example. The productionsite needs to know which helper belongs to it for this to work - if it already knows, no AI hint is needed. If it doesn't, the AI hint might as well contain the name of the helper building. Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-21, 11:32
But placing buildings in pairs is not implemented and would need quite a lot of coding... Right now a productionsite looks for resources (fish, trees, animals) and helper sites in vicinity are only additional bonus (= not required). If you place a lone ranger, over time there will be a lot of trees and lumberjack will be built in the vicinity. Animals migrate. Fish are bit different of course, but only one tribe has fish breeder. As I said, when considering new productionsite, the count of adjacent helper sites (helping exactly the particular productionsite) is known, and when placing a helper site, count of adjacent supported sites (supported by this helper site) is known as well.So linkage exists... Top Quote |
Nordfriese |
Posted at: 2017-08-21, 14:24
The AI will never be able to understand the pairing of frisian clay pits and aqua farms without a new hint. The clay pit digs up earth, mixes it with water and produces clay, which is processed into bricks, the most important building material. Earth is everywhere, so it´s not a resource – the clay burner walks to a free spot, digs and leaves behind an immovable pond_dry. The aqua farm fisher consumes water+fruit, then walks to a pond_dry and turns it into a pond_growing, which will become a pond_mature which can be used for fishing by the aqua farm (but not the normal fisher´s house). The clay pit´s presence is necessary for the aqua farm to work, as only the clay pit produces this immovable. So the aqua farm needs to have a hint like supporter=frisians_claypit. The bee-keeper is a more difficult case; his supporter building can be one of these (or any combination of): berry farm, reed farm, farm. Perhaps permit supporter to be a table (supporter={frisians_farm, frisians_berry_farm, frisians_reed_farm})? Top Quote |