Ludeon Forums

RimWorld => Support => Topic started by: 47a on May 14, 2017, 12:08:22 AM

Title: Game Crash
Post by: 47a on May 14, 2017, 12:08:22 AM
My game has been crashing at seemingly random and I receive these 2 crash messages, help is appreciated :D

http://prnt.sc/f7l939
http://prnt.sc/f7l95q

Moderator's edit (Calahan) - For convenience, I've attached the output and error logs that are located in a download link later in the post to the OP.

[attachment deleted by admin due to age]
Title: Re: Game Crash
Post by: Neotic on May 14, 2017, 12:39:33 AM
Quote from: 47a on May 14, 2017, 12:08:22 AM
My game has been crashing at seemingly random and I receive these 2 crash messages, help is appreciated :D

http://prnt.sc/f7l939
http://prnt.sc/f7l95q
Can you please link the log file and the "crash report" so they can find out what the problem is. Also do you know how many gb of ram you have?
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 01:09:32 AM
8gb of ram, and i'm not sure how to link the log files
Title: Re: Game Crash
Post by: Neotic on May 14, 2017, 01:19:50 AM
Quote from: 47a on May 14, 2017, 01:09:32 AM
8gb of ram, and i'm not sure how to link the log files
Use a website like dropbox and create a download link for it.
If you cant find the log file follow the instructions for your OS
https://ludeon.com/forums/index.php?topic=513.0
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 01:32:40 AM
https://files.fm/u/9ccxu8m9 Got it, I think
Title: Re: Game Crash
Post by: ReZpawner on May 14, 2017, 01:45:07 AM
Firstly, the error message says that the log file is located in the Rimworld directory, next to the exe file. If you're using Steam, that will be %steam\steamapps\common\RimWorld , where % is just the drive letter, depending on where you installed Steam.

As for the other error message, it's commonly found when a Unity program runs out of RAM. This does not however mean that you don't have enough - particularly since Rimworld is a 32-bit program, which means that it cannot utilise more than 4GB of it anyway. Garbage collection problems in Unity, a large amount of mods, (less likely) buggy code, or any of a hundred other reasons can all cause the error you're seeing, so without the log-file, we're left with narrowing it down almost by pure guesswork.

If you're using a lot of mods though, do try to disable them and see if that helps.

...and also, specify if you're using the unstable testing version(A17) or A16.
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 01:47:57 AM
above should be a link to the log files, and i'm using A16

http://prntscr.com/f7lslb
mods used
Title: Re: Game Crash
Post by: ReZpawner on May 14, 2017, 01:58:58 AM
Without having any other error messages to compare with, I would probably suggest updating the graphic-card drivers on your computer, to see if that works first. If nothing else, it seems to have helped a lot of other people with that error message in Unity. That said, it looks like it could be related to the garbage collector (mono). That's pure speculation though, as I'm not too familiar with errors in Unity.

Edit: The graphic card part is not just a complete random guess btw. The error message pretty much mentions two things, "Skipped rendering frame because GfxDevice is in invalid state (device lost)" and a bunch of Mono stuff. I've seen a couple of more error messages that don't mention the D3D part at all, which suggests that it is the cause of the crash. I'm sure some of the mods here have gone through quite a few more of those logs than I have, and may be able to give you more specific advice about it, but new drivers isn't a bad place to start regardless.
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 02:30:05 AM
I think my drivers are up to date already http://prntscr.com/f7m012
Title: Re: Game Crash
Post by: Neotic on May 14, 2017, 03:10:31 AM
Quote from: 47a on May 14, 2017, 01:47:57 AM
above should be a link to the log files, and i'm using A16

http://prntscr.com/f7lslb
mods used
If you're using mods then this should be in the mod bugs section
Title: Re: Game Crash
Post by: Calahan on May 14, 2017, 04:16:14 AM
@ 47a - I've moved this to support because, based on those log errors, this seems more likely to be a problem with your computer (such as your graphic driver) rather than a bug in the base game or the mods you use. And to avoid causing concern, your computer is likely fine, and that an update to the Unity engine might be at fault as well, as sometime an update causes loss of compatibility with older graphic cards, which yours appears to be. (the "Intel(R) Q45/Q43 Express Chipset" was released in 2008 according to Wiki)

