Latest Posts

Topic: Ai on the offensive should be more reluctant to burn military buildings

PkK

Topic Opener
Joined: 2012-01-06, 11:19
Posts: 236
Ranking
Widelands-Forum-Junkie
Posted at: 2015-02-22, 23:27

I often see the AI destroy military buildings that have no road connection to the rest of its territory. Sometimes doing so makes sense (e.g. AI on the defensive, can gain a few soldiers for defense, denies a building that will probably be lost to the enemy). But often this happens: AI A conquers military building a from player (human or AI) D. D has another nearby bulding b, so A cannot connect a toits road network. A burn down a. A conquers b. A builds new military building as a base for further attack. This keeps repeating. Essentially, A is slowed down by burning down half of all conquered buildings, and then, soon after, building new buildings nearby.

Philipp


Top Quote
Tibor

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

Hi,

what version/revision are you using?

In 7414 there was merged another portion of changes to AI. Current policy in this regard is that if it is unconnected and attended military building, it waits 20 minutes before it is dismantled.


Top Quote
PkK

Topic Opener
Joined: 2012-01-06, 11:19
Posts: 236
Ranking
Widelands-Forum-Junkie
Posted at: 2015-02-24, 12:54

I used revision 7412.

Philipp


Top Quote
fk
Avatar
Joined: 2013-07-30, 21:58
Posts: 151
Ranking
At home in WL-forums
Posted at: 2015-02-24, 19:03

The AI only attacks other AI's (I have version 7421), but perhaps this part is under development.


Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 00:54
Posts: 351
Ranking
Tribe Member
Posted at: 2015-02-24, 19:40

I actually posted a thread and a bug report on this problem.
Thread: https://wl.widelands.org/forum/topic/1583/
Bug report: https://bugs.launchpad.net/widelands/+bug/1395521

According to Tibor, it was fixed in 7414, but the AI is still willing to eventually burn down unconnected buildings (which is certainly possible 9if the war goes slowly or even turns against them). Sometime, we should test how likely (based on distance) the so0ldiers are to reach a friendly economy and use that to determine if razing is acceptably; if there's only a 20% chance, then I would only consider razing it in a dire emergency where that building's location is irrelevant and I really need troops elsewhere. But there are better players here, and I'm sure they can give better criteria than I can.


Top Quote
Tibor

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

fk wrote:

The AI only attacks other AI's (I have version 7421), but perhaps this part is under development.

This should not be this way. AI player attacks only players that are not too much stronger then himself.

For aggressive player, the enemy must be weaker less then 1.2 fold (enemies_soldiers/players_soldiers < 1.2). So I would say this is the case. Is it?

If not, I would need to look at it. Perhaps on a replay game.

But there is another aspect that is not considered yet - teams. AI now does not consider who is in what team and how powerfull allies are. This could make differences if a human player plays agains all AI players teamed up in one team.


Top Quote
Tibor

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

DragonAtma wrote:

According to Tibor, it was fixed in 7414, but the AI is still willing to eventually burn down unconnected buildings....

I tested also no burning down at all, but this has negative consequences, AI tries to place new buildings nearby unconnected military and fails to connect them to read network with warehouse. So it wastes a time. Or on some maps (maze f.e.) it can stops the expansion altogether because of the above reason. So I am stongly for a timeout.

I believe and presume that in 20 minutes most of such buildings are either connected or destroyed by enemy. Of couse we can manipulate the timeout.

EDIT:

where that building's location is irrelevant

Things like this are very hard for AI to consider. It can test if there are mines fields nearby, or similar things, but make a strategic decision is hard to do.

Edited: 2015-02-24, 21:04

Top Quote
fk
Avatar
Joined: 2013-07-30, 21:58
Posts: 151
Ranking
At home in WL-forums
Posted at: 2015-02-25, 08:20

For aggressive player, the enemy must be weaker less then 1.2 fold

The AI should attack whenever it would lead to an advance. If the AI is weaker but able to destroy a stronger player's mines, or able to kill more soldiers than it will lose, it should attack. It's goal is to become the 1.2/1, not to stay the 1/1.2.


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 17:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-02-25, 16:58

maybe the ai should differentiate whether it cannot cconnect the building because it is blocked by enemy land (in which case it will try to attack the enemy) or if it is blocked by unpassable terrain, in which case it won't try to make the buildings.


Top Quote
Tibor

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

fk wrote:

If the AI is weaker but able to destroy a stronger player's mines

Yes, I can imagine that AI scans for minespots in vicinity of enemy's militarysite and prefer such site as an attack target. It would be even not CPU intensive as mountains are completely static. Of course, a step forward would be to test how many resources are left in the mountains, but it would be obvious cheat.

or able to kill more soldiers than it will lose

Thats a question - how do you mean it? AI know how many soldiers it can send to attack, but get informations about enemies is not that simple especially if it should not be a cheating..


Top Quote