tlongstretch / freeserf-with-AI-plus

THIS PROJECT WAS MOVED TO 'Forkserf', GO THERE INSTEAD
https://github.com/forkserf/forkserf
GNU General Public License v3.0
1 stars 0 forks source link

AI logic - difficult to fix general issue with too-many-buildings-of-same-type due to nearest-inventory shifting #76

Open tlongstretch opened 3 years ago

tlongstretch commented 3 years ago

It seems that the remaining cause of "too many buildings of one type" is that as new buildings/flags/roads are created, the "nearest Inventory by flag distance" check results in changing "closest stock" of various buildings, triggering them to be built again.

I don't know of a good fix for this other than ensuring that the closest stock is by flag dist AND straight line dist... which might still be an okay idea...

tlongstretch commented 3 years ago

reworked find_nearest_inventory to support either, or flag-dist or straightline-dist, or both.

So far, testing using Both for placing new buildings, but FlagOnly for existing buildings. This should limit excessive new buildings without breaking existing functions