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 - expand_borders is taking too long #36

Closed tlongstretch closed 3 years ago

tlongstretch commented 3 years ago

this gets called a lot and takes a few seconds at least when realm gets large

tlongstretch commented 3 years ago

looks like this was not checking max_unifinished_huts before doing all its work, added a check at the beginning of the function

tlongstretch commented 3 years ago

still taking too long, I think because it is called over and over again by each main do_ function, but if it can't find a good place the first time it won't on subsequent times also, maybe make it only able to fail once per AI loop before giving up until next loop?

tlongstretch commented 3 years ago

done, added cannot_expand_borders_this_loop