Bug Squash!

I got to the bottom of my bug list today. And something evil and foreboding stared at me. The bug said ‘Make the game recover properly from DXGI_ERROR_DEVICE_REMOVED.’

About a month ago I was complaining about this hardware bug that I’ve been experiencing. Basically my video card is failing and stops rendering randomly in the middle of the game. Due to its annoying nature and unpredictability, I had put it on the bottom of my bug list as a low priority task. So with only this one bug left (well, only bug on my current list), I decided to make an attempt of fixing it.

Knowing that it was hard to reproduce reliably, I wrote code so that at a key press the graphics system would reset itself. It releases all graphics resources, resets the video device, and then reloads all resources from disc where possible, or it recreates any that are dynamic. Once I got this working by pressing a key, I hooked it into handling the failure case.

Happily and luckily, the hardware issue decided at that moment to start showing itself, making the testing of my fix fairly easy.

So after a few hours of coding I can now recover from a device removal. This process takes about two seconds, and while that’s quite a stutter, it will at least let players save their progress should should they start experiencing this problem.

This also means the game is able to continue running while installing new graphics drivers. Wonders will never cease!


    September 17, 2013 8:03 pm

    Thanks for taking the time write these posts. It’s fascinating to see the internal processes polishing a game like this.

    Very much looking forward to playing it.

    September 17, 2013 8:04 pm

    Nice job.
    Bug hunting is not always fun, but it helps get this closer to the point where I can give you my money!
    Keep up the good work!

    September 17, 2013 8:06 pm

    I’ve only been following this for a week or two so far, but I have to say it is really my most anticipated game so far. I can not find a game similar to this anywhere. That said, the fact that you are talking this yourself, just you, is simply mind-boggling. Kudos to you.

    That said, the fact that you have found a way to keep a game running despite massive gpu failure, is another awesome achievement.

    Keep up the good work. Also, when can I buy it? 😀

    Tom Duhamel
    September 17, 2013 8:21 pm

    Interesting. When you discussed this bug before, it sounded like you absolutely needed to save a massive amount of redundant data in order to handle it. Now, it sounds like you can handle it in a matter of just a few extra code lines. Ah, what a month of thinking can make :)

    September 17, 2013 8:28 pm

    Is there any concern that forcefully restarting the gpu when this error occurs is harmful to the gpu in the case that this happens repeatedly or in the middle of driver updates?

    September 17, 2013 9:19 pm

    Not sure how often you’d want to be updating your graphics driver while having anything running, but good to know it can handle it. :-) kudos to the creative handling of that case though.

    Steven Christian
    September 17, 2013 9:57 pm

    Brilliant! All too often we give up when we get a graphical issue; we seem to forget that the game is running just fine in the background behind a blank screen 😉

    September 17, 2013 10:51 pm

    Interesting, Simple fix aswell, Wouldn’t mind hearing more about the other bugs you’ve squashed

    September 17, 2013 11:41 pm

    Wow, I’m impressed. Continue a session despite a change in drivers… crazy.

    Also, I just want to add to the community voice saying that I’m enjoying the extra updates. Long posts are always great, but if you’ve got something to say, even if it’s short, we have ears for it.

    September 18, 2013 3:42 am

    So with this being the last bug in your list, does that mean we might get a preview soon?

    The things I would do to play this game.

    September 18, 2013 4:42 am

    Does that mean you’re out hunting for more bugs, going on your bike ride to the river, or getting ready for a preview? :)

    Really enjoying reading your insights, keep them coming.

    September 18, 2013 5:15 am

    2 posts in as many days… must mean its almost time!!!!

    Mustn’t it?

    September 18, 2013 2:50 pm

    I look forward for your game to come out,i will be from the first support that will buy it 100 % it’s like the game of my dreams.

    One suggestion if you mind : When in the game will have bad weather , i would like to see the water to be like “rough” like a storm,with waves and so on.

    Only a suggestion.
    Keep it up.

    September 19, 2013 7:05 am

    It’s interesting how lightly you put some thing like this, this is one of those cases that could’ve been hours and hours of work yet you’re like bah.. after a few hours of code we’re good lol.

    More importantly though, most wouldn’t even address this at this stage. Guess it shows you’re looking after the game, should be a good solid reliable game play, can’t wait !

    General Funky Feel
    September 20, 2013 9:08 am

    “This also means the game is able to continue running while installing new graphics drivers.”

    For some reason I found that line absolutely hilarious.

    September 20, 2013 2:29 pm

    Now that’s what I call graceful error handling :) Kudos.

    Did you by any chance test how screen capturing programs (fraps, dxtory) react to the graphics system resetting itself?

    David Colombia
    September 25, 2013 5:07 pm

    sin duda es un excelente juego, lastima que vivo en un país subdesarrollado y todo llega supremamente tarde, éxitos en tu juego, cuando esté a la venta seré el primero en adquirirlo. 😀 desde Colombia.