ENIGMA Forums

Outsourcing saves money => Programming Help => Topic started by: martov on July 11, 2014, 12:13:39 PM

Title: hard time debugging
Post by: martov on July 11, 2014, 12:13:39 PM
hi everyone

I dont really understand how to debug my code. it's taking me ages to find really silly mistakes :P

am i missing something? how do you people debug your games?
Title: Re: hard time debugging
Post by: TheExDeus on July 11, 2014, 12:53:23 PM
Yeah, It's something we could improve upon.
The idea is if you launch Run->Debug, then your game is compiled in a way that they show many errors. Most common is the use of uninitialized variables - it will show the event and the trace back on where you have it. It will not show the position or the name of the variable right now though. I think we really need to add that.
It will also show things like using nonexistent resources (sprites, background etc.). In GL3 it will also show problems with shaders. All of these errors/warnings are for now outputted to console though. So if you want to see them, then you must open a new console window (cmd on windows) and run the game from there (copy the filepath+filename from LGM console). We should probably add that when you run in Debug mode console is visible from the start.
So yes, in this regard we have to still add a lot.

edit: Also, as ENIGMA's compiled .exe's are just C++, then you can also use tools like GDB. But I don't think people using ENIGMA should be forced to use a tool which is not that easy to use (it actually is easy, but uses a console, which for kids is a big no no).
Title: Re: hard time debugging
Post by: edsquare on July 11, 2014, 02:12:41 PM
Maybe including ccdebug would be okey?

http://sourceforge.net/projects/ccdebug/
Title: Re: hard time debugging
Post by: Darkstar2 on July 11, 2014, 06:32:02 PM
It requires good skill, but once you get the hang of it, it's easy.

The way I debug my stuff is I add a controller object and use the draw event to draw information I am testing, variables, states, etc...... I've done a lot of debugging in my days and I have discovered and fix bugs I never would have been able to otherwise.