How do I debug things better?

0 favourites
  • 7 posts
  • Hi there,

    I'm not sure if there might be ways to do some of this that I just don't know how.. but I've been working on a project that its a little trickier than past games to manage various moving parts and such.. and i'm starting to notice some things that would be nice to have but maybe are already possible and I just don't know so here are the things i'd like to be able to do:

    • select an object from the projects folder and know every scene the object can be found in
    • have a search window in the projects folder to be able to find a particular object (things getting lost/misplaced in various folders
    • search for something and it check all event sheets not just the one i'm in. This is really helpful to insure something in particular is completely removed from any / all event sheets so no fear of lingering stuff still causing trouble.

    I think the overall thing that would be helpful here are "global searches" which might allow a user to trace down something that is referenced throughout a project.

    I tend to like breaking up things into separate event sheets to help keep code more modular and manageable, however doing this tends to complicate debugging because i might not remember where something was referenced and have to then do multi event sheet searches..

    So yea any advice on better ways to debug problems like this is welcome.

    Thanks!

    Caleb

  • You can use the "Event Search" under the Events tab. Just type in an object name, and it will limit the present Event Sheet to only events including that object.

    General debugging tactic is to have a debug layer on top with an odd colored text box and output parameters as needed to check their value, or use if/then to display text representative of other properties.

    The greatest enemy of mine so far has been the asynchronicity of JavaScript. Every one of your events goes off at the same time, and you have to use flags or gates to stop that and force it to behave synchronously.

  • event search.. yea very handy, but it's only per event sheet.. i like to break things up into different specific event sheets "monster event sheet" "player event sheet".. it would be great if there was a way to scan all of them in a search without having to go into each of them to find the thing you're looking for..

    how do you use flags or gates (what's a gate?). I know there are bookmarks but honestly i've never found them that useful.. i'm sure they are i just haven't applied them ever. I know breaks are commonly used in code and i thought construct 2 had them though I've never come across them if that's the case.

  • Yea, it would be nice if it searched across event sheets.

    The gate is the piece of code that watches the flags. Compares the flag to the proceed value, stopping the flow of execution until the flag value is set appropriately. You can also gate on other things than flags, like layer/sprite visibility.

  • ah ok interesting.

    yea see what i would love to see is imagine being able to "get info" about a particular variable or object.. imagine being able to see how many times a certain variable is being used.. and by what.. i've had variables i made and ended up not needing/using.. but they sit there and i have spend time tracing down if it's relevant anymore.. which just becomes a hassle to hunt down over multiple event sheets...

    So yea it would be great if maybe Construct 3 could consider making the tool better for getting more information about objects in a given game especially more involved / complex games.

  • As far as getting info, for instance, I will have a boolean that checks whether a layer is visible, then just print "true" or "false" next to the "Layer X is visible: " line in my debug text box.

    I don't know of any better way to debug multiple sheets though, sorry.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • yea i don't think there is really.. it's not about layers though.. it's about knowing where to find things quickly throughout a project.. if i click on an object.. i'd love to know where that object is located.. in what layer.. not at runtime but while developing.. if you have multiple layouts.. and say multiple objects that look very similar.. finding which one is the right one can be a tedious process.. or ones that are hidden.. or behind objects in layers.. any number of reasons..

    Stuff like this would be super if they could incorporate it in Construct 3..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)