Andrettin / Wyrmsun

Strategy game based on history, mythology and fiction
http://andrettin.github.io/
GNU General Public License v2.0
307 stars 48 forks source link

[5.3.4] Skirmish AI has trouble locating far ore mines #209

Open SenhorFlibble opened 2 years ago

SenhorFlibble commented 2 years ago

I noticed that the skirmish AI player does not build and use a mine on the North-South Conflict map, which was imported from Wargus and, like some other Wargus maps, puts the players' start locations far away from the gold mines. screen01

The AI apparently runs out of copper and does nothing else except harvesting wood and stone.

In Wargus, the AI has no problem on this map or on Blick nach Oben, which also has the player search for the mine before building up.

Andrettin commented 2 years ago

Thank you for the info :)

Stratagus does not take exploration into account for AI harvest AFAIK (at least that was the case when I forked it, that was something I had to add in Wyrmgus), that's probably why the bug doesn't occur with it.

The best solution in this case would probably be to make the AI use a worker for scouting. Currently it only uses non-workers for that, and it is probably running out of copper before training their first soldier.

I tested this issue here thrice. The first two times, the AI did eventually build a copper mine both times, but only because it had recruited heroes who did the scouting. The third time, it happened to recruit three worker heroes (runesmiths), so that it never did any scouting (maybe that's what happened with you as well). That, among other reasons, means that we shouldn't rely on the AI using heroes for scouting.

An additional thing which could be improved regarding scouting is that currently AI scouts just walk randomly. It would be better if they preferred unexplored areas to scout, which would make it faster for them to find the copper deposit in this case. This is something I want to look into; I previously had something like this implemented, but it turned out to be too inefficient performance-wise, but I have an idea now on how that could be solved.

SenhorFlibble commented 2 years ago

Stratagus does not take exploration into account for AI harvest AFAIK (at least that was the case when I forked it, that was something I had to add in Wyrmgus), that's probably why the bug doesn't occur with it.

Ah, you mean the AI plays "fair" and does not have advance knowledge of the map without scouting? Nice.