[Crash] Crashing out when getting hit

Shikuchi

Green Slime
I crash out in multiplayer when I get hit against the first encounter at Tai Ming, as well as in the Season Temple.

I tried switching out items as well as have others switch out items. Ran the program in admin mode, and compatibility mode.
I've updated my .NET Framework and DirectX, but I still end up having this crashing problem.
Running the game in windowed mode with x2 zoom (x1 is too small for me). Running Win7 Pro.

.NET Runtime Error
Code:
Application: Secrets Of Grindea.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Present(tagRECT*, tagRECT*, HWND__*)
   at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw()
   at Microsoft.Xna.Framework.Game.EndDraw()
   at Microsoft.Xna.Framework.Game.DrawFrame()
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.Game.HostIdle(System.Object, System.EventArgs)
   at Microsoft.Xna.Framework.GameHost.OnIdle()
   at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
   at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(System.Object, System.EventArgs)
   at System.Windows.Forms.Application+ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32)
   at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
   at Microsoft.Xna.Framework.WindowsGameHost.Run()
   at Microsoft.Xna.Framework.Game.RunGame(Boolean)
   at SoG.Program.Main(System.String[])


Game crash error (templog)
Code:
Version: 0.700a Steamy Hot Stable

Error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at SoG.PlayerRenderComponent.PreRender(SpriteBatch spriteBatch) in (path)\Rendering\Components\PlayerRenderComponent.cs:line 285
   at SoG.Game1._RenderMaster_Prerender() in (path)\Rendering\RenderMaster.cs:line 2802
   at SoG.Game1.Draw(GameTime gameTime) in (path)\Game1.cs:line 1101 - FullScreen: No - NetworkRole: Client - playerprerender: after_hatsnfacegears2 - playerprerender_who: otherplayer - MD5: 00b82856231dac068c2810582a8532aa
 

Teddy

Developer
Staff member
Thanks for the report! I've seen this error a few times over the last month, but haven't been able to pinpoint it. Last patch I added some extra diagnostics for it, and with this post we're one step closer to ironing out the cause.

Judging from the crash log generated by the game, the crash occurs when rendering one of your friends' hairstyles. It might be related to some hairstyle + skill combination. The fact that it's crashing when you're hit might just be a coincidence (at least it looks like it judging by the error)!

If you have the opportunity to recreate the crash, I've uploaded a special build of the game to a special beta branch on Steam. To access it, right click the game in your Steam library->properties->betas, type thebloomorises into the password box, and then select the "specops1" beta branch!

The game will still crash, but I've added a bunch of extra debug info that will be included in the report. It would be most helpful if you could paste the new templog info here!

If this is too much of a hassle, or you can't recreate it, I understand! The diagnostics will be included in the next official patch and hopefully this bug will be squashed some time after that.
 
Last edited:

Shikuchi

Green Slime
;)Okay, I recreated the crash (fun times). My friend found out (after several crashes and he likes to debug things too) that I crash out with him when he has 6 orbs from Static Touch (lv6) and does a gold charge of Whirl Slash (lv10).

templog
Code:
Version: 0.700a Steamy Hot Stable

Error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at SoG.PlayerRenderComponent.PreRender(SpriteBatch spriteBatch) in (path)\Rendering\Components\PlayerRenderComponent.cs:line 285
   at SoG.Game1._RenderMaster_Prerender() in (path)\Rendering\RenderMaster.cs:line 2802
   at SoG.Game1.Draw(GameTime gameTime) in (path)\Game1.cs:line 1101 - FullScreen: No - NetworkRole: Client - playerprerender_who: otherplayer - playerprerender: after_hatsnfacegears2 - playerprerender_hair: 160005 - playerprerender_dir: 4 - MD5: eb635c38b05a273046e2810d4da30a2b

Edit:
My friend and I are trying out different hairstyles on him, and it still seems to crash me. So we're testing without the Whirl Slash, and so far seems to be alright.
Edit2:
Scratch that, still crashes even without using skills.
Final Edit:
So after about an hour of X-ing one thing out at a time recreating the crashing, I think we narrowed it down to any hairstyle with the combination of any 2H skill. AKA my friend's character is now broke after all the hairstyle changes and skill refunds ;):p
 
Last edited:

Teddy

Developer
Staff member
Wow, that's a lot of interesting intel you guys managed to gather! :D

From the debug data and your descriptions I've managed to narrow it down to some weird bug where the game thinks your friend is in an animation frame that doesn't exist. Specifically, it's trying to get where to render the hairstyle of a non-existing animation frame!

I'm not able to recreate it, so I assume there's some secret twist to it, but I've uploaded a patch to your Specops branch that should prevent the game from exploding that particular way! Basically I'm treating the symptom since the cause is still unclear. This might make everything perfectly playable, or it will still crash, but perhaps at a different point, giving more clues.

As for your friend now being broke, perhaps I should've suggested the cheat command /respec which resets all skill points for free :chicken:

Bonus question: what hat and facegear does your friend display on his character, if any? Are you using any support skills on him, or does he have any other visual effects active?
 

Shikuchi

Green Slime
If I remember correctly, we also had level 5 Protect and level 5 Haste, neither of the support skills were used often but crashes with or without them being active.

As for headgears, we used: Cat Ears, Blue Slime Hat, Crystal Hat, Ornate Helmet, Winter Helmet, Phaseman Face, Gas Mask, Fancy Beard, and the Ski Goggles. All resulted in a crash before.

We just tried again with the two handed skills. New error (templog) at least, with more information.
Code:
Version: 0.700a Steamy Hot Stable

