yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.49k stars 1.57k forks source link

AI confused about non-settling #12107

Closed hackedpassword closed 2 months ago

hackedpassword commented 2 months ago

Is there an existing issue for this?

Game Version

4.12.13

Describe the bug

Implemented "Impeded terrain", a unique label for making terrains unsettle-able. The AI doesn't know what to do about it, wants to settle on choice terrain, just sits there stuck.

Steps to Reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

Screenshots

Screenshot_20240811_133801

Link to save file

New impeded terrain.json.txt

Operating System

Android

Additional Information

Terrains.json:

"uniques": [
            "Impeded terrain",

Units.json:

        "name": "Settler",
            "Founds a new city <in tiles without [Impeded terrain]> <by consuming this unit>",
hackedpassword commented 2 months ago

Nice. Thanks @yairm210

If any modder in the future is looking for an example on how to block settlements, this technique will demonstrate.

hackedpassword commented 2 months ago

4.12.19 didn't resolve the issue. AI still is stuck not knowing they need to move off the tile.

hackedpassword commented 2 months ago

Suggestion @yairm210, this fix didn't have the expected result, in future issues like this rather than closing the issue, maybe the issue could be tagged 'validate fix' before closing?

btw thanks2trog explaining how I should super compress responses. :face_with_head_bandage:

yairm210 commented 2 months ago

I reloaded the save again, and nope, they're definitely not staying on the tile And they still are for you?? That's super weird, working from the same save we should have the same results

yairm210 commented 2 months ago

... You've completely screwed over the entire settler tile assessment by having all your tiles only provide actual values when within 3 tiles of a city center Which means the settlers look around and see all the tiles providing literally nothing, and so they say "nope can't settle here" so they wander around endlessly I'm not adding a provision for that, that's something you need to change in your mod, sorry.

hackedpassword commented 2 months ago

Hmm. K, I'll look into it more see how I can adapt. Based on your explanation of the settlers I have some thinking to do.

And there it hit me - I can retain the same resource strategy, while applying the same for the 1-distance tiles around the special NW's (towns and palaces), which should bait the AI settlers. It'll give those locations a little more character too. =)

Appreciate you having looked into this again!

hackedpassword commented 2 months ago

Tried my idea, didn't work. Next thing I tried was moving all the spawns off the NW tiles, settlers still holding on NW's. Then tried blocking all but one static food source for plains, AI on plains continues misbehaving. Finally and currently, stripped all 'within 3 tile' uniques, nothing changed.

Activated the haxhut, bought a bunch of units that can do anything, placed them at spawn locations to observe the happenings, turned on movement arrows. Some civs/CS's are moving along, some are also but have a stuck settler, some are just lost. Attached a demo save at a turn 1 rewind. The civ in the top left is totally defunct. Watched them bounce around 10 turns.

Doesn't make sense.

Settler test 1.json.txt

Spawn reference:

Details

![Screenshot_20240815_164752](https://github.com/user-attachments/assets/f72afa65-6e6c-44a1-8d64-66516de415f7) Top middle spawn was accidentally duplicated so 2 CS's appeared next to each other, ignore.