Announcement

Collapse
No announcement yet.

The way to debug unrealScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    The way to debug unrealScript

    Guys, how do you debug unrealscript? I cannot afford license for nfringe and AFAIC this is the only soft which is fully compatible with UDK and does the debugging.
    So how do you do it if you do not use nfringe?
    Regards

    #2
    Nfringe is not necessary to debgug unrealscript at all.

    Minmally all you need is a text editor with an unrealscript highlighter.

    The error/warning log you get while you compile isn't a part of the script editor, so you get that no matter what you use.

    Comment


      #3
      Hi, when I was talking about debugging I meant that I'd be able to execute unrealscript line by line while seeing current state of variables etc in actual IDE, not log file. So what I meant is the traditional meaning of debugging, that is, set breakpoints, run debugger and so on, not log values of variables to a file and then read it.

      "Minmally all you need is a text editor with an unrealscript highlighter." - you don't need unrealscript highlighter in order to neither write nor debug unrealscript, nor compile it.

      Comment


        #4
        I only mentioned the highlighter as a realistic basic have that you would always have.


        ¨you don't need unrealscript highlighter in order to neither write nor debug unrealscript, nor compile it.
        So you've answered your own question then.

        I've never needed Nfringe for my unrealscript debugging, I have no idea why using logs, checking on the lines of any errors and warnings and backtracking through functions suddenly would be a bad thing.

        Comment


          #5
          "So you've answered your own question then" - no I didn't. My question was "how do you debug unrealscript", the part of text you're referring to is: "you don't need unrealscript highlighter in order to neither write nor debug unrealscript, nor compile it"

          Let's put this next to each other, in order, question and answer and see if it makes sense:

          Q: how do you debug unrealscript?
          A: you don't need unrealscript highlighter in order to neither write nor debug unrealscript, nor compile it.

          It is like talking to not the most bright cyborg, don't you think?

          "I have no idea why using logs, checking on the lines of any errors and warnings and backtracking through functions suddenly would be a bad thing" - this simply could spawn from the fact that you never really programmed seriously. If you did, you'd know for sure that debugging (the meaning I've explained) is something that real programmers do more than actual coding on every day basis.

          Comment


            #6
            I don't think you're quite understanding me.

            I am perfectly aware that there are functions in some programs that allows you to debug scripts at run-time. I'm just saying that you shouldn't need to use them.
            Everything you need to do debugging is already in the language and udk itself.

            (Of course things don't make sense when you break them out of context)

            Comment


              #7
              1. Do you know what a debugger is?
              2. Did you ever use one (on a professional project, not just run it and switch it off)?

              Comment


                #8
                There are some other "free" softwares too. nFringe is best however these are good too.

                http://uside.codeplex.com/
                https://code.google.com/p/unreal-debugger/

                and some others. You can try to use search and maybe you will find some other softs.

                I use it rarely when I have really no clue what is happing in bugged code.

                Comment


                  #9
                  @nonder thanks a lot, will try them for sure.
                  Can already say that codeplex looks great to me as it uses VS. Really many thanks!

                  Comment


                    #10
                    I don't use step-through debugging in UScript. Generally speaking, I'll statically debug with logs instead.

                    Comment


                      #11
                      "statically debug with logs instead." - inefficient, works for simplest scenarios only.

                      Comment


                        #12
                        I also think that `log is enough in a simple language like uscript...

                        Comment


                          #13
                          Originally posted by smallB View Post
                          "statically debug with logs instead." - inefficient, works for simplest scenarios only.
                          It works for me. Log file + intuition. I haven't used a debugger for almost a decade.

                          Edit: to be clear, using the 'log' in UDK is a dynamic process because you should have the log console open alongside the game at all times.

                          Comment


                            #14
                            "It works for me. Log file + intuition. I haven't used a debugger for almost a decade." - because you do not program complicated enough tasks. If you have had done so, then simply put programming without debugger is impossible. As simple as that. During my over 10 years spent as a C++ programmer I never ever heard of anyone who do their job (programmer's job that is) without debugger - it is simply not happening nowhere in the world. But if you doodle and change line here and there and add line or two then sure log is plenty. For real programming you simply have to use debugger (and other tools like test cases/scenarios etc).

                            I do not want to offend you nor anyone else, but when someone tells me that they didn't use debugger for almost 10 years (while doing serious programming) I simply come to conclusion as the one above.

                            Comment


                              #15
                              I've been working with Unreal for six-seven years now - when I first got started, there was no step-through debugging - people managed to work that way just fine before it started being introduced. Unrealscript is a fairly simple scripting language; good defensive programming and debug-logging practices should catch the majority of issues before you even need to consider a debugger - it's not like you can accidentally splat over a memory address from another thread or any other similar horror scenario.

                              Step through debugging is a useful tool, but you sound like you're using it as a crutch, which will only slow you down and prevent you really getting to grips with your problems. If you can't debug your own work without it in an environment as simple as UnrealScript, I'd say you need to reevaluate your debugging habits. There's a pretty good anecdote by Kas Thomas over on AssertTrue() to this effect, and I'm sure it would take literally seconds to find many similar articles:

                              Years ago, when I was first learning to program, I ran into a problem with some code I was writing, and I asked my mentor (an extraordinarily gifted coder) for some help. He listened as I described the problem. I told him all the things I had tried so far. At that time, I was quite enamored of the Think C development environment for the Mac. It had a fine step-thru debugger, which I was quite reliant on.

                              My mentor suggested a couple more approaches to try (and when I tried them, they worked, of course). Then he made a remark that has stayed with me ever since.

                              "I try to stay away from debuggers," he said. "A debugger is a crutch. You're better off without it."

                              I was speechless with astonishment. Here was someone who wrote massive quantities of Pascal and assembly for a wide variety of platforms -- and he never used a debugger! I couldn't have been more shocked if he told me he had perfected cold fusion.

                              "If you get in the habit of using a debugger," my mentor pointed out, "you'll get lazy. A certain part of your brain shuts off, because you expect the debugger to help you find the bug. But in reality, you wrote the bug, and you should be able to find it."

                              Still stunned, I asked: "What do you do when you have a really nasty bug?"

                              He said something I'll never forget. "I make the machine tell me where it is."

                              Make the machine tell you where the bug is. What a wonderful piece of advice. It's the essence of troubleshooting, whether you're trying to fix a car that won't start, trace an electrical fault, or debug a piece of software.

                              My friend (who did a lot of "realtime" programming in assembly, among other things) pointed out to me that there are many programming scenarios in which it's impossible to run a debugger anyway.

                              I took my mentor's advice and stopped using a step-through debugger. The only real debugger I continued to use (at that time) was Macsbug, which I occasionally invoked in order to inspect the heap or see what was going on in a stack frame.

                              Sure enough, I found that once I stopped using a step-thru debugger, my coding (and troubleshooting) skills improved rapidly. I spent less time in "endless loops" (fruitless troubleshooting sessions) and got to the source of problems quicker. I learned a lot about my own bad coding habits and developed a renewed appreciation for the importance of understanding a language at a level deeper than surface-syntax.

                              To this day, I avoid step-thru debugging, and find myself better off for it.

                              If you do a lot of step-thru debugging, try this as an exercise. For the next month, don't use a debugger. See if you can walk without crutches for a change. I'm betting you'll lose the limp in no time.
                              Source: http://asserttrue.blogspot.de/2009/0...-debugger.html


                              Coincidentally, I've also worked in C++ environments where step-through debugging and even logging strings of any length is a complete impossibility - what would you do then?

                              Comment

                              Working...
                              X