The following warnings occurred:
Warning [2] unserialize(): Error at offset 1251 of 1260 bytes - Line: 2650 - File: inc/functions.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
[PHP] errorHandler->error_callback
/inc/functions.php 2650 unserialize
/inc/class_datacache.php 138 native_unserialize
/inc/init.php 182 datacache->cache
/global.php 20 require_once
/printthread.php 16 require_once



MFGG Forums
C++ exception handling - Printable Version

+- MFGG Forums (https://forums.mfgg.net)
+-- Forum: MFGG (https://forums.mfgg.net/forumdisplay.php?fid=4)
+--- Forum: Developer Discussion (https://forums.mfgg.net/forumdisplay.php?fid=10)
+--- Thread: C++ exception handling (/showthread.php?tid=3511)



C++ exception handling - GeneSu730 - 03-15-2026

I have a question. I am creating a new Zelda game engine. It will use bits and pieces of my Mario engine but I will have to change a lot of code. I am using an old version of Visual C++ and Direct X. It does not have smart pointers. However, I was thinking about adding standard exception handling (try-catch-throw). I have been researching several websites and the advice I have been getting is to avoid it because it slows down performance and can make a mess of other things. In particular, game consoles (especially those from Nintendo) don't support exceptions while others (XBox) take a massive performance hit. Do any of you have any thoughts about it?


RE: C++ exception handling - PaulineGamer - 03-31-2026

ive run into this problem with gamedev before. not in C++ but in C#, but im sure the experience will be similar

basically, yes the performance hit will be huge.

i did something silly that caught exceptions when you were changing levels. the game locked up for like an entire half-second from catching a few exceptions. i figured it would be instant, but no, it is very very costly.

especially if you're planning on throwing / catching exceptions on a per-frame basis, this will totally not work. id recommend avoiding them entirely for games