s25client icon indicating copy to clipboard operation
s25client copied to clipboard

AI improvement: unconnected buildingsites and buildings

Open RM87 opened this issue 5 years ago • 1 comments

Currently AIPlayerJH::CheckForUnconnectedBuildingSites does only check whether building is connected to road. Which means that these scenarios fail: Building is only connected to another building(s) or the road ends with flag. instead it should check whether a route to any warehouse exists.

With current AI behaviour all other buildings except inland military buildings should also be checked at least on border change (but are not jet checked). In case someone decides in the future that inland military buildings should remain connected to road network, it might be sensible to make a separate function for it and pass excluded buildings as a list?

RM87 avatar Jan 11 '21 22:01 RM87

To add on to this:

instead it should check whether a route to any warehouse exists.

I believe that as long as the own Headquarters exists, it should be checked whether a connection to the Headquarters exists. If that is not the case simply check for a connection to a warehouse (if one does exist).

In 4 out of 5 games that I've played with AIs during the past week the AI couldn't progress because of a missing road connection between the entire Headquarters road network and the most distant warehouse + military buildings near the borders (which were only connected between each other). These games were played on maps with only 1 or 2 paths forward to the enemies, the road connection issue occurred after losing military buildings and regaining them.

Promiskuitiv avatar Nov 22 '21 19:11 Promiskuitiv