freeorion
freeorion copied to clipboard
Require minimum colony source stability to build colony ships
Currently you can build colony ships without the stability to be a colonizing source.
@Grummel7 - does this need any AI changes?
Is that about: https://www.freeorion.org/forum/viewtopic.php?p=115343#p115343
Is that about: https://www.freeorion.org/forum/viewtopic.php?p=115343#p115343
yes
Currently you can build colony ships without the stability to be a colonizing source.
@Grummel7 - does this need any AI changes?
To be honest, I don't know, but the AI It isn't using colony ships much anyway, unless its playing Sly.
Another part that cries for some refactoring ;-)
I'd it won't break AI, since it handles the failed orders. But it might cripple it in some cases.
I'd it won't break AI, since it handles the failed orders. But it might cripple it in some cases.
so better to make this post v0.5 ?
Not merging to the release is always the safe option.
If it does not break sly and If we didn't start full testing of the release we can try.
Leaving it till after release seems sensible. This "exploit" has always existed and hasn't broken the game yet.
Any follow up for this?
Any follow up for this?
I'll go take a look and see if I can work out how the AI handles colonization for the Sly, and whether it's likely to be a problem. Apart from that it's good to go.
1st glance suggests Sly are handled by reducing the chance of building outpost ships. I'll have another look, but maybe not till I'm back from holidays.
I guess I'll look for how it picks where to build. Maybe it just needs a check to ensure the shipyard can actually build a colony ship
I guess I'll look for how it picks where to build. Maybe it just needs a check to ensure the shipyard can actually build a colony ship
Cf. What I wrote for https://github.com/freeorion/freeorion/pull/4750
AI is building a cache of buildable designs per planet, valuing the location condition. Ophi has moved CanColonize to be on the scripting side and it should work. Adding stability/happiness should work exactly the same
I haven't looked specifically how it optimizes the choice. Though some things seemed to be picked at random pretty much, once it decided "I need to Build X". But bottom line is, what to build where is taken based off above-mentioned design cache, so it won't pick up a combo it can't build.
That being said, I have not looked at how it makes the decision whether to undertake colonization... how is it informed by the choice of available source species and their (current) ability to build colonies or colonizers. Looking at how it decides where to build might be secondary, primary being how it decides colonization is a big enough priority to even attempt building outposters or colonizers in the first place. And whether ability to build one is accounted for before deciding to build one (if it can't build one then just next production priority would be picked, though, so perhaps there is no need to check feasibility of build before deciding on building it)
I mean, I suspect no changes are necessary. It will still give whatever importance it wants to colonization, and if it can't execute on that, then it will build something else instead.
Though it is interesting to know how exactly it picks up weight for the idea of "I need x colonies more"... but perhaps not substantial for this PR
Also obv. this is a change that will need merging with the CanColonize one, whatever gets first into the codebase