yairm210 / Unciv

Open-source Android/Desktop remake of Civ V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unit automation uses defunct `UnitActionType.StartGoldenAge`

SomeTroglodyte opened this issue · comments

Game Version

current master from source

Describe the bug

This line - the actual UnitActionType used for starting golden ages is now TriggerUnique for the OneTimeEnterGoldenAgeTurns UniqueType.

Actually, all three objects named StartGoldenAge are dead - UnitAction, KeyboardBinding and UniqueType - and have no implementation.

Steps to Reproduce

Read source and use Ctrl-Shift-F and Alt-F7 extensively?

I have no idea hot to coax the AI to run into that line - but it's definitely not clean.

Additional Information

Replacing that if with

            if (!improvementCanBePlacedEventually) {
                val unique = unit.getMatchingUniques(UniqueType.OneTimeEnterGoldenAgeTurns).firstOrNull()
                if (unique != null) UniqueTriggerActivation.triggerUnique(unique, unit)
            }

is obviously bull - that's a fallback within specialized UniqueType.ConstructImprovementInstantly AI code. But civilian AI has absolutely nothing elsewhere I can find for the ubiquitous starting golden ages capability of those Great People... sounds like this should be included in some higher-level AI overhaul. @tuvus - specialist to the rescue?? Consider - why is there no fuzzy logic for automateCivilianUnit that compares estimated values? It's all if I can do - done - return. Sounds less than optimally clever.

The unique is already deprecated
Agree that the unit action should be killed since it should have 0 use

19be963

Still leaves the question open how the AI now is supposed to ever use a GP to start a GA. Let's think about that... A little... While not otherwise distracted...