Game Development Community

Pointers for troubleshooting a problem

by Steve D · in Torque Game Engine · 03/29/2007 (8:13 am) · 5 replies

Hi all! I'm still somewhat new to the torque engine even though in the last 3 months I have come a long way. One of the most frustrating things for me is I simply don't know how to break down a problem. For example, last night I loaded up the rpg from codesampler and it doesn't fire (this is in my custom map). I have easily made it work before so it's probably something stupid.

But I don't know what, if any, tools or methods are available to troubleshoot a problem. I looked at the console and I don't see any errors at all. Are there any other mainstream, generalized methods or functions (besides dump() ) that I can apply to on a step by step basis to narrow down a problem? In the above example I don't even know where to start as to why it isn't working. I know I can probably echo stuff to the console but are there any other ways I don't know about that would be helpfull?

#1
03/29/2007 (8:32 am)
Well, you have started the right process. Here's my general debugging steps:

Desired results not happening, but no crash:
  • Run app[li]Test feature[li]Check console before closing for error[li]Close app[li]Check console log for string "syntax error"[li]Check console log for string "error"[li]Check console log for string "unable"[li]Run app in debug mode from Torsion, with breakpoints strategically placed around feature script execution, initialization (if applicable), and feature usage[li]While stepping through script code, check for error messages, bad values, or wrong variable usage[li]Repeat breakpoint/debug process until solution is found
Crashing app:
    [li]Check console log for last entry before crash[li]Place breakpoints where applicable before crash occurs[li]Check function names and variable usage for bad or non-existent values[li]Hook compiler into already running application before crash[li]Debug in compiler at crash site
#2
03/29/2007 (1:10 pm)
Thanks Michael, where would I find the console log? That is something I wasn't aware of!
#3
03/29/2007 (1:26 pm)
Check in the example folder, should be named console.log.
#4
03/29/2007 (2:00 pm)
Thank you.
#5
03/30/2007 (5:56 am)
Another thing I use sometimes is:
trace(true); // trace on
trace(false); // trace off

It gives more details in your log, and if your game is crashing it shows where.