Better-Scenes / RimConnect-mod

A Twitch integration for the game RimWorld
GNU General Public License v3.0
15 stars 7 forks source link

ZMP Desync when spawning massive amounts of items #26

Open TurkeyKittin opened 3 years ago

TurkeyKittin commented 3 years ago

Originally identified when spawning certain items with mods, I realized this was happening in general in ZMP+RC play too.

When a server is started with the arbiter running and wait for arbiter to join... Everytime a weapon is dropped, there is a small chance for it to cause a desync. This was not reliably reproducible until I started spawning in many quality oriented items.

First identified when spawning 100x longswords. It was getting reproduced reliably until I full restarted my Rimworld game.

I tried spawning in 100x random weapons via vote 3 times. I tried spawning in 100x random apparel via vote 4 times. I tried spawning in 100x longswords via vote 6 times. I tried spawning in 100x sniper rifles 1 time via vote and immediately got a desync.

The next time I started a new colony and I tried spawning 100x longswords via vote , immediate desync again. Tried the same thing again in a new colony, desync on first 100x longsword drop via vote.

Did a full restart of the game.

Tried to spawn 100x longswords again via vote and immediately got a desync.

Modlist load order:

Harmony Core Multiplayer RimConnect

I will likely continue testing this and report more findings.

The following are 4 instances of the desync tick in separate save games.

474 Tick:31978 Hash:-1040416705 ''
  at Verse.Rand.Verse.Rand.get_Value_Patch1 () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Rand.Gaussian (System.Single centerX, System.Single widthFactor) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.QualityUtility.GenerateFromGaussian (System.Single widthFactor, RimWorld.QualityCategory max, RimWorld.QualityCategory center, RimWorld.QualityCategory min) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.QualityUtility.GenerateQualityTraderItem () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimConnection.ItemAction.TryAddQualityToThing (Verse.Thing thing) [0x00000] in <e40dd205419d4ad29b528681b2bae2b5>:0 
  at RimConnection.ItemAction.Execute (System.Int32 amount, System.String boughtBy) [0x00000] in <e40dd205419d4ad29b528681b2bae2b5>:0 
  at RimConnection.ServerPoller.GameComponentTick () [0x00000] in <e40dd205419d4ad29b528681b2bae2b5>:0 
  at Verse.GameComponentUtility.GameComponentTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.TickManager.Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Multiplayer.Client.MultiplayerWorldComp.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.TickTickable (Multiplayer.Client.ITickable tickable) [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Prefix () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Verse.TickManager.Verse.TickManager.TickManagerUpdate_Patch2 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Game.UpdatePlay () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Root_Play.Update () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
104 Tick:3026 Hash:-1977721174 ''
  at Verse.Rand.Verse.Rand.get_Value_Patch1 () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Rand.MTBEventOccurs (System.Single mtb, System.Single mtbUnit, System.Single checkDuration) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.InspirationHandler.CheckStartRandomInspiration () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.InspirationHandler.InspirationHandlerTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.AI.Pawn_MindState.MindStateTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Pawn.Verse.Pawn.Tick_Patch2 (Verse.Pawn ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.Planet.WorldPawns.WorldPawnsTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.Planet.World.WorldTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.TickManager.Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Multiplayer.Client.MultiplayerWorldComp.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.TickTickable (Multiplayer.Client.ITickable tickable) [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Prefix () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Verse.TickManager.Verse.TickManager.TickManagerUpdate_Patch2 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Game.UpdatePlay () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Root_Play.Update () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Rand.Verse.Rand.get_Value_Patch1 () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Rand.MTBEventOccurs (System.Single mtb, System.Single mtbUnit, System.Single checkDuration) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.InspirationHandler.CheckStartRandomInspiration () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.InspirationHandler.InspirationHandlerTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.AI.Pawn_MindState.MindStateTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Pawn.Verse.Pawn.Tick_Patch2 (Verse.Pawn ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.Planet.WorldPawns.WorldPawnsTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.Planet.World.WorldTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.TickManager.Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Multiplayer.Client.MultiplayerWorldComp.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.TickTickable (Multiplayer.Client.ITickable tickable) [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Prefix () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Verse.TickManager.Verse.TickManager.TickManagerUpdate_Patch2 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Game.UpdatePlay () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Root_Play.Update () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0
456 Tick:4514 Hash:1291951189 ''
  at Verse.Rand.Verse.Rand.get_Value_Patch1 () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Rand.Range (System.Single min, System.Single max) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.GenCollection.TryRandomElementByWeight[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, T& result) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.GenStuff.TryRandomStuffByCommonalityFor (Verse.ThingDef td, Verse.ThingDef& stuff, RimWorld.TechLevel maxTechLevel) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimWorld.GenStuff.RandomStuffByCommonalityFor (Verse.ThingDef td, RimWorld.TechLevel maxTechLevel) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at RimConnection.ItemAction.Execute (System.Int32 amount, System.String boughtBy) [0x00000] in <e40dd205419d4ad29b528681b2bae2b5>:0 
  at RimConnection.ServerPoller.GameComponentTick () [0x00000] in <e40dd205419d4ad29b528681b2bae2b5>:0 
  at Verse.GameComponentUtility.GameComponentTick () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.TickManager.Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Multiplayer.Client.MultiplayerWorldComp.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.TickTickable (Multiplayer.Client.ITickable tickable) [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Tick () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Multiplayer.Client.TickPatch.Prefix () [0x00000] in <70e2a53003de4f0a83e3fb3542856a17>:0 
  at Verse.TickManager.Verse.TickManager.TickManagerUpdate_Patch2 (Verse.TickManager ) [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Game.UpdatePlay () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
  at Verse.Root_Play.Update () [0x00000] in <d72310b4d8f64d25aee502792b58549f>:0 
TurkeyKittin commented 3 years ago

Currently even having it desync on spawning 100 gold in a vote.

InfinitySamurai commented 3 years ago

Damn on 100 gold too? I was thinking there was something about the way that item quality was being assigned. I know there are some items that spawn really strangely from the random weapon event (#20) but on something as mundane as gold is really weird.

TurkeyKittin commented 3 years ago

Yeah I was confused by this too, but it seems like it could be a sort of cascading failure where it fails once and affects all calls afterwards unless you do a full restart of the game. I'm not sure if I'll have time to test this idea today but it's worth a shot.