Error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at SoG.HatAnimation.GetOffsetSafely(UInt16 iAnimation, Int32 iRenderedFrame) in (path)\Items\Equipment\Hats\HatAnimation.cs:line 675
   at SoG.PlayerRenderComponent.PreRender(SpriteBatch spriteBatch) in (path)\Rendering\Components\PlayerRenderComponent.cs:line 294
   at SoG.Game1._RenderMaster_Prerender() in (path)\Rendering\RenderMaster.cs:line 2809
   at SoG.Game1.Draw(GameTime gameTime) in (path)\Game1.cs:line 1102 - FullScreen: No - NetworkRole: Client - playerprerender_who: otherplayer - playerprerender: in - MD5: 03a50e9376176ced1c306f5ca4e273dc

If you want, we could schedule a time, with my friend as well, to work on this problem via screenshare or VOIP. Just shoot me a message.
 

Teddy

Developer
Staff member
Thanks for staying with me! The adventure down the rabbit hole continues!

Now that the error has been isolated into that tiny function, I've littered it with debug data catchers on basically every other line. I've uploaded a new patch to the special branch once again!

I can already say that the place it crashes right now is really weird. Like, either I'm insane or there's a bug in .NET kind of weird. Both of these things are possible, though! It will be interesting to see where this ends up.

For how long have you been playing the game, by the way? In calendar time, that is! I'm interested in correlating it with other reports I've had of the same bug!

If you want, we could schedule a time, with my friend as well, to work on this problem via screenshare or VOIP. Just shoot me a message.

It's awesome of you to offer, but since I need to inject debug collection stuff between every test I don't think we'd be very efficient. It would probably mostly be me grunting in the mic while tearing at my hair :D
 

Shikuchi

Green Slime
Well, my friend and I have been playing for about a 8-9 months now. But we've only encountered this crash error since the 0.700a patch.

We just tried again, and still crashing at the same spot. I do see the new lines of debug though.
Code:
Version: 0.700b Steamy Hot Stable

Error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at SoG.HatAnimation.GetOffsetSafely(UInt16 iAnimation, Int32 iRenderedFrame) in (path)\Items\Equipment\Hats\HatAnimation.cs:line 675
   at SoG.PlayerRenderComponent.PreRender(SpriteBatch spriteBatch) in (path)\Rendering\Components\PlayerRenderComponent.cs:line 294
   at SoG.Game1._RenderMaster_Prerender() in (path)\Rendering\RenderMaster.cs:line 2809
   at SoG.Game1.Draw(GameTime gameTime) in (path)\Game1.cs:line 1102 - FullScreen: No - NetworkRole: Client - playerprerender: in - playerprerender_animationLength: 5 - playerprerender_renderedframeB: -1 - playerprerender_animationA: 652 - playerprerender_who: otherplayer - playerprerender_animationB: 652 - playerprerender_animationC: 652 - playerprerender_renderedframeC: -1 - playerprerender_x1: 3 - playerprerender_renderedframeA: -1 - MD5: 58398ef6672127098c19a5a24bd19994

I think we're going to try completely removing his headgear now, see if that changes anything.

Edit:
Removing the headgear entirely, and still end up crashing, but the log is a little different but also the same still.

Code:
Version: 0.700b Steamy Hot Stable

Error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at SoG.HatAnimation.GetOffsetSafely(UInt16 iAnimation, Int32 iRenderedFrame) in (path)\Items\Equipment\Hats\HatAnimation.cs:line 675
   at SoG.PlayerRenderComponent.PreRender(SpriteBatch spriteBatch) in (path)\Rendering\Components\PlayerRenderComponent.cs:line 294
   at SoG.Game1._RenderMaster_Prerender() in (path)\Rendering\RenderMaster.cs:line 2809
   at SoG.Game1.Draw(GameTime gameTime) in (path)\Game1.cs:line 1102 - FullScreen: No - NetworkRole: Client - playerprerender_renderedframeC: -1 - playerprerender_x1: 3 - playerprerender_renderedframeA: -1 - playerprerender_animationLength: 5 - playerprerender_renderedframeB: -1 - playerprerender_animationA: 653 - playerprerender_animationC: 653 - playerprerender: in - playerprerender_animationB: 653 - playerprerender_who: otherplayer - MD5: 58398ef6672127098c19a5a24bd19994
 
Last edited:

Teddy

Developer
Staff member
Well, the new debug points did reveal some pretty interesting stuff!

For some reason, the game is trying to render frame -1, which obviously does not exist. In fact, such a possibility had not even crossed my mind since it's quite illogical to occur. Both the animations where this happened were the charge animation, when charging up a two-handed skill.

I no longer believe this has anything to do with hats or facegears or such. It might be some kind of network error where the reported animation frame becomes bogus, or if anything, it's related to a weapon!

I've extended the failsafe code to also work for negative numbers, and we'll see how that appears in game!
 

Shikuchi

Green Slime
So, no more crashes. Bright side at least. But that is still a weird crash error for it to try to render a negative non-existant frame (I studied in animation).

My friend has been using two-handed skills now and the normal combination of skills that used to crash me. No lag issues either, or seeing him skip around. Animations are smooth and don't look like something went wrong.

Hopefully that was all that was needed to fix that crashing from happening again until there is a proper fix. But for now, it works wonders and we can continue through the Tai Ming chapter :)
 

Teddy

Developer
Staff member
I've now made this "fix" live in the regular Stable version, so I suggest switching back to the default branch or the frontline batch, so you won't suddenly get sucked into unnecessary updates the next time I need the specops-branch :D

Thanks a lot for all the testing assistance!
 
Top