G3rste / vsvillage

A Vintage Story mod adding villagers and villages roaming the world.
MIT License
11 stars 6 forks source link

Client side crash about a cobblestone trough from looking at a village merged with a better ruin #13

Closed bluelightning32 closed 2 years ago

bluelightning32 commented 2 years ago

I repeatedly got this crash on the client side from looking at a village.

Running on 64 bit Linux with 62 GB. 
Game Version: v1.17.3 (Stable)
9/10/2022 1:36:20 PM: Critical error occurred
Loaded Mods: weaponpacka@1.3.1, ancienttools@1.4.7, backpackpack@1.0.3, bettercrates@1.5.1, cavecontent@1.0.1, chiseltools@1.5.4-pre.1, extrachests@1.6.0, fancydoors@1.1.1, weaponpackg@1.0.1, harptech@0.1.1, hideandfabric@1.2.5, instruments@1.1.3, moreroads@1.4.3, necessaries@1.1.3, primitivesurvival@3.0.5, qptech@1.10.4, rustandrails@1.0.3, stackables@2.0.5, locustmod@2.3.5, tradeomat@1.6.3, viescraftmachines@1.17.2, game@1.17.3, vshud@2.1.0, wildcraft@1.4.2, zeekea@1.6.2, alchemy@1.6.4, egocaribautomapmarkers@2.4.0-pre.1, autosifter@1.0.1, carrycapacity@0.6.5, fromgoldencombs@1.3.14-pre.1, lichen@1.6.1, medievalexpansion@3.8.1, petai@1.5.4, playercorpse@1.4.1, prospectorinfo@3.2.0, tprunes@1.0.5, creative@1.17.3, vsquest@0.0.4, survival@1.17.3, xlib@0.6.10-rc.2, xmelee@0.0.10, xrowboat@0.0.5, bullseye@2.4.0-rc.2, cats@1.5.2, magicmushrooms@1.0.0, em@1.0.0, feverstonehorses@1.2.9, vsvillage@0.2.4, wolftaming@1.5.3, xskills@0.6.10-rc.2, bricklayers@1.0.1
System.Collections.Generic.KeyNotFoundException: The given key 'troughContentConfigs-game:cobblestone-claystone' was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x00021] in <d57a575dd6be4193a54eb87783bbd39c>:0 
  at Vintagestory.GameContent.BlockEntityTrough.get_contentConfigs () [0x0002c] in <f01e2cfb17af4d6e8438cdb4242c5d13>:0 
  at Vintagestory.GameContent.BlockEntityTrough.GenMesh () [0x00045] in <f01e2cfb17af4d6e8438cdb4242c5d13>:0 
  at Vintagestory.GameContent.BlockEntityTrough.FromTreeAttributes (Vintagestory.API.Datastructures.ITreeAttribute tree, Vintagestory.API.Common.IWorldAccessor worldForResolving) [0x0001f] in <f01e2cfb17af4d6e8438cdb4242c5d13>:0 
  at Vintagestory.Client.NoObf.ClientChunk.AddOrUpdateBlockEntityFromPacket (Packet_BlockEntity p, Vintagestory.Client.NoObf.ClientMain game) [0x00077] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.NoObf.GeneralPacketHandler.HandleBlockEntities (Packet_Server packet) [0x0003d] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.NoObf.ProcessPacketTask.ProcessPacket (Packet_Server packet) [0x00016] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.NoObf.ProcessPacketTask.Run () [0x00000] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.NoObf.ClientMain.ExecuteMainThreadTasks (System.Single deltaTime) [0x0008e] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.NoObf.ClientMain.MainGameLoop (System.Single deltaTime) [0x0004e] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.GuiScreenRunningGame.RenderToPrimary (System.Single dt) [0x0004d] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.ScreenManager.Render (System.Single dt) [0x00079] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.ScreenManager.OnNewFrame (System.Single dt) [0x000cc] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame (System.Object sender, OpenTK.FrameEventArgs e) [0x00141] in <6215ae1029cd4696b4c4b2c34106b061>:0 
  at (wrapper delegate-invoke) System.EventHandler`1[OpenTK.FrameEventArgs].invoke_void_object_TEventArgs(object,OpenTK.FrameEventArgs)
  at OpenTK.GameWindow.OnRenderFrame (OpenTK.FrameEventArgs e) [0x00000] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.OnRenderFrameInternal (OpenTK.FrameEventArgs e) [0x00010] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.RaiseRenderFrame (System.Double elapsed, System.Double& timestamp) [0x0000c] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.DispatchRenderFrame () [0x00038] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.Run (System.Double updates_per_second, System.Double frames_per_second) [0x00104] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.Run () [0x00000] in <a4886e33f9fc416195d24950e7205b94>:0 
  at Vintagestory.Client.ClientProgram.Start (Vintagestory.Client.ClientProgramArgs args, System.String[] rawArgs) [0x003dc] in <9422a14f759b4537aaff44309dc950a2>:0 
  at Vintagestory.Client.ClientProgram+<>c__DisplayClass14_0.<.ctor>b__0 () [0x00000] in <9422a14f759b4537aaff44309dc950a2>:0 
  at Vintagestory.ClientNative.CrashReporter.Start (System.Threading.ThreadStart start) [0x00007] in <6215ae1029cd4696b4c4b2c34106b061>:0 

In one repro, this error occurred on the console about 30 seconds before the crash:

12:53:28 [Client Error] Exception thrown when initializing a block entity with classname Trough: System.Collections.Generic.KeyNotFoundException: The given key 'troughContentConfigs-game:cobblestone-claystone' was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x00021] in <d57a575dd6be4193a54eb87783bbd39c>:0 
  at Vintagestory.GameContent.BlockEntityTrough.get_contentConfigs () [0x0002c] in <f01e2cfb17af4d6e8438cdb4242c5d13>:0 
  at Vintagestory.GameContent.BlockEntityTrough.GenMesh () [0x00045] in <f01e2cfb17af4d6e8438cdb4242c5d13>:0 
  at Vintagestory.GameContent.BlockEntityTrough.Initialize (Vintagestory.API.Common.ICoreAPI api) [0x00027] in <f01e2cfb17af4d6e8438cdb4242c5d13>:0 
  at Vintagestory.Client.NoObf.ClientChunk.InitBlockEntitiesFromPacket (Vintagestory.Client.NoObf.ClientMain game) [0x0001e] in <6215ae1029cd4696b4c4b2c34106b061>:0 

While trying to reproduce the crash, at one point it was night and the crash stopped reproducing until it became daytime and the villagers started moving.

After uninstalling the vsvillage mod on the server side, the crash went away. This is what the village looked like after the mod was installed. Notice how the village is merged with a better ruin structure. Other villages that are not merged with a ruin do not crash.

2022-09-10_13-23-42

G3rste commented 2 years ago

Hm never encountered that one before. In this structure, are there any trough halfes that are not connected to another one? Maybe the concurrent generation made them "snap in half" and caused an issue.

bluelightning32 commented 2 years ago

The large troughs are fully connected and nothing looks wrong with them. I found the problematic trough; it was the small trough.

Notice how on the right hand side of the debug screen, it says I'm looking at a cobblestone-claystone block but also looking at a BlockEntityTrough. I think the trough is not visible outside of the debug screen because it's rendered inside the claystone.

image

G3rste commented 2 years ago

Thanks a lot for checking, that really narrows it down by a lot. I think the new Villagegeneration should fix this.