the3dfxdude / 7kaa

Seven Kingdoms: Ancient Adversaries - Go to the main source repository at https://sourceforge.net/projects/skfans/ for source code and builds
https://7kfans.com
Other
253 stars 71 forks source link

AI builds unusable harbor in a small pond #265

Closed BileDemon closed 1 year ago

BileDemon commented 1 year ago

Again, I don't know if this is present in the original game or if this is a specific map generation problem:

In my game the AI managed to build a harbor in a small pond that doesn't seem to have a connection to the ocean. This also seemed to prevent the AI to actually build a usable harbor directed towards the ocean.

Either the AI should be prevented from using very small lakes for seafaring or the map generation has a problem where it doesn't make it clear whether there's a (visible) open connection to the ocean.

7kaa2

the3dfxdude commented 1 year ago

If you have the seed number & land mass (unlikely to get from a save file right now though) or the autosave that triggers it, send it over. As far as AI is concerned, it might be possible to prevent this one. As far as building there, I think that it is harmless.

BileDemon commented 1 year ago

The seed number is 18071984204 and the land mass is medium.

the3dfxdude commented 1 year ago

So I've been looking over the code. It doesn't look like the AI even considers that pond at all. It's more likely that the AI wants to build towards the large body of water, and it selected a spot that looks like a beach tile for the large body and happens to share with a beach to the small body, but because of build rules, it can only be a harbor for the small body. It's going to be really tricky to stop this one. The map is also a good test case for the AI and sea.

the3dfxdude commented 1 year ago

Well soon after I updated, I figured it out. It's basically a 1 in a million chance of this happening, because I couldn't quickly trigger it in random test runs. Since I got more interested in the ai behavior, I might as well close on this now.

Fixed by dd3a7f229a00d140086ab00bd8ac9c6be511109d

BileDemon commented 1 year ago

This is good news. Thanks for fixing this.

I already suspected that the cause may have been a strange tiling constellation, but I couldn't be sure. There is also another spot on the same map which is right in the center, that looks perfectly like a land bridge where units could cross to the other side of the map. But they can't go over there. Instead ships sail directly over the land tile, which looks really goofy. It seems it's not so clear which tiles are actually water and which ones are land mass.

the3dfxdude commented 1 year ago

Yes it happens to be an interesting map for testing the ai on. I will be using it to try to improve on things I saw in testing.