Release and Debug, what's the difference? Created 4 years ago2020-02-21 00:24:12 UTC by Cabo Fiambre Cabo Fiambre

Created 4 years ago2020-02-21 00:24:12 UTC by Cabo Fiambre Cabo Fiambre

Posted 4 years ago2020-02-21 00:24:12 UTC Post #343757
As the title says, what's the difference whitin the both?
Posted 4 years ago2020-02-21 03:58:07 UTC Post #343761
Debug mode won't perform certain optimisations (such as inlining functions), in order to make debugging easier. It also defines the DEBUG and _DEBUG macros which you can use to run code only in debug mode, like so:
#if _DEBUG
    ALERT( at_error, "This code won't run in release mode!\n" );
#endif
Release mode is intended for the "final build" of your mod that you release, which will enable performance optimisations and disable the debug-only code or messages.

If you're using the standard unmodified SDK, compiling in release mode doesn't make much of a big difference - but Spirit of Half-Life will do things in debug mode that you definitely don't want in release mode, such as showing sparks above an NPC when they don't have a valid schedule.

As a general rule:
  • Compile in debug mode during development
  • Compile in release mode for test/final release
Penguinboy PenguinboyHaha, I died again!
You must be logged in to post a response.