GM:S 1.4 Introduction to using the Debugger

Discussion in 'Tutorials' started by Pixelated_Pope, Jan 27, 2017.

  1. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    784
    GM Version: GMS1 1.4 and beta version of GMS2
    Target Platform: Windows
    Download: N/A
    Links: N/A

    Summary:
    This video tutorial is a brief introduction to using the debugger. It goes over how to select and organize your panels, set breakpoints, observe variable values, and step through code. If you've been ignoring the debugger because it seemed too complicated, this tutorial is for you!

    Tutorial:
     
  2. Xer0botXer0

    Xer0botXer0 Member

    Joined:
    Jun 29, 2016
    Posts:
    670
    Does this cover the various windows as well ?
     
  3. Roderick

    Roderick Member

    Joined:
    Jun 22, 2016
    Posts:
    577
    I've been ignoring the debugger because if there is any documentation, I haven't seen it, so it was easier for me to just inject debugging code to track things. To tell the truth, I don't even know how to access the debugger!
    /em hangs head in shame.

    I'll definitely be taking a look at this later!
     
  4. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,869
  5. Roderick

    Roderick Member

    Joined:
    Jun 22, 2016
    Posts:
    577
    To be fair, there's a LOT of stuff in the maunual, far more than what I've actually read. It's kinda common for me to find out that (insert amazing thing here) exists through a third party, and only later find it in the manual.
     
  6. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    784
    It covers SOME of them. I would need to do a much longer video. But there is a great description of each of them in the manual. If you have questions about how to use a specific panel, feel free to ask here and I'll do my best to explain it.

    Yeah. As crazy as it sounds, you really should read through the ENTIRE MANUAL at least once. Yes, it sounds nuts... but game development is hard and time consuming already. It's worth the time investment just to know what's in the manual. You won't memorize it, obviously, but having a small entry in the back of your brain of what's in the manual can save you some serious headache in the future.
     
    TheMatrixHasMe likes this.
  7. TheMatrixHasMe

    TheMatrixHasMe Member

    Joined:
    Jun 22, 2016
    Posts:
    176
    Exactly this. The manual should be your Bible.
     
  8. Ambition13z

    Ambition13z Guest

    You sir, have helped me quite a bit with this video alone. You also just earned yourself a new subscriber on YouTube!
     
    Brandiin likes this.
  9. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    784
    Awesome! Glad it helped you out!
     
    Brandiin likes this.
  10. mjadev

    mjadev Member

    Joined:
    Jan 28, 2017
    Posts:
    51
    thanks a lot for this tutorial !
    I'm a new comer to GMS2 and this tuto opened me the debugger, which is far from being intuitive from my point of view
    I agree that there are a lot of info in the manual but a short video like this is much more efficient to discover the basics of some subjects.
     
  11. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    784
    Thanks! Yeah, this is really just getting your feet wet, but sometimes that's all it takes to get people who would maybe see the ocean and just turn around not wanting to deal with it to jump in and really having fun with it.
     
  12. Kuro

    Kuro Guest

    Thanks so much, this tutorial was exactly what I've been looking for!
     
    Pixelated_Pope likes this.
  13. mdbussen

    mdbussen Member

    Joined:
    Jul 8, 2016
    Posts:
    62
    Great Video and a good introduction to the debugger. But I'm pretty sure that the best way to debug your scripts is to just insert a ton of show_debug_message prints :)

    I would love to see a follow-up video on profiling and optimizing your game using the debugger as that is probably a fairly common use case.
     
    Kuro likes this.
  14. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    784
    Yeah, I think one for examining surfaces/texture pages and performance would be useful. It's on the list... the list is getting a bit overwhelming...

    Glad you found it useful, though. And, hey, nothin' wrong with a bunch of show_debug_messages. I actually wrote my own debug log script:
    Code:
    /// logf(text, args...)
    var text = argument[0];
    
    for(var i = 1;i < argument_count;i ++) {
        text = string_replace(text, "%"+string(i), string(argument[i]));
    }
    
    show_debug_message(text);
    You can use it like this:

    Code:
    logf("Player's Position: %1,%2",x,y);
    And you'll get: "Player's Position: 25,42.12" in your output window. Very handy.
     
    Kuro and mdbussen like this.
  15. Kuro

    Kuro Guest

    Totally agree that debug messages are the best thing since sliced toast. I don't like GM:S 2's built in console though, so like Pixelated Pope I wrote a script that outputs them to a debug log file instead. I found a windows program called tail that can display log files and auto updates when they change. While searching for it I read that notepad++ also has that feature.
     
    Last edited by a moderator: Apr 25, 2017
  16. YunaKozue

    YunaKozue Member

    Joined:
    Jan 19, 2019
    Posts:
    1
    Thank you so much!! I was super stuck for a week cause I couldn't get the source tab back, so this really helped me X'D
     
    Pixelated_Pope likes this.
  17. tuegg

    tuegg Member

    Joined:
    Apr 23, 2019
    Posts:
    7
    This is super handy - I wish GameMaker had more documentation on the debugger.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice