Thanks for your work. I find a mistake on the Rampaging Monsters turn.
[2022-05-25 00:14:02.697 INFO MultiplayerSessionThread] momime.server.process.PlayerMessageProcessingImpl:685 - Start phase for turn 141 - Rampaging Monsters...
[2022-05-25 00:14:02.780 INFO MultiplayerSessionThread] momime.server.process.PlayerMessageProcessingImpl:1306 - Continuing pending movements for Rampaging Monsters...
[2022-05-25 00:14:02.781 INFO MultiplayerSessionThread] momime.server.process.PlayerMessageProcessingImpl:925 - AI turn 141 - Rampaging Monsters...
Exception in thread "MultiplayerSessionThread" java.lang.ArithmeticException: / by zero
at momime.server.process.CombatStartAndEndImpl.combatEnded(CombatStartAndEndImpl.java:413)
at momime.server.process.CombatProcessingImpl.progressCombat(CombatProcessingImpl.java:770)
at momime.server.process.CombatStartAndEndImpl.startCombat(CombatStartAndEndImpl.java:309)
at momime.server.fogofwar.FogOfWarMidTurnMultiChangesImpl.moveUnitStack(FogOfWarMidTurnMultiChangesImpl.java:880)
at momime.server.ai.UnitAIImpl.decideAndExecuteUnitMovement(UnitAIImpl.java:912)
at momime.server.ai.MomAIImpl.aiPlayerTurn(MomAIImpl.java:233)
at momime.server.process.PlayerMessageProcessingImpl.switchToNextPlayer(PlayerMessageProcessingImpl.java:926)
at momime.server.process.PlayerMessageProcessingImpl.endPhase(PlayerMessageProcessingImpl.java:1093)
at momime.server.process.PlayerMessageProcessingImpl.nextTurnButton(PlayerMessageProcessingImpl.java:1239)
at momime.server.process.PlayerMessageProcessingImpl.switchToNextPlayer(PlayerMessageProcessingImpl.java:929)
at momime.server.process.PlayerMessageProcessingImpl.endPhase(PlayerMessageProcessingImpl.java:1093)
at momime.server.process.PlayerMessageProcessingImpl.nextTurnButton(PlayerMessageProcessingImpl.java:1239)
at momime.server.process.PlayerMessageProcessingImpl.switchToNextPlayer(PlayerMessageProcessingImpl.java:929)
at momime.server.process.PlayerMessageProcessingImpl.endPhase(PlayerMessageProcessingImpl.java:1093)
at momime.server.process.PlayerMessageProcessingImpl.nextTurnButton(PlayerMessageProcessingImpl.java:1239)
at momime.server.process.PlayerMessageProcessingImpl.switchToNextPlayer(PlayerMessageProcessingImpl.java:929)
at momime.server.process.PlayerMessageProcessingImpl.endPhase(PlayerMessageProcessingImpl.java:1093)
at momime.server.process.PlayerMessageProcessingImpl.nextTurnButton(PlayerMessageProcessingImpl.java:1239)
at momime.server.process.PlayerMessageProcessingImpl.switchToNextPlayer(PlayerMessageProcessingImpl.java:929)
at momime.server.process.PlayerMessageProcessingImpl.endPhase(PlayerMessageProcessingImpl.java:1093)
at momime.server.process.PlayerMessageProcessingImpl.nextTurnButton(PlayerMessageProcessingImpl.java:1239)
at momime.server.messages.process.NextTurnButtonMessageImpl.process(NextTurnButtonMessageImpl.java:38)
at com.ndg.multiplayer.server.session.MultiplayerSessionThread.processSessionMessageFromClient(MultiplayerSessionThread.java:249)
at com.ndg.multiplayer.server.session.MultiplayerSessionThread.run(MultiplayerSessionThread.java:198)
By the way, how to flee, I could not flee most time. Only successful once and could not find the fleeing unit. It seems to disappear in the game. Thanks in advance!
Flee button isn't implemented, could never decide how I feel it should work. The way it works in the original MoM is random and doesn't make a whole lot of sense.
The error itself, its trying to work out how much gold is taken, doing a division by the total population of all the defenders cities. I don't see how its possible that can be zero. I can work around the bug but it'd be nice to understand how it happened first. I might need to do a bugfix build for that because the next main version (1.4) is going to be a long time.
I get it, thank you, so the disappear unit is just killed by the enemy and does not flee successfully.
Maybe randomly loss of some unit's life and back to a nearby safe place is an idea.
Turn 144 often occurs with this error, hope it could help you. I wish you well!
Last edit: wertyu7878456 2022-05-25
Thanks for the saved game files, that helped a lot. The error above is only a knock on effect of something that went wrong much earlier. Somehow there are rampaging monsters guarding a city. That shouldn't be possible, they should either destroy the city and turn it into a ruin, or rampage through the city and then die. Because a group of rampaging monsters is in a city where they shouldn't be, on turn 144 another group of rampaging monsters then attack the city and the rampaging monsters player ends up fighting himself, which gives the error.
Unfortunately the actual start of the problem is before turn 135 which is earliest save game file I have so I can't debug through the problem happening. I can test letting rampaging monsters attack an empty city to see if that is maybe the problem but otherwise will be hard to guess how this happened.
I get it. Maybe it is caused by AI opponents' city and rampaging monsters. In the game, I only build one city and it was attacked by rampaging monsters, I found they are too strong and immediately reload the several turns ago's save and they did not come again. Because of the loss of saving before turn 135, it is a little bit hard to know why. Really sorry and thanks for your work.