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 - stop building knight huts when nearly out of knights #59

Closed tlongstretch closed 3 years ago

tlongstretch commented 3 years ago

At some point need to add some emergency fallback like burning the least important knight huts, or stopping once iron and coal are found in borders and knights are < medium level

tlongstretch commented 3 years ago

done

// don't expand borders if running out of knights AND already have all 3 mine types unsigned int idle_knights = serfs_idle[Serf::TypeKnight0] + serfs_idle[Serf::TypeKnight1] + serfs_idle[Serf::TypeKnight2] + serfs_idle[Serf::TypeKnight3] + serfs_idle[Serf::TypeKnight4]; if (idle_knights <= knights_min) { AILogDebug["util_expand_borders"] << name << " running low on idle_knights, checking to see if already have all three mine types"; if (realm_building_count[Building::TypeCoalMine] > 0 && realm_building_count[Building::TypeIronMine] > 0 && realm_building_count[Building::TypeGoldMine] > 0){ AILogDebug["util_expand_borders"] << name << " running low on idle_knights and have at least one of each mine type, not expanding borders"; return stopbuilding_pos; } }