freeorion icon indicating copy to clipboard operation
freeorion copied to clipboard

Require minimum colony source stability to build colony ships

Open MichaelCourtney opened this issue 2 years ago • 13 comments

Currently you can build colony ships without the stability to be a colonizing source.

@Grummel7 - does this need any AI changes?

MichaelCourtney avatar Dec 06 '22 12:12 MichaelCourtney

Is that about: https://www.freeorion.org/forum/viewtopic.php?p=115343#p115343

o01eg avatar Dec 06 '22 16:12 o01eg

Is that about: https://www.freeorion.org/forum/viewtopic.php?p=115343#p115343

yes

MichaelCourtney avatar Dec 06 '22 16:12 MichaelCourtney

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 ;-)

Grummel7 avatar Dec 31 '22 16:12 Grummel7

I'd it won't break AI, since it handles the failed orders. But it might cripple it in some cases.

Cjkjvfnby avatar Jan 01 '23 10:01 Cjkjvfnby

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 ?

geoffthemedio avatar Jan 01 '23 12:01 geoffthemedio

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.

Cjkjvfnby avatar Jan 01 '23 20:01 Cjkjvfnby

Leaving it till after release seems sensible. This "exploit" has always existed and hasn't broken the game yet.

MichaelCourtney avatar Jan 16 '23 02:01 MichaelCourtney

Any follow up for this?

geoffthemedio avatar Jun 24 '23 06:06 geoffthemedio

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.

MichaelCourtney avatar Jun 25 '23 03:06 MichaelCourtney

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.

MichaelCourtney avatar Jun 25 '23 09:06 MichaelCourtney

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

MichaelCourtney avatar Jun 25 '23 09:06 MichaelCourtney

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)

Blue-Award avatar Sep 27 '23 11:09 Blue-Award

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

Blue-Award avatar Sep 27 '23 11:09 Blue-Award