LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
285 stars 158 forks source link

No AI code to handle Complete Kills settlers #11080

Closed RecursiveVision closed 3 months ago

RecursiveVision commented 3 months ago

@ilteroi If an AI has a Settler and no cities with the Complete Kills game option enabled, they currently:

I don't know how to create a settle operation, and existing preconditions seem to require an escort as well (an exception would need to be made if the player has zero cities and no military units, only the Settler).

Would you be able to add code for this? It's a necessary prerequisite to implement this proposal: https://forums.civfanatics.com/threads/7-61-complete-the-complete-kills-functionality.689067/

RecursiveVision commented 3 months ago

If this code is removed in CvPlayer::setAlive()

        if (getNumCities() == 0)
            setFoundedFirstCity(false);

Then CvPlayer::isFoundedFirstCity() can be used to differentiate first turn settler moves from Complete Kills settler moves.

RecursiveVision commented 3 months ago

@KungCheops If ilteroi is unable, would you be interested?

OneFuriousDon commented 3 months ago

@RecursiveVision Sorry to budge in but if possible preferably in set min safe distance from oppressor and one extra move from "run for your lives promo".

RecursiveVision commented 3 months ago

That was not in the proposal.

ilteroi commented 3 months ago

not sure i get this - where would this settler spawn? what if there is no reachable spot for settling?

anyway i think it's not too hard. do the change mentioned above. and replace the city number check in IsTestStrategy_FoundCity() with a isFoundedFirstCity() check. should work.

RecursiveVision commented 3 months ago

I implemented the Settler spawn as follows:

RecursiveVision commented 3 months ago

@ilteroi Will it work if there's no escort available, or will the settler just be locked in place?

azum4roll commented 3 months ago

Units already automatically spawn embarked (if needed) when using IGE+, given the player has the tech for it.