yairm210 / Unciv

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

Game crashes when "unable to place unit" #12437

Closed junefish closed 3 days ago

junefish commented 2 weeks ago

Is there an existing issue for this?

Game Version

4.14.3

Describe the bug

Unciv crashes with error message

**Platform:** Android
**Version:** 4.14.3 (Build 1,066)
**Rulesets:** [Policy mod, Civ V - Vanilla, Latin American_Civs, Ancient Civilizations, Brave New World, Civ V - Gods & Kings, Medieval Civilizations, Better ruins]
**Last Screen:** com.unciv.ui.screens.worldscreen.WorldScreen
--------------------------------
Device Model: A063
API Level: 34
System Memory: 7258 MB
    Available (used by Kernel): 1247 MB
    System Low Memory state: false
    Java heap limit: 512 MB
    Java heap free: 75 MB
--------------------------------
**Message:**
java.lang.Exception: Unit Worker of Celts at Tile @(36.0,9.0), Tundra, Great Archaeologist - Celts can't be put in tile Tile @(36.0,9.0), Tundra, Great Archaeologist - Celts!
    at com.unciv.logic.map.mapunit.MapUnit.putInTile(MapUnit.kt:892)
    at com.unciv.logic.map.mapunit.movement.UnitMovement.swapMoveToTile(UnitMovement.kt:566)
    at com.unciv.logic.automation.unit.WorkerAutomation.automateWorkerAction(WorkerAutomation.kt:90)
    at com.unciv.logic.automation.unit.WorkerAutomation.automateWorkerAction$default(WorkerAutomation.kt:74)
    at com.unciv.logic.automation.unit.CivilianUnitAutomation.automateCivilianUnit(CivilianUnitAutomation.kt:38)
    at com.unciv.logic.automation.unit.UnitAutomation.automateUnitMoves(UnitAutomation.kt:176)
    at com.unciv.logic.automation.civilization.NextTurnAutomation.automateUnits(NextTurnAutomation.kt:429)
    at com.unciv.logic.automation.civilization.NextTurnAutomation.automateCivMoves(NextTurnAutomation.kt:78)
    at com.unciv.logic.automation.civilization.NextTurnAutomation.automateCivMoves$default(NextTurnAutomation.kt:38)
    at com.unciv.logic.civilization.managers.TurnManager.automateTurn(TurnManager.kt:344)
    at com.unciv.logic.GameInfo.nextTurn(GameInfo.kt:395)
    at com.unciv.ui.screens.worldscreen.WorldScreen$nextTurn$1.invokeSuspend(WorldScreen.kt:585)
    at com.unciv.ui.screens.worldscreen.WorldScreen$nextTurn$1.invoke(Unknown Source:8)
    at com.unciv.ui.screens.worldscreen.WorldScreen$nextTurn$1.invoke(Unknown Source:4)
    at com.unciv.utils.ConcurrencyKt$launchCrashHandling$1.invokeSuspend(Concurrency.kt:89)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at com.unciv.utils.Dispatchers$CrashHandlingDispatcher$dispatch$1.invoke(Concurrency.kt:190)
    at com.unciv.utils.Dispatchers$CrashHandlingDispatcher$dispatch$1.invoke(Concurrency.kt:190)
    at com.unciv.ui.crashhandling.CrashHandlingExtensionsKt$wrapCrashHandling$1.invoke(CrashHandlingExtensions.kt:17)
    at com.unciv.ui.crashhandling.CrashHandlingExtensionsKt$wrapCrashHandlingUnit$1.invoke(CrashHandlingExtensions.kt:33)
    at com.unciv.ui.crashhandling.CrashHandlingExtensionsKt$wrapCrashHandlingUnit$1.invoke(CrashHandlingExtensions.kt:33)
    at com.unciv.utils.Dispatchers$CrashHandlingDispatcher.dispatch$lambda$0(Concurrency.kt:190)
    at com.unciv.utils.Dispatchers$CrashHandlingDispatcher.$r8$lambda$L3K1aau81hhVdGYYei_E7yWI2wU(Unknown Source:0)
    at com.unciv.utils.Dispatchers$CrashHandlingDispatcher$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at java.lang.Thread.run(Thread.java:1012)

**Save Mods:**
[Civ V - Gods & Kings, Ancient Civilizations, Better ruins, Brave New World, Medieval Civilizations, Policy mod]

Steps to Reproduce

Click "Next Turn" on turn 351

Screenshots

No response

Link to save file

https://hastebin.skyra.pw/owadiwulos.bash

Operating System

Android

Additional Information

I've tried loading an autosave from a few turns earlier multiple times, to have time to deliberately clear units away from all Tundra tiles near city centers, but it always happens on turn 351.

itanasi commented 6 days ago

Also getting this crash recently in consoleLauncher sims. Don't have a relevant save

Exception in thread "main" java.lang.Exception: Unit Fighter of Korea2 at Tile @(-1.0,6.0), Daegu, Plains, Wine, City center, Great General - Korea2, Carrier - Korea2 can't be put in tile Tile @(2.0,9.0), Grassland, Road, Farm, Worker - Korea2, Artillery - Korea2! at com.unciv.logic.map.mapunit.MapUnit.putInTile(MapUnit.kt:899) at com.unciv.logic.map.mapunit.movement.UnitMovement.swapMoveToTile(UnitMovement.kt:568) at com.unciv.logic.automation.unit.WorkerAutomation.automateWorkerAction(WorkerAutomation.kt:91) at com.unciv.logic.automation.unit.WorkerAutomation.automateWorkerAction$default(WorkerAutomation.kt:75) at com.unciv.logic.automation.unit.CivilianUnitAutomation.automateCivilianUnit(CivilianUnitAutomation.kt:38) at com.unciv.logic.automation.unit.UnitAutomation.automateUnitMoves(UnitAutomation.kt:176) at com.unciv.logic.automation.civilization.NextTurnAutomation.automateUnits(NextTurnAutomation.kt:429) at com.unciv.logic.automation.civilization.NextTurnAutomation.automateCivMoves(NextTurnAutomation.kt:78) at com.unciv.logic.automation.civilization.NextTurnAutomation.automateCivMoves$default(NextTurnAutomation.kt:38) at com.unciv.logic.civilization.managers.TurnManager.automateTurn(TurnManager.kt:344) at com.unciv.logic.GameInfo.nextTurn(GameInfo.kt:395) at com.unciv.logic.GameInfo.nextTurn$default(GameInfo.kt:341) at com.unciv.logic.simulation.Simulation$start$1$5.invokeSuspend(Simulation.kt:60) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(Builders.kt:69) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(Builders.kt:48) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at com.unciv.logic.simulation.Simulation.start(Simulation.kt:48) at com.unciv.app.desktop.ConsoleLauncher.runSimulation(ConsoleLauncher.kt:63) at com.unciv.app.desktop.ConsoleLauncher.main(ConsoleLauncher.kt:41)

yairm210 commented 6 days ago

We wuz too late :( Savefile is gone, should have put it here once I couldn't immediately find the problem... I'll learn for next time the only safe place is github...

junefish commented 3 days ago

Thank you!