Latest Posts

Topic: AI not building mines?

Tibor
Joined: 2009-03-23, 23:24
Posts: 1376
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-04, 22:14

Hi,

After long time I tried the game again, and it seems to me that AI does not build mines. Do you see the same, or I did messed up something?


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1376
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-05, 10:21

It seems that there is some discrepancy between world resource name and what is listed in AI hints for mines as a resource


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1376
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-05, 10:35

So I figured it out.

E.g. Iron mines has "iron" in ai_hints, I tried to put there "iron_ore", did not work, and then after deeper reading the init.lua I found that it is "resource_iron".

And this works

I am going to prepare new branch with this and some cosmetic changes in the code and some training. But will take some days - week or two.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2184
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-12-05, 12:01

may I ask which version you are playing. latest official release was version 1.0. There had been major changes to detect the resource from production programs so an iron mine has no specific hints anymore.

Edit: I found the commit https://github.com/widelands/widelands/pull/4489

Edited: 2021-12-05, 12:04

Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1376
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-05, 16:34

Ou, let clear this... I have master branch. Current. Is it wrong? I did some changes to the code locally, so if the branch is wrong I would be sad. But let me know before I proceed. And it is a problem of all mines, I see there "mines" entry in ai_hints.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2184
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-12-05, 18:08

in master the mines don't have an aihint "mines" anymore.
so you might have an old datastore probably.
see here for an example of current mine init.lua https://github.com/widelands/widelands/blob/master/data/tribes/buildings/productionsites/barbarians/ironmine/init.lua


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1376
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2021-12-06, 15:10

OK, so no problem here face-smile.png


Top Quote