Search Unity

Daikon Forge GUI Library

Discussion in 'Assets and Asset Store' started by TakuanDaikon, Aug 6, 2013.

  1. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Being in the plugins folder or not wouldn't influence compile time actually, since DFGUI is provided in source code form.
    DFGUI isn't going to add much to your compile time, I've got a project which takes 10 seconds total to compile (almost exclusively C#), and it includes almost 20 different third party assets (which all include scripts) and a hefty amount of my own code, so DFGUI is a small portion of my compile time.
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    No, if it was in the plugins folder then it definitely would not need to be recompiled every time a modified a script outside the plugins folder, this is just a fact...

    Okay, I couldn't stand 10 seconds in any project I work on. My normal times are just 2 - 3 seconds tops. Waiting anything more 5 seconds drives by nuts.
     
  3. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    1.) You might be right. I have no idea since my project compiles several different assemblies every time I modify a script, although it could be there's some JS files somewhere (which have to be compiled into a different assembly). Each assembly it compiles takes about 5 seconds.
    2.) Like I said, it's a pretty hefty project script-wise and additionally has 17 different third party assets (which all include a variety of scripts).
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    You should try to put all of your third party code/assets into the plugins folder; I'll bet you could reduce compile times dramatically.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Even though I am well aware of the up coming unity gui, I'd like to try this out. It seems cheap and cheerful at the moment. Is there a skype contact for an occasional chat as I have somewhat unusual GUI work to do but it is a protected project I can't share vids for in public yet - just wondering if it's possible (I did watch all vids but they didn't answer it).

    :)
     
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I am sitting down watching the tutorial videos and it is already impressing me! I have a few questions in creating elements such as life bars that have effects (such as in soul calibur when the character takes damage, it has a "chipping" effect when the character takes damage) or even the name of the selected character under the life bar. Or a big one, a depleting meter that is circular using arrays... I am definitely looking to using this addon... and it looks SUPER easy to set up...
     
  7. bajeo88

    bajeo88

    Joined:
    Jul 4, 2012
    Posts:
    64
    Im impressed with the system, especially the property binding feature. I did notice one thing which i would like to clear up as im considering purchasing the package. In your tutorials you bind properties that are from classes extending from Monobehaviour, is it possible to bind properties from classes which do not?

    Also is it possible to bind gui buttons/sliders/etc... to objects/scripts which are instantiated during runtime? Doesnt matter if they have to be binded in code (i would prefer to do that in code actually). Reasons for this are that i make heavy use of a recycling system in my projects so id like the ability to pull an object out of a cache and then via script attach a floating gui above it which calls methods on the correct object.
     
  8. Extreme_u3Damon

    Extreme_u3Damon

    Joined:
    Aug 6, 2012
    Posts:
    66
    Hey Man ! Thanks for the Great DF GUI !
    I have a question and wonder how to do it !

    I want to make A Credits Window !
    Some Text and Images will come show like the Credits Menus as usual !

    Any one Who use this tool , Got any idea how to do that !?

    Please i need a detailed guide

    Thanks
     
  9. Arbelzapf

    Arbelzapf

    Joined:
    Sep 30, 2013
    Posts:
    58
    What's the status on 3D Menus?

    I have seen a working demo on your website, but it's labeled as "coming soon". Is this information up to date, or has this already been implemented in the meantime?

    If not, is it downright impossible to do right now, or just inconvenient? I would not mind if there was some intermediate-level programming involved.

    I am developing an application using augmented reality and would need a solution for displaying a GUI in the scene, just like in your webplayer demo.

    Since DFGUI is currently a steal in the asset store, I am strongly considering bying it, as opposed to keep rolling my own solution, which will probably never be anywhere near as good as this
     
  10. JoeW97

    JoeW97

    Joined:
    Nov 3, 2013
    Posts:
    56
    Hi

    Is there a way to add multiple textures to an atlas at the same time? If you try to multi-select, the atlas prefab loses focus. I tried dropping a folder but no luck.

    Also, instead of just failing if the texture import options are set incorrectly, would it be possible to add the option to set them for us?

    Thanks
     
  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I emailed the author a few days ago but was unable to get any form of a reply, which means I can't really feel confident in using daikon for our console title under development. I might still buy it and take the risk, but another issue I found that causes me deep anxiety is:

    http://www.daikonforge.com/dfgui/examples/menu/

    In this example we see the memory usage creep up alarmingly then reset back down again, as if tonnes of garbage is being generated. Can someone confirm the true state of garbage collection in DFUI? Linq? Or the string being constantly generated (still probably wouldn't add up that fast 2-3 meg)

    Thanks!
     
    Last edited: Feb 5, 2014
  12. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Heres sshot from the same demo, started the scene and did not click any items in the menu and after a while gc starts spiking every few secs.

    I get the similar df.lateupdate gc allocs in my mobile game with own minimal ui. Haven't taken DFUI yet for permanent use cause the 3D world interaction features seem to be still in progress.

    $df-game-menu.jpg
     
  13. jmatthews

    jmatthews

    Joined:
    Jul 27, 2011
    Posts:
    199
    This is possible. My last game does that. I'm not certain if you can pool GUI side though.
     
  14. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Should be able to re-bind a pooled event or property binding. Just call Unbind(), set the source/target, and then call Bind().
     
  15. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    I just wanted to pop in and say Thanks!
    You guys always have answered all my questions promptly and even went as far as doing a code change to help me get a very complex UI working on Android devices.
    Not only is your GUI System the Best!, It is the Only System my studio will use in the Future.

    Thanks Again! :)
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Bit confused about the whole alloc thing - why it's not got pooling to begin with (pool some quads etc) - but I've been assured in PM it's being looked into so thumbs up!
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Edit - GC issue with .name is resolved!
     

    Attached Files:

    Last edited: Feb 6, 2014
  18. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I had a question about the data binding features. In NData for NGUI, there is a ListBinding/ItemSourceBinding. You put the ListBinding on something like a scroll panel and bind it to a list of data objects. You bind ItemSource to a prefab of something like a button. Then it automatically fills the panel with clones of that prefab each data-bound to a data object in the list. Is there a way to do this in DFGUI?
     
  19. Arbelzapf

    Arbelzapf

    Joined:
    Sep 30, 2013
    Posts:
    58
    Alright, I bought it. Couldn't resist and I need something to reward myself for turning in my bachelor's thesis :D

    Here's hoping that 3d menus are really coming very soon as promised and that any gc issues and lag spikes are resolved.

    But for now, I'll just have a look around. Download has just finished :D:D
     
  20. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    More Garbage Collection found Physics.RaycastAll()

    Both the above get_name() and RaycastAll() are mentioned in http://forum.unity3d.com/threads/14...d-Third-Party-Assets-in-the-Asset-Store/page8 as big garbage monsters.

    FYI in my game these cause a spike of 12 millsecs and a visible pause on the device when it runs. Any ideas what kind of workarounds? Classic raycasting does not allocate, just raycastall due to the fact it returns an array.
     
  21. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    I thought you normally roll your own GUI solution Hippo?
     
  22. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Time has come for me to offload a lot of work to designers/artists - I simply don't have time for hardcoding stuff these days so I thought "lets bite the bullet and go with middleware..."

    Of course it bit me in the arse. DFUI is very good from what I can see but I may well just make a Designer-centric UI myself if I can't solve this by Monday. Milestones etc.
     
  23. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @Daikon,

    Can you give us a heads-up on the performance situation that's brought up in this forum. I am also faced with performance issues on mobile.

    Cheers.
     
  24. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    It would appear that there was some debug code left over in dfButton.RenderMultiple() that somehow escaped my attention before releasing it. No code should ever use the .name property like that. For instance, this is what my local version of dfButton.RenderMultiple() looks like:
    Code (csharp):
    1. public dfList<dfRenderData> RenderMultiple(){
    2.  
    3.  
    4.     if( renderData == null )
    5.     {
    6.         renderData = dfRenderData.Obtain();
    7.         textRenderData = dfRenderData.Obtain();
    8.         isControlInvalidated = true;
    9.     }
    10.  
    11.  
    12.     if( !isControlInvalidated )
    13.     {
    14.         for( int i = 0; i < buffers.Count; i++ )
    15.         {
    16.             buffers[ i ].Transform = transform.localToWorldMatrix;
    17.         }
    18.         return buffers;
    19.     }
    20.  
    21.  
    22.     isControlInvalidated = false;
    23.  
    24.  
    25.     buffers.Clear();
    26.     renderData.Clear();
    27.  
    28.  
    29.     if( Atlas != null )
    30.     {
    31.  
    32.  
    33.         renderData.Material = Atlas.Material;
    34.         renderData.Transform = this.transform.localToWorldMatrix;
    35.  
    36.  
    37.         renderBackground();
    38.         buffers.Add( renderData );
    39.  
    40.  
    41.     }
    42.  
    43.  
    44.     var textBuffer = renderText();
    45.     if( textBuffer != null  textBuffer != renderData )
    46.     {
    47.         textBuffer.Transform = this.transform.localToWorldMatrix;
    48.         buffers.Add( textBuffer );
    49.     }
    50.  
    51.  
    52.     // Make sure that the collider size always matches the control
    53.     updateCollider();
    54.  
    55.  
    56.     return buffers;
    57.  
    58.  
    59. }
    I will make certain that this is resolved in the next update. For now, you can just replace the method with the one I pasted above.
     
  25. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks for finding it!

    And the raycastAll() issue?
     
  26. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    Twelve milliseconds is crazy! I've never seen that happen with Physics.RaycastAll() on any of our local machines or devices, and didn't realize that it could have that much of an impact.

    I'll look into it and see if a suitable non-allocating and more performant workaround can be incorporated.
     
  27. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    It would seem likely that a suitable workaround would be to manually "walk" the control hierarchy and perform single-control raycasts in order to determine intersection. It may be possible to traverse the tree in reverse of the rendering order so that the first intersection detected is by definition the most "topmost" control, providing an early out on success.

    This should remove the allocation completely, as well as perform better on average.

    I will attempt to incorporate these changes today. If they work as expected, I will send you a beta to evaluate.

    By the way, I just want to point out to everyone that I had no idea there were so many pending questions, as the Unity Forums has apparently stopped sending me notifications of new posts :(
     
  28. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Really fantastic work, Takuan, I am incredibly impressed with your dedication to this asset. I feel it could well work alongside Unity's own UI.
     
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Another issue for tile deferred hardware (I'm really sorry to keep bringing these things up) - alphatest resolves to an if statement, so if your clipping is performed by alpha test, you may find that on PowerVR chipsets, performance goes bad.

    Can we use our own shaders instead?
     
    Last edited: Feb 6, 2014
  30. jmatthews

    jmatthews

    Joined:
    Jul 27, 2011
    Posts:
    199
    if you mean from a code standpoint you'd just get a reference to the DFGUIManager and then iterate the list and call .AddPrefab and then bind each prefab to whatever event and whatever property you want it to react to/effect.

    If you mean an automated gameobject you attach that iterates a list and does the binding for you i don't believe that comes standard.
     
  31. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    You can certainly use your own shaders :)
    That said, as mentioned in PM clipping is performed on the CPU to the mesh itself rather than on the GPU. On the one hand this means fewer draw calls and on the other hand means nested clipping support.
     
  32. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    There is no alpha testing involved in clipping. Currently, clipping is performed in software (triangle clipping, which is what enables DFGUI to perform "nested" clipping, which is pathologically difficult via shader-based clipping) during the mesh building process, but we are also experimenting with the ability to enable shader-based clipping, which would allow you to replace the shader with your own platform-specific version if needed.
     
    Last edited: Feb 7, 2014
  33. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Your standard shader has a subshader with alpha test in it. This would perform badly on all Power VR chips (iOS, some androids, and Vita), so I recommend you ship a shader variant for those platforms and some documentation about the issue so that your end users may benefit from improved GUI rendering performance on those platforms.

    The standard Unity mobile/Particles/Alpha Blended shader would be quicker for those people (if anyone wants to try that and they have iOS).

    Issue
    Does DF overrule what shader it uses at times? When trying the Action bar example, I note that the shader used in the material reverts to the Daikon Forge default shader which contains alpha test. Can we prevent it doing so? I might for example want to light the ui in an aesthetic way.

    Keep up the good work.
     
  34. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    Ah, good catch. I had forgotten that. I'll certainly look into that.

    It's fairly easy to switch shaders on a per-atlas basis, and the Game Menu example does exactly that using a SwitchRuntimeShader component for ease of use, but all it does is switch the Material.shader property at runtime. We're working on extending the ability to replace the shader on a per-control basis, and there's some infrastructure already in place for this, but the work is not yet done. That will be of increasingly higher importance in the near future, so you should expect to see some changes in this regard quite soon.
     
  35. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That is excellent news, it's forging the forge into something pretty sturdy. It's a shame there's no written guides for people who can't hear as good. Trial and error plus help from friends will have to do. Good videos otherwise...
     
    Last edited: Feb 7, 2014
  36. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    I second the need for write-ups, and I have excellent hearing! :D
     
  37. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Mobile optimization is really appreciated as my project is mainly mobile.

    Cheers.
     
  38. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    More written documentation is always good. I personally hate the trend towards video tutorials. Written docs you can refer back to easily and also integrate well with API docs but with videos you are always tracking around in them to find what you want to check.
     
  39. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @Daikon.

    Wondering if it's possible to do something like XmlGui with Daikon Forge ?
    https://www.assetstore.unity3d.com/#/content/3878

    Be able to save/load a DF gui form to XML or Json. Any thoughts on how this could be done with DF ?


    Cheers.
     
  40. RudeFX

    RudeFX

    Joined:
    Nov 6, 2012
    Posts:
    10
    Hello, I just got DFG a couple of days ago (Love it!), and after importing into a new scene Im getting a error on line 2552 on the dfControl.cs script

    Its hard to say the error because my computer is in Spanish, but it says something like "You are not permited specific predetermined parameters" xD on this line "public void ResetLayout( bool recursive = false, bool force = false )"

    Why is this? Could somebody help me get rid of it? Im not very familiar with C#.

    Many thanks!
    Adios!
     
  41. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    I've seen this somewhere else long time too and its about optional parameters where Unity thinks they are not supported if you x platform enabled with .net subset y...

    ...or something like that :)
     
  42. dterbeest

    dterbeest

    Joined:
    Mar 23, 2012
    Posts:
    389
    A simple workaround solution would be to make 2 functions out of it (should not have to be, but hey..)

    Code (csharp):
    1.  
    2. public void ResetLayout()
    3. {
    4.   ResetLayout(false, false);
    5. }
    6.  
    7. public void ResetLayout(bool recursive, bool force)
    8. {
    9.   //existing code
    10. }
    11.  
     
  43. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    There is a menu item available for accessing the written documentation in PDF form:


    This can also be accessed here. It is a live link, which is being updated regularly. Speaking of which, we're looking for someone to write written documentation and tutorials. We're not financially very successful yet, but would certainly do our best to make it worthwhile for someone who could help out with this task.

    On another note, I believe that Masaaki had a conversation with you regarding the allocation of triangle buffers? I've refactored that code such that triangle buffers are now cached (in a small MRU-ordered cache), and for the majority of cases this means that there are no longer common memory allocations for this.

    I've also refactored the raycast code such that it no longer uses Physics.RaycastAll, and although we've only got a Nexus 7 and Nokia Lumia 521 to test on at the moment, the results are very encouraging.
     
  44. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    Are you getting this error in Monodevelop, or in the Unity Editor? If it is in Monodevelop, then the cause is most likely that Monodevelop itself believes that the use of default values for parameters is invalid, even though Unity itself has no problem compiling this code. Assuming that this is the case, you can set Monodevelop to use the .NET 4.0 framework (on a per-session basis, unfortunately) to get past these compile errors:


    If you are seeing this error in the Unity Editor instead of Monodevelop, please let me know.
     
  45. TakuanDaikon

    TakuanDaikon

    Joined:
    Jun 6, 2010
    Posts:
    268
    We're working on refactoring all locations in the code that use default parameter values to eliminate this problem (which Unity should have fixed long ago), but obviously haven't refactored them all. We'll try to get to 100% as quickly as possible.

    I guess this is one of the few instances that it's unfortunate that I use Visual Studio, since I didn't realize that Monodevelop had this problem until afterwards :(
     
  46. RudeFX

    RudeFX

    Joined:
    Nov 6, 2012
    Posts:
    10
    Yes the error is in MonoDevelop, but I have not got those options you showed, and cannot see anything similar...

    $Options.jpg
     
  47. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    It's under Project -> Project Options, different dialogue.
     
  48. RudeFX

    RudeFX

    Joined:
    Nov 6, 2012
    Posts:
    10
    Thnaks! But I have that option greyed out, why is that?
     
  49. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    It's only available if you have a project open - I looked for it for instance, and for me it also was greyed out, but that's because I had no project open in MD.
     
  50. RudeFX

    RudeFX

    Joined:
    Nov 6, 2012
    Posts:
    10
    Im sorry for my lack of competance, but when you say no project open in MOnoDevelp what do you mean? I have my scripts open, the erróneos dfControl.cs and Unity...

    Thanks again in advance.