LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
286 stars 158 forks source link

3.6.1_StabilityMultiplayerTest_200TurnsGame #9885

Closed Cyclopia31 closed 1 year ago

Cyclopia31 commented 1 year ago

1. Mod Version (X.Y.Z). Current Version: 3.6.1

Vox Populi version 3.6.1, modpack link: https://drive.google.com/file/d/1MefkxRRgMn5JM3YQF98Xp7POiIT99x1L/view?usp=share_link

2. List of Other Mods

None, Base game modpack Map: Communitu_79a v2.6.0, without Events and with Chill Barbarians.

4. Describe the Issue

Hello again, with the new promising patch 3.6.1 I wanted to test again a multiplayer game with 2 humans and 4 AI for 200 turns.

(Note: I had a desync Turn 0 using Inca on Communitu_79a v2.6.0 mapscript on my first game. I restarted a new game but without the map option "Override AssignStartingPlots" and it worked fine.

So the 200 turns Game: It was really enjoyable to play, I had 0 CTD this time. But I caught some issues:

1): One force Sync (loading screen) at turn 181. Looking at the "net_message_debug.log" file the desyncs started from Turn 169 (or 168 ?).

2): Then, starting end turn 191, one (?) AI player started taking longer to play. It was always during "Crom" Turn so I guess this is a City state or the (chill) barbarian player that caused the problem ?

5. Data Here a link of the logs/cache/saves/CvMiniDump.dmp for both player: https://drive.google.com/file/d/1f7mnZQ1FWIsFj-AAKZnYrFzAqkDal_bP/view?usp=share_link

There is more saves from the non-host player PC (starting Turn 160 for the Desync) than from Host player PC. (Host PC was configured to keep only 10 autosaves...)

I hope it can help, and thank all of you for all the hard work 👍

seroperson commented 1 year ago

Override AssignStartingPlots must not be used because it makes map generator use internal generation logic instead of VP-bundled. Internal is outdated so it is not the best decision to use it.

So, I loaded turn 168 from non-host save and looks like that's why I got different desyncs than you, because I loaded from non-host world-view (you played the host world-view). The very first desync I got is a something tied with AI diplomacy. If looking your logs, you have such desync too starting from turn 88 (it some kind of 'silent' desync - when something desynced but there are no any desynced syncvars): 12312312

When I loaded 168 non-host turn, visually I got diplomacy request from Arabia to Inca and to Ethiopia. But looks like from Inca's (player id 0) point of view, Ethiopia (player id 1) not received diplomacy request from Arabia (I saw it via debugger). So, looks like the problem is here: CvDiplomacyAI::DoContactMajorCivs. It is the loop where AI iterates over human players and sends diplomacy requests. If he sent request to someone, the loop breaks. From the Inca's point of view it works -> Arabia sent request to them and successfully stopped -> Ethiopia not received request because loop stopped. But in the reality Ethiopia received the request! Why? Because loop was not stopped from the point of view of Ethiopia player. Why? Because of the following code: CvDiplomacyRequests::SendDealRequest. I don't know why such logic exists, but AI does not send request to Human if he is not active player (as we know, getActivePlayer() usually tends to desyncs). @RecursiveVision @ilteroi should we just comment this if? What a purpose of such code? I commented these three lines and I got no desyncs with AI diplomacy.

I will answer later about next desyncs.

Cyclopia31 commented 1 year ago

Do you think it's possible to have the "Override AssignStartingPlots" option "off" by default (at least for multiplayer games) ? Because I'm pretty sure most players don't know what it is and will leave it 'on' because it's the default mode.

Next time I'll try to keep autosaves every turn for both players !

Thank you @seroperson for your work, and for explaining what happened 👍

seroperson commented 1 year ago

2): Then, starting end turn 191, one (?) AI player started taking longer to play. It was always during "Crom" Turn so I guess this is a City state or the (chill) barbarian player that caused the problem ?

Recently I fixed something like this in #9783. There was a trouble with boats which "best" location to move was < 3 plots away were not moved at all due to MOVEFLAG_APPROX_TARGET_RING2 flag. At the same time unit was required to be moved somewhere to be processed.

Here we have similar situation but another one case: pBestPlot here (CvHomelandAI::ReviewUnassignedUnits) is null at all. It happens for some of these Droms: image

Possibly it caused by this one check: CvMilitaryAI::GetCoastalWaterNearPlot. All plots around this city are bays, so there is no pBestPlot as a result.

@RecursiveVision @ilteroi As a fast fix I think we should just mark such units as processed (if pBestPlot for them is null). They will be removed in few turns if nothing changed.

RecursiveVision commented 1 year ago

The Diplomacy AI's dialogue system is plagued with known issues unfortunately. I'll get to it eventually.