Debugging techniques

scottwoodscottwood Member, PRO Posts: 68
edited February 2018 in Working with GS (Mac)

I'm looking for techniques to help me debug logic errors in my games. What do you do?

At the moment I'm using a display text rule to watch the value of an attribute, which is increasing is twice as quick as it should.
Now I need some way of tracing rules that affect this attribute.
I'm pretty sure the only way is to read through all rules one by one, but I'd love to hear from more experienced GS users about how they would tackle this.

In excel I can visually display dependents and precedents, if I'm writing something for a web site I can use the developer console / DOM inspector and it looks as though GS might be able to do something similar.
There is a good article in the knowledge base (http://help.gamesalad.com/knowledge-base/396/) and it shows that Gamesalad can do something similar,

but other than the use case mentioned in the article I can't see how to invoke this feature to make use of it for debugging.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Use Log Debugging Statements within your rules. Then open the Log Debugger window while previewing your project to see when and in what order the statements appear.

    More info here: https://gamesalad.com/2012/02/03/question-of-the-week-using-the-debugger/

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • scottwoodscottwood Member, PRO Posts: 68

    Many thanks @tatiang. Now I know how to use the debugger it should be really useful. One technique I'm also going to try using in future is to create a series of algorithm statements for the game overall and about each actor, all in one document. If I find a particular attribute is not behaving as I expect I can then search the document for reference to the attribute and work back through the logic in my algorithms to help trace the problem. Creating and updating the algorithm statements will be a pain, but for the project I'm working on (incorporating a quiz into other peoples templates) it's very difficult to just look through uncommented logic stacks and work out how things affect each other.

Sign In or Register to comment.