Latest Posts

Topic: AI not building enough smelting works

PkK

Topic Opener
Joined: 2012-01-06, 11:19
Posts: 236
Ranking
Widelands-Forum-Junkie
Posted at: 2015-03-23, 13:54

I like playing on maps, where gold is further from the start location than iron. However, this seems to be a problem for the AI: The AI will build exactly 1 smelting works, which will operate at 65% (maximum when there is enough iron ore and coal). Even though the AI economy is starved for iron, and there is plenty of iron ore and coal, the AI will not build further smelting works. The AI will only start building more smelting works after it finds gold ore.

Philipp


Top Quote
einstein13
Avatar
Joined: 2013-07-28, 23:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-23, 14:29

Which version are you using? Build-18 or dev one?

There were major changes with AI since build-18.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
PkK

Topic Opener
Joined: 2012-01-06, 11:19
Posts: 236
Ranking
Widelands-Forum-Junkie
Posted at: 2015-03-23, 17:26

bzr from two days ago (btw. is there a bzr equivalent to svn info to tell me the exact revision?).

Philipp


Top Quote
Venatrix
Avatar
Joined: 2010-10-05, 19:31
Posts: 449
Ranking
Tribe Member
Location: Germany
Posted at: 2015-03-23, 18:32

bzr version-info


Two is the oddest prime.

Top Quote
PkK

Topic Opener
Joined: 2012-01-06, 11:19
Posts: 236
Ranking
Widelands-Forum-Junkie
Posted at: 2015-03-23, 18:49

For the version in which I observed the issue:

revno: 7431


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-03-23, 20:23

Hi,

this part of code could use some review, I agree...

Few considerations:
1. AI limits the number of constructionsites, so this might be an reason - too many unfinished sites
2. First building of a kind is forced, regardless of above, but second and next ones depends statistic of current buildings. And here can be a problem. Especially the fact that it produces multiple outputs and so far statistics provides only one agregate number (much lower then 100%) and it seems that there is still some available capacity... I will rethink it, but in next branch, not the one I am finishing now..


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-03-23, 21:51

I remember someone mentioning that AI will build another building of a kind only if they have more than 70% productivity, otherwise it is assumed the problem lies elsewhere. that's good for most situation, but metal smelter is one of those where it doesn't work.


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-03-23, 22:17

king_of_nowhere wrote:

I remember someone mentioning that AI will build another building of a kind only if they have more than 70% productivity, otherwise it is assumed the problem lies elsewhere. that's good for most situation, but metal smelter is one of those where it doesn't work.

It seems that production buildings are programmed the way that they are idle when particular output can not be produced, even though it might be producing another output instead. If it the really true, this is another complication for AI. I will have to look directly at productionsite's code to see if this can be worked around and how straightforward it could be.


Top Quote
PkK

Topic Opener
Joined: 2012-01-06, 11:19
Posts: 236
Ranking
Widelands-Forum-Junkie
Posted at: 2015-03-24, 13:25

Is there a good way to manually counteract this? I tried giving the AI three smelting works in the start condition, but the AI just dismantles two of them.

Philipp


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-03-24, 16:21

No

But I made some small change in the code that would mitigate the problem. But still testing and observation is needed to see how effective it was. But it is not in trunk yet.


Top Quote