Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI not aware of ruins? #3864

Closed
foolishgrunt opened this issue May 2, 2021 · 3 comments
Closed

AI not aware of ruins? #3864

foolishgrunt opened this issue May 2, 2021 · 3 comments
Labels

Comments

@foolishgrunt
Copy link

My apologies, I meant to report this months ago, but it slipped my mind again and again. Please close if this has been addressed in recent updates.

It seems to me that AI players are unaware of ancient ruins until after they have been discovered by a human player, almost as if the ruins are not generated until the human player explores their location - I assume this is not intentional behavior. I present evidence from three separate games.

Scenario 1: on AI home continent, ruins were still not explored when I discovered them on turn 165.
img1

Scenario 2: ruins inside city-state's borders were still not explored when I discovered them on turn 165. Then on the very next turn, the ruins are explored by a city-state unit.
img3
img4

Scenario 3: city-state unit is literally on top of ruins when I discover them.
img2

@SomeTroglodyte
Copy link
Collaborator

Superficial analysis:

  • MapUnit.getAncientRuinBonus() seems the only place ruins are cleared after turn 1 (on turn 1 any ruins within 3 tiles of any starting position are erased)
  • It is only called from moveThroughTile and only if civInfo.isMajorCiv()
  • UnitAutomation only looks for ruins in tryGoToRuinAndEncampment() where the code looks sound - if the function is called for a major AI civ's unit it will move and claim the bonus on arrival.
  • That function in turn is called in 3 places - automateUnitMoves, automatedExplore and tryExplore (the latter a little redundantly because its 4 callers are 2 for civilians and 2 where tryGoToRuinAndEncampment has already been called shortly before - OK so settlers can also 'pop' ruins...)
  • Within automateUnitMoves, for non-air military units, it's the first attempt.

All that looks very clean, no hole allowing your scenarios 'strikes the eye'.

So - scenario 1 india never decided to explore? scenario 2 the ruin wasn't taken by brussels? scenario 3 the warrior never moved there (nah should be excluded by that initial turn 3-tile radius)?

Or - are you playing with an outdated version??? Why do you have two instead of three minimap buttons???

@yairm210
Copy link
Owner

yairm210 commented May 2, 2021

None of this is a bug.
Two of three situations are "city state doesn't activate ruins", which is intentional.
The first one is just 'AI didn't get there with a unit' which is OK, that can happen.

@yairm210 yairm210 closed this as completed May 2, 2021
@foolishgrunt
Copy link
Author

I won't open a new issue, but I do want to mention that scenario 1 has kept happening to me.

All throughout my current game, I've been discovering ruins very close to AI territory and being surprised that they weren't already explored by the AI, but just now I discovered some ruins two spaces away from an AI unit. The next turn, the AI explored them. To my untrained eye, it seems really unlikely that the AI is aware of these ruins until after I discover them.

Screenshot_20211030-080807_UnCiv
Screenshot_20211030-081002_UnCiv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants