Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411430 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 10:56:56 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Exceptions after release
Pages: [1]
Print
Author Topic: Exceptions after release  (Read 624 times)
patico
Level 0
*


View Profile
« on: November 24, 2017, 12:01:09 AM »

Hi there,
I'm wondering, how do you handle unexpected exceptions and crashes after game launched/released? How do you getting know if your game works fine or not on the player's side, especially when you release on few platforms?
Is there any best practices or solutions to catch exceptions after release?

or maybe "release-and-foget-it" is the best strategy?  Gomez
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #1 on: November 24, 2017, 12:23:52 AM »

I used to check the Steam forums for complaints. Since the dawn of time I have code in place to write a stacktrace to the logfile when a crash or exception occurs. Whenever someone complains about crashes I ask for the log. Works mostly. Except when you support OSX or Linux - on these systems things tend to break easily and quickly, and especially Linux with it's million combinations of runtime, window manager, GPU drivers, OS zealots refusing to install the NVidia proprietary driver and so on is a pure maintenance nightmare.

If I ever do another project, I intend to not support anything else but Windows. The 2% of additional revenue does not justify being screamed at by entitled whiners who don't want to click "Refund" for unstated reasons.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
oahda
Level 10
*****



View Profile
« Reply #2 on: November 24, 2017, 12:28:24 AM »

Sad pls support me i'm not windows

How are you getting the trace after the program already crashed? I've never tried catching arbitrary crashes before so I actually don't know how that works. Try-catch clause around the whole program? Cheesy
Logged

Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #3 on: November 24, 2017, 01:00:30 AM »

There's a bunch of different things to take care of.

a) exceptions. Like throw Stuff(); - You can try-catch globally, but the stacktrace of the origin would be lost. I use a macro ThrowException(...) or similar, which then invokes some code I got from the internet like 15 years ago. Nowadays there's boost::stacktrace - maybe just use that.

b) crashes. Like SEGFAULT and friends. On Windows there's SEH - Structured Exception Handling. I copied some code off the internet 15 years ago, I think it was called WheatyExceptionHandler. Of course you need different code on Linux / OSX - GoogleTest does this, for example. It also catches crashes in your unit tests and allows you to handle or even EXPECT those, so it definitely has code to handle these situations. It might be a simpler source to rip out the code from than boost.

There's also All-In solutions like GoogleCrash, but those are huge and not easy to set up. What they do is basically run your game in a separate process and observe that process for crashes/stalls, firing off emails / web requests / you-name-it in case of distress. Alternatively on Windows, you can enable MiniDumps for your application via some method which escapes me right now. The resulting dump file is a few hundred kb in size - you can ask your players to email you that file instead.

GoogleCrash, the MiniDumps and so on also have the advantage that you don't have to deploy debug symbols along with your game. I did this - on Windows I put the .pdb files next to the executables, on Linux... erm... I did something different. Amounted to 50MB in addition to the 3MB executable, but it compresses well. A usual Splatter update on Steam only updating the executable was ~9MB in size.

Sorry for the many vague references, I'm off of game development for a while now, and haven't touched the associated code in years.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic