Unciv icon indicating copy to clipboard operation
Unciv copied to clipboard

Unable to purchase tile within city range

Open SpacedOutChicken opened this issue 1 year ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Game Version

4.10.6

Describe the bug

In a game of Smoky Skies Redux with Dreams of Steam enabled, there's one tile within city range which should be available for purchase but which isn't.

Steps to Reproduce

The tile to the lower left of Harar, next to Mogadishu, with the worker sitting on it, is within range of Harar and not owned by anyone, but when I open the city screen, I can't buy it.

Screenshots

Screenshot_20240205_121615_Unciv

Link to save file

purchase_tile.txt

Operating System

Android

Additional Information

No response

SpacedOutChicken avatar Feb 05 '24 19:02 SpacedOutChicken

I bet that's known and "normal". You can only buy tiles where this city owns neighbors, I'd expect those two neighbors belong to Toumbouctouououou.

SomeTroglodyte avatar Feb 06 '24 09:02 SomeTroglodyte

image

SomeTroglodyte avatar Feb 06 '24 10:02 SomeTroglodyte

I can't buy the tile through Tomboucto either, because it's out of that city's range.

SpacedOutChicken avatar Feb 06 '24 13:02 SpacedOutChicken

out of that city's range

Yup, that's how our current code works. Want it changed? Look up proof how Civ5 did it. (Anecdote: I believe long ago we had a button to transfer ownership between cities, but that was too exploitable)

Oh, an aside: Tile buying and Cultural expansion and Citadels - we're currently not at all like Civ5 here in several respects, and I've got a closer-to-original branch out there for a long time. Thing is, it's easy to change the progressions to be independent, but if we otherwise keep the formulas, it'll be far too cheap, and my analysis says out formulae are too cheap. So - fix the formulas to match Civ5. And there it gets complicated, as I can show a lot of the components in their DLL source, but one factor is a mystery to me - they call it "Influence cost" iirc, and it's got some correlation with path finding. One role - hills are more expensive apparently in Civ5 than flat tiles.... If you've got an original runnable, I'd really love some cost-progression statistics. I'd buy just to get some numbers - but there's no offline boxed media anymore, steam actively refuses to work on my setup, and gog only has up to Civ 4 - which I also own boxed...

SomeTroglodyte avatar Feb 06 '24 17:02 SomeTroglodyte

Buying tiles non-contiguously - bad, if an enemy takes the city you'll have floating tiles Moving tiles between cities - messes up all kinds of things Allowing cities to purchase outside 3 range when within 3 range of other city - possible, not sure I like it

yairm210 avatar Feb 07 '24 15:02 yairm210

floating tiles

I believe you can get those anyway, 'cuz I'm mostly certain cultural expansion does not have that limit. At least I've seen city-states with floating tiles.

And the do-able rule change (and I'm not saying I'm in favor) would be - "Allowing cities to purchase inside their 3-hex range when any neighbor is owned by your civ, not only this city"

SomeTroglodyte avatar Feb 07 '24 18:02 SomeTroglodyte

To clarify: In CityExpansionManager.canBuyTile:

Index: core/src/com/unciv/logic/city/managers/CityExpansionManager.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt b/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt
--- a/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt	(revision a9c367907d14ad8fcbe6160731b18bc40e9cdcfb)
+++ b/core/src/com/unciv/logic/city/managers/CityExpansionManager.kt	(date 1704275904190)
@@ -61,7 +61,7 @@
             tile.getOwner() != null -> false
             city.isInResistance() -> false
             tile !in city.tilesInRange -> false
-            else -> tile.neighbors.any { it.getCity() == city }
+            else -> tile.neighbors.any { it.getOwner() == city.civ }
         }
     }
 

... yum or meh? I'm ambivalent.

SomeTroglodyte avatar Feb 10 '24 12:02 SomeTroglodyte

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar May 11 '24 03:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar May 27 '24 03:05 github-actions[bot]