thomaswp / BeaverBuddies

GNU General Public License v3.0
16 stars 2 forks source link

Desync with Analytics enabled checked (guid desync) #31

Closed Cilyena closed 1 month ago

Cilyena commented 1 month ago

V1.22 for Update V6

Edit 3 hours after, i found an Workaround : https://github.com/thomaswp/BeaverBuddies/issues/31#issuecomment-2312341785 I have rename the issue

The game desyncs in a few minutes with no action after loading a new game save (with no buildings, nothing).

It's a NewGuid problem :

File DeterminismService.cs
Class GuidPatcher
Function Prefix
Line 788 - 796

When we use GenerateIncrementally instead of GenerateWithUnityRandom, no Desync.

Cilyena commented 1 month ago

image

Cilyena commented 1 month ago

With GenerateWithUnityRandom + Empty World :

image

Cilyena commented 1 month ago

I found the problem. The data collection is probably generating a GUID locally and causing the desync. By unchecking this option, I have no more desync with empty world & GUID.

image

Cilyena commented 1 month ago

Host image Client image

I confirm (all 2 minutes)

thomaswp commented 1 month ago

Thanks for posting. I don't see anything the Analytics namespace that looks like it is using Random or Guid, but let me know if you see something. It could be that Unity's Analytics classes use Guid - actually seems pretty likely, so I'll try to reproduce the error. I don't have analytics enabled myself, so that might be why I haven't gotten this.

thomaswp commented 1 month ago

Update: It's definitely the Analytics service - good find! Testing a fix now.

thomaswp commented 1 month ago

I'm getting some other desyncs as well, often at the very start of the game, that seem to go away without analytics, so I may need to look deeper.

Edit: my solution has been to disable analytics completely when the mod is active (which I don't think the devs will mind - these logs will look like nonsense anyway) - that seems to have fixed it. I'm marking as resolved for now, but will reopen if I see it again (and feel free to as well).