Search Unity

Graphical Analyzing - a debugging tool for programmers [RELEASED]

Discussion in 'Assets and Asset Store' started by recon, Aug 28, 2012.

  1. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    The Graphical Analyzing Tool can help programmers visually measure, compare and analyze values that change over time.

    Okay but what does it actually do?

    Well the first part of the plugin keeps track of these graphs that you create (they automatically get created the first log call you do) and uses them to record values, both in memory (fixed amount) and also streamed to disk (endless) while your game is running.

    While this is happening you can view these recorded values drawn as lines on a timeline in the editor window included in the package,
    the second part of the plugin.
    Since the values are streamed to disk, after the game is stopped all your recorded graphs will appear in a list which you can select and load in to look at in detail.

    This is useful for debugging things like:

    o Physics
    o Animation
    o AI
    o State machines
    o Timers
    o Math calculations

    and much more.

    Having values displayed graphically can drastically help the programmer quickly see relationships between values and find problems that the old fashion step-by-step debugging method would have taken ages and been an extremely frustrating process.

    All graphs can be viewed in a separate editor window during runtime and loaded back in after the game is stopped for a detailed investigation.
    The plugin works in Unity Basic as well as Pro.

    [Read the full article on how the tool helped me solve problems other ways of debugging couldn't: http://rapidgamedev.blogspot.se/2012/08/graphical-analyzing-in-unity.html]

    Contact
    If you have any further questions you can email me at rapidgamedev at gmail dot com







     
    Last edited: Aug 28, 2012
  2. DigitalGlass

    DigitalGlass

    Joined:
    May 12, 2009
    Posts:
    88
    And you just made me realize that this tool is the answer to debugging all of my problems :D. You should post why you made this tool in this topic so people don't have to click on a link to understand the context of how this tool is used.
     
  3. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Thanks :) I updated the description text on the top to include more information on some of the typical usages.
     
  4. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    If you decide to grab the plugin, I would love to know if the example documentation is sufficient or if you want me to include more. And of course any feature requests etc. :)
     
    minowa_236 likes this.
  5. holyjewsus

    holyjewsus

    Joined:
    Mar 7, 2011
    Posts:
    624
    going to pick this up, looks so useful.
     
  6. DigitalGlass

    DigitalGlass

    Joined:
    May 12, 2009
    Posts:
    88
    The documentation looks pretty straightforward imo. Will let you know if there are any feature requests
     
  7. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    This look a bit awesome :) I think I'll pick it up.. Good job.
     
  8. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Thanks for the comments!

    I just pushed out an update to the asset store, so it should be live in a day or two.
    The new version has a feature called graph linking, see below:


    (Click images to enlarge)


    The new feature lets you connect graphs together so it's now easier to view relevant values that span several graphs.
     
  9. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Please tell me that it works in javascript :)
     
  10. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Yes - all languages are supported.

    The example script that comes with the plugin is written in C# but it should be almost no different than how you use it in unityscript for example.
    If you need any help just let me know :)
     
  11. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Ok thank you.. I'm sold :_)
     
  12. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Just a heads up, the new version is now live in the asset store.
     
  13. funasylum

    funasylum

    Joined:
    Feb 5, 2011
    Posts:
    48
    This looks like a fantastic tool! I'm curious-- how does it handle things like string variables or enums? Do those show up in the graph? Or do they fire 'events' when they change like you illustrated in the mousedown example...?

    Thanks!
     
  14. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Since enums can be represented as a numerical value, it is possible to log enums simply as
    Code (csharp):
    1. Graph.Log("someState", (int)myEnum);
    and the enum would show up as a line in the "someState" graph just like any other value would.


    Strings on the other hand cannot be numerically represented so that's when you can use
    Code (csharp):
    1. Graph.LogEvent("myGraph", "Enter text message here");
    Events show up as small dots (cyan colored in the example pictures on the top page) which you can hover over to read their message.

    Note though that this tool purpose is mainly to log and draw numerical values, so I put in event messages as an option just for the convenience.
    I might consider doing something like an advanced event logger in the future, but for me Debug.Log() and break points have usually got the job done.

    Hope that answer your questions. Thanks for the feedback :)
     
  15. funasylum

    funasylum

    Joined:
    Feb 5, 2011
    Posts:
    48
    Okay great-- thanks for your reply!
     
  16. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Due to popular demand, a new feature has been added which lets you create and render graphs in game, both in screen space and world space.
    This new update will not be available until Unity 4 comes out, because it uses a feature that will unlocked for non pro users.


    Here's some screenshots:

    $3dExample.png

    $GraphLiveExample.png
     
  17. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    If the data is written on the disk, can't they be used later, aka replay the data?
    I know this has nothing to do with replay and it's fine as it is really, but I had to ask :)
     
  18. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Well that's an interesting question, a replay system certainly share many similarities but there are a couple of reasons of why it wouldn't be a good solution straight out of the box:

    * The graphlogger uses a simple uncompressed text format for storing values. For large replays, you would most likely want to use a binary format, combined with some kind of compression on that data so it doesn't grow ridiculously large. The graphlogger was built for relatively short recording sessions.

    * All values are stored as 32 bit float's including timestamps, and so if a replay session goes on for more than say - 20 minutes or even less, there is a chance that the values will slightly differ as time increases which could lead to weird behavior.

    Just because the new version will support real time usage doesn't mean it's the best solution. In fact - I might include the source code in the next release so people can tweak it and optimize it etc, if they want to use it for any other purpose that it was intended for.
    So I guess you could use it as a starting base for a replay system, but it would require a lot of tweaking.
     
  19. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Alright, as promised I just pushed out an update (1.2) that's live on the Asset store.

    This updates includes:
    * New user interface options (see image below)
    * Graphs can now be rendered live in the game window
    * Added graph bars (see image below)

    If you are interested in getting the source code for the package then I will include it in an update, but only when it gets enough ratings. Right now there is not enough ratings; so it will show up as unrated when others browse the Asset store, and it would help me out a lot if you guys could do that. All you have to do is log in and click on how many stars you think it should get, which shouldn't take more than a minute.

    If there's is some feature you would like to see implemented in the package, don't hesitate to ask me, right here on the forum or my mail.


    $bars_info.jpg
     
  20. silver-wind

    silver-wind

    Joined:
    May 8, 2007
    Posts:
    19
    Hi,
    Your plugin is a great time saver.
    It works great but there's not enough space to display 8 graphs

    Feature request :
    Could you add a vertical scrollbar in your graph debugger ?
     
    Last edited: Jan 2, 2013
  21. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    To be honest, this feature should have been implemented in version 1.0
    Yes I will add this as soon as possible, expect to see it in an update in a couple of days.


    EDIT:
    A new update is now uploaded and pending. I'll update this post when the package is live on the store.
     
    Last edited: Jan 3, 2013
  22. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Well that was fast, the update is now live and you can get the new version with scrolling if you download it from the asset store again.

    Also don't forget that the source code will become available if the package gets enough ratings on the store, so be sure to leave a rating/review if that interests you.
     
  23. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    Totally sold by your description, just bought it, can't wait to work with it. I will also port this to playmaker with a set of actions, this will be really helpful,

    thanks for this fantastic asset! I am looking forward to updates! I haven't even start using yet, and I know already I won't be able to code anymore without it!

    bye,

    Jean
     
  24. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    A new version is now up on the asset store (1.2.2).

    New in this version are:
    * A fix to a graphical glitch when the user was dragging links between graphs.
    * Improvement on how time values are displayed, now showing correct time info (like 02:41 instead of 221) in all places.
    * Graphs are uniquely saved using current date and time (this can be turned off if desired).
     
    Last edited: Jan 10, 2013
  25. Jibai

    Jibai

    Joined:
    Nov 20, 2012
    Posts:
    3
    Hi, just a quick question before buying your asset. Does it works inside the editor ? For example, can i use it to profile the OnGui calls i do over time in a window ? I don't see any reason why it wouldn't work, but i can miss something. Maybe you can enlight me :)

    Thanks !
     
  26. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    Currently, you can't watch graphs be recorded "live" if the game is not running. You should be able to record graphs to disk in the editor, but I might have to look into if I can add a mode where it's possible to look at graphs being recorded while the game is not running.
     
  27. recon

    recon

    Joined:
    Nov 28, 2009
    Posts:
    119
    A note to everyone: because the package has been rated to show a score in the asset store; in the next version I will include the source code.
    Thanks to everyone who gave a rating!
     
  28. Jibai

    Jibai

    Joined:
    Nov 20, 2012
    Posts:
    3
    That would be AWESOME. As i work essentially on the edition part, that would help me a lot. Thanks for the answer !
     
  29. rosevelt

    rosevelt

    Joined:
    Oct 23, 2012
    Posts:
    47
    Hello,

    I'm seeing performance degradation over time.
    while graph is monitored at start all is running well, but after a while performance drops to a stutter.

    Can you have a look at it please?

    Thanks
    Chen
     
  30. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    Will this asset be updated? I am sure a few performance enhancements can be gotten due to the changes in Unity over the past two years.
     
  31. Maeslezo

    Maeslezo

    Joined:
    Jun 16, 2015
    Posts:
    331
    Hello!

    Is this asset yet supported?

    Can I use the graph inside my own Editor Scripts?

    I mean, something like this
    Code (CSharp):
    1. public void OnPreviewGUI(Rect r, GUIStyle background)
    2. {
    3. Graph.Log(r, points);
    4. }
    Thank you.
     
  32. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    This looks nice and is still online, but wasn't updated since 2013. Is the tool still working in Unity 2019.1 and is support still active?