Anyone got an opinion on the simple fix?:
Currently AI doesn't consider building things if they might also benefit anyone else (even if only allies). Fix would be for AI to blindly consider their benefits like other buildings, and ignore the strategic implications of benefiting other players.

aicity.c:base_want() invokes city_range_iterate() ("Iterate over cities within a certain range around a given city (city_here) that exist within a given city list") to get votes from each city about the usefulness of a building.

This takes account of REQ_RANGE_LOCAL/CITY/CONTINENT/PLAYER, but will never fire for ALLIANCE or WORLD, so I don't think any buildings which have (city-benefiting) effects with these ranges will be considered. (I don't know if empire-benefiting or strategic effects are considered elsewhere.)

It would be easy to add these to city_range_iterate(). However, these buildings potentially have a negative impact since they benefit other players, so perhaps the AI needs to somehow evaluate the impact of building things which benefit other players. Don't know if this is important enough to not apply the simple fix in the meantime.

(For buildings with effects at multiple ranges, only the "widest" range is considered, so a building which had one effect on the local player and a different effect worldwide would fall in this category.)

Copyright (C) 2004-2006, the Gna! people. Posted items are owned by whoever posted them.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.