Latest Posts

Topic: ai doesn't make as many buildings as before

king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2016-04-21, 19:10

Something I noticed a while back, but assumed it must be an isolated case for a while; until a few months ago, when given a large land, ai would fill it out with buildings. Now, after a while it stops. most of its land remain empty, unused. It seems like there is some command "expand until you reach a target number of buildings, then stop". Obviously, it is better to have a bigger economy if possible. So what's happening?

Of course I0m not playing with a difficulty level where such limits are acctually implemented.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-04-21, 19:54

You are talking about productionsites, I presume. Well look at the issue from other end - can you identify productionsite that is needed, but not built?

Definitely, there is no hardlimit for productionsites, all should be decided by utilization of existing ones...

EDIT: Also AI behaves differently if it there is an enemy nearby - it is more willing to build new productionsties

Edited: 2016-04-21, 20:09

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-04-22, 08:54

I looked at target quantities because it seemed to me that there can be some relation, and I found a small bug or bad design.

If ware has no target quantities set in init.lua, f.e.:

default_target_quantity = {},

it is resolved to 254. F.e. water. It misleads the AI, should not it be set to 0? Or is it not meant that 'no default = 0'?

EDIT:

so it seems there is constant kInvalidWare = 254 and it is returned when ware is invalid for tribe as well as when default target is not set in init.lua ....

Edited: 2016-04-22, 09:25

Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2016-04-22, 09:26

Tibor wrote:

You are talking about productionsites, I presume. Well look at the issue from other end - can you identify productionsite that is needed, but not built?

Definitely, there is no hardlimit for productionsites, all should be decided by utilization of existing ones...

EDIT: Also AI behaves differently if it there is an enemy nearby - it is more willing to build new productionsties

well, you can never have enough economy. while the ai with enough space and time will manage to build a healty economy, a bigger economy would be better in any case.

EDIT: and I distinctly remember than it did use to fill all the space, like, 9 months ago. when I was playing "the big escape", around the time when I posted it, the ai always used up all its land.

Edited: 2016-04-22, 09:34

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-04-22, 09:34

king_of_nowhere wrote:

Tibor wrote:

You are talking about productionsites, I presume. Well look at the issue from other end - can you identify productionsite that is needed, but not built?

Definitely, there is no hardlimit for productionsites, all should be decided by utilization of existing ones...

EDIT: Also AI behaves differently if it there is an enemy nearby - it is more willing to build new productionsties

well, you can never have enough economy. while the ai with enough space and time will manage to build a healty economy, a bigger economy would be better in any case.

But generally AI has to pick whether to expanse or built an economy, because sources are limited. But I am aware that the algorithm controlling territory expansion vs economy expansion is not very good, I am willing to look at it but no before build19. Any such change needs time to be tested.

But for now I will look at that default targets issue, it seem to be "nondisruptive" change and low-hanging fruit.


Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2016-04-22, 09:37

Tibor wrote:

king_of_nowhere wrote:

Tibor wrote:

You are talking about productionsites, I presume. Well look at the issue from other end - can you identify productionsite that is needed, but not built?

Definitely, there is no hardlimit for productionsites, all should be decided by utilization of existing ones...

EDIT: Also AI behaves differently if it there is an enemy nearby - it is more willing to build new productionsties

well, you can never have enough economy. while the ai with enough space and time will manage to build a healty economy, a bigger economy would be better in any case.

But generally AI has to pick whether to expanse or built an economy, because sources are limited. But I am aware that the algorithm controlling territory expansion vs economy expansion is not very good, I am willing to look at it but no before build19. Any such change needs time to be tested.

But for now I will look at that default targets issue, it seem to be "nondisruptive" change and low-hanging fruit.

the ai already expanded on all the space it had.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-04-22, 09:39

king_of_nowhere wrote:

the ai already expanded on all the space it had.

Oh, ok then. It has no place to expand but still not building economy? Did it have a lot of unfinished buildings or shortage of some materials?


Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2016-04-22, 18:31

Tibor wrote:

king_of_nowhere wrote:

the ai already expanded on all the space it had.

Oh, ok then. It has no place to expand but still not building economy? Did it have a lot of unfinished buildings or shortage of some materials?

I can't say that for sure because i didn't set the game on "all explored". I previously played the same map and found the same behavior, but I just assumed it to be an isolated case at the time. But in this case, I can only see that the number of buildings of the AI reached a peak 6 hours ago, then it decreased; while land size kept growing up to 4 hours ago. My scouts can see several patches of unused terrain, and though the ai has many buildings (some 260) I know more could be made with that land. The previous time when I played the same map with all the map explored I could see clearly that the AI only used maybe one third of its terrain. That time it was playing barbarians, this time empire, so it's not strictly tribe-related.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2434
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2016-04-22, 19:27

Tibor wrote:

I looked at target quantities because it seemed to me that there can be some relation, and I found a small bug or bad design.

If ware has no target quantities set in init.lua, f.e.:

default_target_quantity = {},

it is resolved to 254. F.e. water. It misleads the AI, should not it be set to 0? Or is it not meant that 'no default = 0'?

EDIT:

so it seems there is constant kInvalidWare = 254 and it is returned when ware is invalid for tribe as well as when default target is not set in init.lua ....

This was introduced with bug: Buildings produce more than set in "configure economy". If we set "default_target_quantity" to zero, the icons in configure economy menu appears again...


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-04-22, 19:50

kaputtnik wrote:

Tibor wrote:

I looked at target quantities because it seemed to me that there can be some relation, and I found a small bug or bad design.

If ware has no target quantities set in init.lua, f.e.:

default_target_quantity = {},

it is resolved to 254. F.e. water. It misleads the AI, should not it be set to 0? Or is it not meant that 'no default = 0'?

EDIT:

so it seems there is constant kInvalidWare = 254 and it is returned when ware is invalid for tribe as well as when default target is not set in init.lua ....

This was introduced with bug: Buildings produce more than set in "configure economy". If we set "default_target_quantity" to zero, the icons in configure economy menu appears again...

I already have a workaround, I will test it a bit and propose for merging afterwards...

EDIT:

The workaround is that when value will be kInvalidWare, it will be set to 5, I mean internally, for AI only

Edited: 2016-04-22, 19:57

Top Quote