It would help if you could please answer the following questions:-

1 - What version of Windows are you using?
2 - What version of your graphics driver are you currently using? (the screenshot you posted says that Windows says it is up to date, but that doesn't tell us what driver version it is). 
3 - You say in the OP that the "game has been crashing at seemingly random". Is this random crashing recent? Or has it always been like this when playing A16?
3a - If it is recent then when did it start? Did your computer perform any sort of update around the time it started? (you might need to check the Windows update log for this info, but how to do that depends on what version of Windows you use)
3b - If it's not recent, and this has always been a problem when playing A16, then have you played any of the earlier versions of RimWorld? If so did you ever have this problem playing those?
4 - Have you tried playing a vanilla game to see if the same crashing occurs? If you haven't tired this yet then can you please try it.
5 - If the crashing is constant across A16, then can you please try playing A15 to see if that crashes or not. (according to the log file you are using the Steam version. If so then there is an option in Steam, under the Beta tab, to roll the game back to A15).
6 - Have you ever had this type of crash playing any other game? Especially any of Unity engine games (do you know if own any other Unity engine games? If so have you tried playing one of those recently?)
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 04:27:36 AM
1 - Windows 7 professional 32 bit
2 - http://prntscr.com/f7mltq
3 - i haven't started up rimworld in a while but don't recall this happening previously, so far in the past day its crashed 3 times, so always been like this in A16
4 - Not yet, ill give it a try, would this indicate issue with a mod(s) im using?
6 - I don't recall having this type of crash before and im unsure if any of my other games use Unity engine
Title: Re: Game Crash
Post by: Calahan on May 14, 2017, 05:18:50 AM
Thank you for the answers.

https://downloadcenter.intel.com/product/81511/Graphics-Drivers-for-Intel-Q45-Express-Chipset
According to the above Intel page, and filtering for Windows 32bit, your current graphics driver, 8.15.10.2869, is the most recent one. And there hasn't been any updates for several years, so I think we can rule out this being an issue caused by a recent graphics driver update.

A search through the forum for past instances of "HandleD3DDeviceLost" log errors turned up the following two informative posts by (the always excellent support guru) nccvoyager.
https://ludeon.com/forums/index.php?topic=26517.msg268946#msg268946
https://ludeon.com/forums/index.php?topic=30118.msg306532#msg306532

So based on the above, another set of questions:-

1 - Are you using a laptop?
1a - If yes, please trying setting all your power options to high performance or maximum etc.
2 - Do you ever alt-tab while playing? If yes, then can you please try playing the game for as long as possible without alt-tabbing, and take note of whether the game crashes or not.
3 - Are you using a multiple-monitor setup?
4 - Are your DirectX drivers up-to-date? (and which DirectX version are you using?)

For testing the game you can also try the following two troubleshooting variables:-

- Playing in Windowed mode (assuming you were playing in fullscreen before).
- Enable the "run in background" option in the options menu.

For testing can you please just play vanilla RimWorld. Do not use any mods as that makes it harder to isolate the problem (as it's still not entirely ruled out this is a mod issue, but it just seems less likely at the moment). Try playing A16 first and if that is still crashing, even with the variables (and "maximum power" power management settings), then try the same with A15 (again don't use mods, not least as most mods are likely out of date having been updated to A16).

You said you haven't "started up RimWorld in a while", and that the crashing has always been present in A16, and that things were fine in earlier versions (such as A15?). In which case the crashing in A16 might be caused by a Unity engine update that occurred between A15 and A16, and this update is causing an issue for your (older) graphics card. In which case I'm not sure what can be done to be honest, and it's up to Unity to fix the issue. But we're not at that point yet and still lots to rule out first.
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 05:32:26 AM
1 - No, desktop
2 - I use the windows key to go out of my tab while playing fairly frequently
3 - single monitor
4 - how can i check if DirectX drivers are up to date? and DirectX 11
Title: Re: Game Crash
Post by: Calahan on May 14, 2017, 06:00:31 AM
Thanks again for the answer.

According to nccvoyager (in one of those threads I linked):-
Quote from: nccvoyager on October 03, 2016, 09:22:17 PM
So, doing some research, this error (HandleD3DDeviceLost) is an error thrown by Unity in regards to several different issues.
Most of those issues seem to deal with graphics idle states, including alt-tabbing from games causing the game to "lose focus" and throw an error.
(This is, apparently, one reason that fullscreen Unity games tend to crash when not the focused window for a while.)
So if you are using the Windows key regularly while playing then that might well be the cause of the problem. As that would both match the error generated in the log file...

HandleD3DDeviceLost
  HandleD3DDeviceLost: still lost
Skipped rendering frame because GfxDevice is in invalid state (device lost)


... and, according to nccvoyager's research, it would match one of the main reasons for the Unity engine producing this error.

So the most logical next diagnostic step is for you to completely avoid using the Windows key (alt-tabbing) while playing. As if you test that, and the game doesn't crash, then you almost certainly have your answer regarding what's causing the crash.

You can get all the info about your DirectX drivers (and more) by typing "dxdiag" into the Windows run command box. I haven't used Windows 7 in many years so can't remember if the run box is on the Start menu or not. But you can probably open it by pressing WindowsKey+r. If you click the "Save All Info" button and then post the resulting text file as an attachment. Although this DirectX info likely isn't needed if the above test confirms the cause is the game losing focus due to using the Windows key while playing, which seems likely at this point.
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 06:54:46 AM
Seems this is the issue, but having another problem as well now potentially, so i refrained from using the windows key during my play session just now, was fine for a good maybe hour or so but i'd experience freezing, I could still hear all audio, music, and sound effects as i moved over things but totally frozen visually, when using the windows button to "refresh" it this would have no effect, only undone by ctrl-alt-delete, and these freezes once started became more frequent until eventually crashing as it has previously
Title: Re: Game Crash
Post by: Calahan on May 14, 2017, 07:02:50 AM
Can you please post the log file from the above, or if you've restarted the game since then (as the log file gets wiped on each restart), then post a log file from after this freezing occurs. This might be the same issue (Unity) or a totally separate one, but won't know which without the log file.

Also can you please confirm the above playing session test  was done without using mods?
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 07:10:49 AM
https://files.fm/u/t38m56f9

also was still using mods, I'm concerned disabling mods may break my current save game
Title: Re: Game Crash
Post by: Calahan on May 14, 2017, 07:36:52 AM
Thanks once more for the logs.

The "HandleD3DDeviceLost" error is still there, but there's also now a "10 jobs in one tick" error that is RimWorld or mod related (rather than Unity). The game constantly throwing this error might well be the cause of the slow down and eventual freeze. There are numerous bug/support reports on the forum relating to the "10 jobs in one tick" error, and as far as I know, it can be caused by both or either the vanilla game and mods. Although some of the vanilla causes have been fixed between A16 and the current unstable A17 alpha, so you may have encountered one of those bugs (that has been reported and fixed since A16), or the error might be caused by one of the mods you are using.

And for this testing I was hoping you would start a new vanilla A16 game. As you are right to be concerned about removing mods from your current game, as that would indeed cause problems. So please don't do that, and it likely wouldn't help anyway as the game would probably generate errors due to the missing mods and make it even harder to isolate the problem.

But at the moment it would be extremely useful to know if these problems you are having are an underlying issue caused by Unity, or a bug in the vanilla game (that's been subsequently fixed, or not). Or whether it's something specific to that particular save game you are playing. And the only way to know for sure is for you to play a new vanilla game and see if you encounter problems or not. If you have the same problems then it's likely something underlying (Unity or game). If you don't, then it's likely something to do with that particular save game (eg. maybe it got corrupted at some point) or one of the mods your are using is the cause. But testing a new vanilla game would remove those latter two thing from the equation, which diagnostically, would be useful information to know at this point in the process.
Title: Re: Game Crash
Post by: 47a on May 14, 2017, 07:45:17 AM
Alrighty, I'll create a new vanilla save game and let you know the results, also regarding 10 jobs in one tick is it possible this mod I'm using could be causing it? and possible using fewer jobs at once would resolve it? http://steamcommunity.com/sharedfiles/filedetails/?id=715565262
Title: Re: Game Crash
Post by: Calahan on May 14, 2017, 08:13:25 AM
Okay please report back on how the new vanilla test game goes.

As for that mod being the cause... maybe, possibly, likely? I'm not great (to put it mildly) with identifying mod bugs, but if your test game goes well and is problem free, then one of your mods will instantly become the #1 suspect. At which point this thread will probably get moved again to mod bugs, and my involvement would probably end as well. As any advice I gave regarding mod bugs would be a wild guess at best (unless I could copy and paste someone else's answers from a previous report), and more likely to confuse than help.
Title: Re: Game Crash
Post by: 47a on May 15, 2017, 07:18:00 PM
so after roughly the same amount of time I didn't experience a crash in a new vanilla game, and it still continues periodically in my modded save, and can be avoided if the first time it freezes i save and quit, reload and its good for a while
Title: Re: Game Crash
Post by: milon on May 16, 2017, 02:44:24 PM
I'm glad to hear that this is (mostly) functional now.  Have you tried not switching focus to see if the problem persists?

Also, I noticed the DirectX question didn't get answered yet.  RimWorld is using DX 9.0c according to the log file 47a linked.  I think that's the latest DX available to Win7, and if so then we don't need to look any further in that direction.
Title: Re: Game Crash
Post by: Calahan on May 16, 2017, 03:56:22 PM
Okay so how did I miss 47a's reply?!?? No idea. No idea at all ???

Anyway, as milon says it's good to hear that it sounds like you've got the crashing issue under control. Or at least under control in the sense that you now know what's causing it, which removes the random factor (as trying to play a game, or using any software that randomly crashes is simply a nightmare).

I don't know if the cause of this crash will ever improve or disappear. But if you Google HandleD3DDeviceLost Unity you'll get results going back to 2012, so it looks like it's been a persistent issue with Unity for a number of years. Which suggests it's unlikely to just suddenly disappear in the next update. So you might have to get used to not switching to the desktop while playing.
Title: Re: Game Crash
Post by: 47a on May 16, 2017, 04:59:45 PM
Hmm, I avoid switching to desktop until it forces me with a frozen screen, and then eventually crashes after an hour or so of play it'll lock up, audio will continue to play but nothing visually until I switch out and back to it
Title: Re: Game Crash
Post by: Calahan on May 18, 2017, 10:23:54 AM
Quote from: 47a on May 18, 2017, 06:43:30 AM
I found someone having a similar issue and it might be mod related, the 10 jobs in 1 tick issue that requires me to alt-tab and eventually results in a crash, would it be safe to move this to mod bugs?

Edit: my performance is also degrading the further I progress, takes longer to load save files and i start experience freezing\crashing quicker than it was previously

The 10 jobs in one tick bug is probably being caused by a mod. So on that basis this thread should be moved to mod bugs. Although it would be handy to keep the info about the "HandleD3DDeviceLost" error in the support forum because someone may well find the info useful if they search the forums for that error (not least myself or one of the other moderators when someone posts a log file with that error in a few months time :) ).

