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 - gold miner food should be deprioritized below iron? #9

Closed tlongstretch closed 3 years ago

tlongstretch commented 3 years ago

When inspecting a long running AI game, the player had tons of refined gold but had long run out of knights, halting expansion. Food was being sent to gold mines, gold mines had a slightly higher priority than iron mines. AI was out of iron, and mostly out of coal. It looks like food priorities may not work the way I assumed.

Probably need to make iron and goal higher priority than gold unless already have sufficient supply, because having knights is more important than morale (right?)

tlongstretch commented 3 years ago

added potential fix

// avoid issue where all food goes to gold mining while running out of knights
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) {
    // set gold food prio to less than coal or iron would be if needed
    player->set_food_goldmine(25000);
}

image

tlongstretch commented 3 years ago

closing for now