Pages: 1
  Print  
Author Topic: hard time debugging  (Read 1239 times)
Offline (Unknown gender) martov
Posted on: July 11, 2014, 12:13:39 PM
Member
Joined: Jul 2014
Posts: 1

View Profile
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?
Logged
Offline (Unknown gender) TheExDeus
Reply #1 Posted on: July 11, 2014, 12:53:23 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
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).
« Last Edit: July 11, 2014, 12:55:01 PM by TheExDeus » Logged
Offline (Male) edsquare
Reply #2 Posted on: July 11, 2014, 02:12:41 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
Maybe including ccdebug would be okey?

http://sourceforge.net/projects/ccdebug/
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Unknown gender) Darkstar2
Reply #3 Posted on: July 11, 2014, 06:32:02 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
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.
Logged
Pages: 1
  Print