So what I'll do is split one of your above posts off, move it to the mod bugs forum, and attach your log file to it. As there's probably more chance of finding help about that mod bug in the mod bugs forum than here.

Although to be honest, probably the best way of getting help with a mod bug is to try and figure out yourself which mod is causing the problem, usually by trial and error, and then report the problem to the mod author on the related mod thread. As one of the main problems with mods bugs is that only a few of the moderators (I'm not one of them) are well versed enough in modding to understand what mod is causing the error, and why. And if they are busy with RL (since this job is purely voluntary), then we often have to rely on members of the community to help with mod bugs. But that means it can be fairly random as to whether or not someone receives help with a mod bug, or even gets a response to it.

The above is probably made worse at the moment due to all the A17 testing going on in preparation for its imminent release. Meaning any of the modders who might usually have checked the mod bugs forum to see if they could help, are probably busy updating their mods for A17. So thought I'd warn you that you might be in for a long wait for help with this bug (which may turn into an indefinite wait once A17 is released).


Edit - Okay I've split off your most recent post and moved it to mod bug, but quoted it above so that there's record of it in this thread (and so that my post doesn't look like I'm replying to a non-existent post :) ).
https://ludeon.com/forums/index.php?topic=32571.0

Please feel free to edit your new OP to help better explain the issue, and hope someone is able to help you with it (I would if I could, but unfortunately I have no clue about modding, or mod related bugs :( )
Title: Re: Game Crash
Post by: 47a on May 18, 2017, 04:55:27 PM
Thanks, I appreciate the help :)