Request for AGS 4: Auto disable Debug mode

Started by Joacim Andersson, Wed 20/11/2024 14:12:41

Previous topic - Next topic

Joacim Andersson

Today, I must open the General Settings and turn off Debug mode. It would be nice if debug mode was only on when I compile with the debugger attached (F5 key) and not otherwise. It's so easy to forget to turn Debug mode off before a release, and all the handy Debug() function calls are still available in the game.

I don't know about the complexity of this request, but I don't imagine it would be that hard to automatically inject the DEBUG definition based on how I choose to compile the project.

Crimson Wizard

#1
It's not at all complicated to do such thing on its own, but the thing is, Debug mode is meant not only for testing inside the Editor, it may as well be used when running a prepared game distributive.

People normally add various testing utilities into their game, like commands and guis that let fast-forward the game or cheat, etc. And then they may want to send their compiled games to testers. If "Debug" would automatically get disabled when you build the game, that will cut off such opportunity.

This has to be done differently.

E.g. there could be two different menu commands: Build Game for Debug, Build Game for Release.
or something similar.

Joacim Andersson

Quote from: Crimson Wizard on Wed 20/11/2024 14:55:14E.g. there could be two different menu commands: Build Game for Debug, Build Game for Release.
or something similar.
I agree that sometimes you want to distribute a debug version, your suggestion of two different menu commands is a great idea. Then it's far less likely that you distribute a debug version by mistake.

So I change my request to that.  :smiley:

Crimson Wizard

What we likely need in AGS is a way to setup Build Configurations, like in proper IDEs.
I cannot remember if we had such topic already somewhere on forums, but we definitely talked about this in the past.

There are at least 2 options currently in General Settings, that rather belong to a build config: Debug Mode is one, another is Build Targets which let select platform to build for (Windows, Linux, Android, ...).

If we had a menu to setup build configurations, these configs would include debug mode and build target(s) selection, and maybe more, like additional compilation flags for script, extra files to package, and so forth.
This is to outline the idea.

Joacim Andersson

Yes, that's how I'm used to working in Visual Studio and other IDEs.

eri0o

I have made a version of AGS Editor somewhere (I thought I had photos here in some topic but can't find) that has a Build node where you can add targets and build configs in a matrix way, and also disable the specific builds directly in the Project Explorer. It wasn't fully functional but I may have it in some archive.

SMF spam blocked by CleanTalk