• MJBrune@beehaw.org
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    The issue is a debugger will trigger every time. In video games at least you have code that runs as over and over again in tick. Putting debugger breakpoints in that would be useless most of the time. Print is where it's at for ticking/timer debugging.

    • Backslash@feddit.de
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Many debuggers (at least in the Java world, which is what I'm working with for a living) support more advanced features like only triggering the breakpoint if a certain condition is reached or only every X hits of the breakpoint.

      Also, if you try and debug using print in the main game loop, wouldn't that write so much to console/log that it's effectively unreadable?

      • MJBrune@beehaw.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        So first, visual studio had that too but the integration with unreal is hit or miss. You can't really do complex conditions.

        Second, you lock it behind a conditional and it's much easier to read. Like if you want to ensure the force curve of your jump matches what the float curve you give to the designer is set to then printing out and spot checking a few is much better than using float compares that would be broken in the same way in certain platforms where floating point data is interpreted differently. So you are the data on Windows, it's different on Linux and this you can't just compare it because it matches just like it would in windows.

        Third, if you really want you don't print to screen instead of log which if you give a key entry, it will just update it rather than spam your screen.

        Overall even the most experienced engineers in the games industry uses printing of the values at times. Debuggers are of course still very preferred for most things.