Search Unity

LDC (Localized Dialogs & Cutscenes) - Powerful and intuitive Dialog System with tons of features!

Discussion in 'Assets and Asset Store' started by melgeorgiou, Nov 3, 2012.

  1. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi everyone,

    There's a new version of LDC (v2.1) awaiting approval right now with some cool new stuff! =)


    3RD PARTY API


    I've been in talks with other developers about opening up LDC for some collaboration between our tools. This required creating a new API for users to easily access functions of the LDC plugin. This doesn't just benefit developers of other tools, it makes it easy to use the functions of LDC from your own scripts too!

    For those of you who are interested in these API functions, these functions will now be available in the new version:

    API_CreateDialog ( GameObject )
    // This function waits for any current Dialog to finish, and then instantiates an auto‐play Dialog.

    API_CreateDialogNow( GameObject )
    // This function immediately instantiates an auto‐play Dialog. This forces any existing Dialog to finish early).

    API_PlayDialog ( DialogController )
    // This function waits for any current Dialog to finish, and then triggers a Dialog to play.

    API_PlayDialogNow ( DialogController )
    // This function immediately triggers a Dialog to play. This forces any existing Dialog to finish early).

    API_SetToken ( String, String )
    // The first String is the name of the Token to set; the second string is the value to set it to.

    API_SetToken ( String, Float )
    // The String is the name of the Token to set, the float is the value to set it to.

    API_GetTokenAsString ( String )
    // Finds a token that has a name matching the String argument. Returns the value as a string.

    API_GetTokenAsFloat ( float )
    // Finds a token that has a name matching the String argument. Returns the value as a float.

    API_StopAllDialogs ( String )
    // Forces Any playing Dialog to close early.


    INTEGRATED ACTIONS FOR OTHER TOOLS


    Terry, the creator of uSequencer reached out to me to let me know that several of his users were asking him for support between LDC and uSequencer. The new version of uSequencer will provide built in actions for LDC, and this new version of LDC will come with built-in support for uSequencer, so those of you who have both plugins will be able to use them together. Of course, you can have the easy to use editor of LDC control your sequences ( in the way you have become used too! ), or the other way around. The choice is yours!

    The actions tab now has a new section for "3rd Party Tools". I'll be in talks with other developers to see if it makes sense for us to collaborate. For now, we'll be starting this new direction with built-in support for uSequencer! :)


    NOTE: you can grab uSequencer here: https://www.assetstore.unity3d.com/#/search/usequencer


    MORE COMPATIBILITY


    In a continued effort to "play nice" with other tools, this new version of LDC has renamed the "Localization" component to "DialogLocalization". This is to allow for better compatibility with plugins such as NGUI that apparently have a component using the same name.

    NOTE: This requires manually replacing the Localization component with the new DialogLocalization component on your "DialogUI" gameObjects. So please backup your projects before upgrading!


    THANK YOU


    LDC has really matured since I launched it 4 months ago, and I just want to thank everyone for supporting it so far and making it a success! :) .. I am committed to maintaining the tool and keeping it useful!

    As usual, feel free to offer suggestions or comments! :)

    All the best,

    - Mel


    UPDATE:

    v2.1 is now live! :)

    ASSET STORE LINK:
    https://www.assetstore.unity3d.com/#/content/5020

    - Mel
     
    Last edited: Feb 26, 2013
  2. stuartparker

    stuartparker

    Joined:
    Mar 4, 2013
    Posts:
    2
    Hi Mel,

    Do you have any plans on evolving the data entry / token system? It would be great to get some custom input triggering various narratives.. If this makes sense?

    Cheers

    Stu
     
  3. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Stuart! :)

    Thanks for your interest and feedback!

    The Token system has been implemented in the new LDC plugin since v2.0! You probably need to upgrade your plugin (free of charge! :)) via the Asset Store, bare in mind, if you are upgrading from version 1.x a few things have changed so make sure you backup your project before upgrading and take a quick look at the upgrade notes! :)


    EDIT: Sorry I misread your post! lol Can you explain what you mean by custom input triggering?

    - Mel
     
    Last edited: Mar 4, 2013
  4. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    VERSION 2.1.1 - FPS TECH DEMO

    Here is a tech demo showcasing the plugin inside of an FPS style game. Fully commented scripts are also included in the examples when you purchase the plugin!

    MAC USERS: If you are playing on Safari 6 in OS X, there is a bug in the Unity Web Player / Safari which messes up the movement. You can right-click and select full-screen as a workaround until the bug is rectified. ( Just bare in mind it has nothing to do with the LDC plugin that causes this! :) )

    Play the FPS demo now:
    http://bit.ly/YYODZ4



    LDC Plugin

    You can grab a copy of LDC over at the Asset store using this link:
    https://www.assetstore.unity3d.com/#/version/5020

    Thank you all for the continued support and interest! :)

    - Mel
     
    Last edited: Mar 4, 2013
  5. stuartparker

    stuartparker

    Joined:
    Mar 4, 2013
    Posts:
    2
    Sorry Mel - Example would be say if to progress to the next level, a password was required. So the plugin checks whether the input was the correct password. If yes, then it goes to a particular screen (which could then activate game object etc). If wrong password, it goes to another screen and loops until the correct password is provided.

    Not sure if i've explained this very well or whether it's a daft idea. I'm currently having to set up a GUI for a password which will trigger one dialog path or another. Almost seems like it would work really well within the plugin itself?

    Cheers

    Stu
     
  6. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Stuart!

    Sorry for the short delay in replying, I was travelling to the states yesterday! :)

    The "Password" dialog sounds like an awesome idea! I'll be adding that to the next update, hopefully within the next week! :)

    - Mel
     
  7. Jon-at-Kaio

    Jon-at-Kaio

    Joined:
    Oct 17, 2007
    Posts:
    185
    How much does the plug in add to an apps size, obviously theres the meta data to consider which is down to the individual implementation. but I'm curious as to how much meta-data the plugin would add to a mobile app.
    For instance excluding graphics, if there were 2 dialogs presented one after the other, each with just 2 lines of text totalling 256 characters each, how much extra meta data is needed to support that? (this only really comes into play if you're talking lots lots of dialogs and text I guess).
    Also given this is dependant on UnityGUI :( does it impact performance
    I'm targetting mobile platforms almost exclusively and so am looking for solutions which work well on ios droid.
     
  8. Lostlogic

    Lostlogic

    Joined:
    Sep 6, 2009
    Posts:
    693
    I have a few questions:

    #1 - Do I setup the actual text in Google docs and then reference it somehow in the dialog system to allow me multiple languages? Or does it work some ohter way?
    #2 - Can I automatically drive which text "block" is called at run-time based on data from a remote server? For example, my system tells the client to show "QUEST_NAME_0" and it references a block of text with that label which then is translated into several languages and has the actual name.
    #3 - Can I setup the chains of dialog remotely? This is sort of like #2 but I want to be able to drive the logic as well. My game is MMO-ish in that everything is driven from the server.

    Thanks!
     
  9. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Jon,

    Firstly, thanks for your interest in the LDC Plugin! :)

    File Size

    Typically, you would save each dialog / conversation as a prefab first (although you can keep it local to the scene if you want). From quickly taking a look at the example project, saving a fully "localized" dialog screen in 10 languages takes up about 16k. I'm not sure how much of this is the actual prefab itself though. For example, a multiple choice dialog screen with 3 choices and then 3 additional screens (4 screens total) takes up 25k on the disk.

    As for the plugin itself, it depends on how many languages you are using, the fonts you use, the graphics, etc. If you wanted to just use English, thats 1 GUI skin (108k on disk), you have 6 supporting script files (287k on disk), and at least the Dialog UI prefab (20k) so thats a total of 415k on disk. I *think* that when Unity compiles the app that number is actually reduced too. The real disk space comes from the actual GUI assets themselves (graphics and fonts), but you have control inside of Unity to reduce quality, etc if you are trying to achieve a certain file-size.

    The larger filesize for the plugin download is because of all the custom editor graphics (they do not get added into the final app!), extra example scenes, custom skins, documentation, etc. The plugin itself is pretty lightweight! =)

    UnityGUI

    Many people seem to think of UnityGUI like the devil, but the truth is that isn't the case if you use it correctly. For example, the plugin doesn't use GUI.Layout for anything and most things are pre-calculated, etc. But to answer your question directly, I originally created this system to produce "Ninja Guy" for iOS, and that worked on the very first iPhone pretty well. On modern mobile devices, the performance hit will be pretty much non-existent. =)

    Hope that helps! =)

    - Mel
     
    Last edited: Mar 15, 2013
  10. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Lostlogic,

    Thanks for taking the time to find out more about the LDC plugin! :)

    #1 Data Entry

    You setup the dialogs in Unity itself. There are friendly and intuitive Custom Editors that allow you to do this VERY easily and keep all languages nicely organised for you. Feel free to check out some of the tutorial movies to see how it works! ;)

    #2 Dynamic Dialogs

    Perfectly easy with LDC. The typical setup of each dialog is saved in its own prefab. so all you need to do is instantiate a GameObject, and the dialog will automatically play and handle the rest!

    #3 Streaming

    Havent personally tested this but yeah I don't see why not! =) As far as the system is concerned, each dialog / conversation is a self-contained GameObject. Stream it in, and as soon as its done it will auto-play and you're good to go!

    Hope that answers your questions! :)

    - Mel
     
  11. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi all,

    just to let you guys know that a new update was submitted last night which includes the all new "Password" Dialog Style! This is similar to the Data Entry screen, except it will compare it to a localized string ( so the answer could be different depending on language ), OR you can compare it to the value of a Token.

    Here's what the screen looks like:



    Here is an example of how you can use this:

    1) We use the Data Entry screen to capture a password to a token.



    2) Then, can use the Password Dialog style to ask the user to confirm it. You can see we have also enabled masking (****)




    3) If the password was incorrect, we can get it to go to a new Yes/No screen where they can attempt to re-enter the password.




    4) Otherwise, if its correct, we'll take them here:



    This is a very simple example, but you can use this to have locked areas in your game where a password is required to enter, or a keycode must be pressed to open something, etc.

    Thanks to Stuart Parker for the suggestion! =)

    I'll let you guys know when the new version is approved! As usual, feel free to share ideas about new features you think would be useful! =)

    Thanks for the continued support!

    - Mel
     
  12. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    Hey,
    Is it possible to randomize the buttons, so the possible actions are always different (lets say there is 10 different possible actions in a situation, but only show 3 of them)?

    I am looking for something like this:
    fallenlondon.storynexus.com
    In this game, there are "locations", and based on the location, you can do several actions that are always there, and also you can "draw from a deck of cards", what other actions are possible.

    So is it easy to do something like this?
    cheers
    Kalamona
     
  13. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Kalamona,

    Thanks for your question!

    At the moment, you'd make a version of the screen that has the different combination of these options. Then you would have to use extra scripting to help you out with this. If you are comparing to built-in tokens or variables that you keep outside of the plugin that is fine, and you'd simply load in (instantiate) the correct dialog screen.

    COMING IN LDC v2.5 ..

    I'm actually thinking about working on a feature called the "Logic" screen for v2.5. This is a pretty complicated one because it will allow you to compare tokens and do some simple visual scripting inside of each individual dialog screen. For example, you could say:

    IF - token "strength" "is greater" than "10",
    go to screen 2,

    ELSE IF token "strength" "is greater" than "5",
    go to screen 3

    ELSE
    go to screen 4.

    END

    This functionality would basically let you do something like you've requested, all inside of the plugin, all visually with no extra programming needed. For example, screen 3 could have an extra option to punch someone if your strength is greater than 5. If your strength is greater than 10 you will be able to also "Knock Them Out". Otherwise, screen 4 will give you the only choice which is to run.

    I think it would be a pretty cool feature to add in, and it would make the plugin pretty powerful. Although it will take me a while to actually build it, i'm hoping within the next 2-3 weeks!

    Hope that answers your question! :)

    - Mel
     
    Last edited: Mar 23, 2013
  14. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi All,

    just an update about whats to come with LDC!

    We're still waiting on Unity to approve v2.2, which will bring the new "Password" style I spoke about in an earlier post, but I'd like to share an awesome new feature coming in v2.5 in the next week or so.

    INTRODUCING - THE LOGIC DIALOG STYLE

    $LogicStyle.png

    The purpose of the Logic screen is to allow the system to make a dynamic decision based on the value of tokens. The result of this decision will instantly move you to a new screen. This is the only dialog style that doesn't show anything in the GUI, it acts like an intelligent bridge to other screens! :)

    As you can see in the screenshot, it is essentially using a simple and easy to understand visual scripting approach. This means that even more can be accomplished without writing a single line of code, and you can let the plugin handle it! :)

    Another cool thing, is the arguments of each condition can be localized! So if you are testing for a string, it can be different depending on language, without you having to create separate builds or versions. It keeps all these advanced features organised, and super simple! :)

    Another big feature of 2.5 is "Global Tokens". If you enable Tokens to the global, their values will be saved across different scenes / levels of your project, making it easier to manage complex games, visual novels, etc! All this happens with a simple click of a checkbox! :)

    On top of this, we have better dynamic formatting for numeric tokens, small bugfixes and some more polish to the UI - adding icons for the Data Entry and Password screens.

    As always, keep the comments and suggestions coming!

    Thanks for much for the continued support! :)

    - Mel
     
    Last edited: Mar 27, 2013
  15. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    UPDATE:

    v2.2 is now live! :)

    Update now for the new "Password" dialog style!

    ASSET STORE LINK:
    https://www.assetstore.unity3d.com/#/content/5020

    - Mel

    PS:
    v2.5 will be submitted in the next few days and will hopefully go live within the next week or so - More updates soon! :)
     
  16. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Wow, looks like a really package. We would like to ask a few questions.
    1. Does this work on Flash.
    2. We have an application that allows the user to create their own story book in-game. Looks like most of the configuration screens are in-editor, is there a way to allow in-game type of editing?
    Thanks.
     
  17. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Rocki,

    Thanks for your interest in LDC! =)

    1) At the moment, I've realized that Flash isn't working since "Tokens" were introduced. I'll be releasing an update in about a week that has limited Flash support. Basically, all the fundamental parts of the system will work, the dialogs, localization, etc but it seems that Tokens are what's incompatible with the Flash Exporter right now (I tested it on the older Unity 3 Flash exporter, so I'm not sure if it works correctly on Unity 4).

    As soon as Unity add support for "TryParse", then hopefully I'll be able to fully support it! Until then, expect limited Flash support to be re-instated in the next update (v2.6) =)

    2) It is definitely possible to do this via scripting, although not exactly as intuitive! If you have a fairly skilled programmer on your team, the way you'd have to do it is to manually build it in the editor, switch to debug mode and look at how the components have been setup. You'd then need to find your own way of replicating that by script. So in short, definitely possible, although it will require some work on your part.

    Hope that helps! =)

    - Mel
     
  18. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Hi Mel,

    1) I have Unity 4.1.2 pro for Flash - I can help test it if you want.
    2) Instead of weaving through the debug, perhaps you might have a sort of example of how we can access the underlining API in a meaningful way. I think that we can access the API if we have access to good examples and documentations.
     
  19. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Rocki,

    1) I appreciate the offer! Once I finish the next update I may ask for your assistance! =)

    2) All of this is coming in the v2.6 update in around a week. You will be able to totally build up most Dialog Screens 100% via scripting. You will be able to use all of the main Dialog Styles, one button, two button, yes / no, Next, Multiple Choice and Password screens.

    The specialised ones such as the "Logic" and "Data Entry" screen obviously wont be accessible to the API because they rely on Tokens ( but you can replicate that kind of thing with scripting anyway using variables!).

    More info on this in the next few days!

    - Mel
     
    Last edited: Apr 5, 2013
  20. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Wow, this is totally awesome. The ability to use scripting will turn your plugin into a dynamic content creator system. This will be a very flexible system to build upon.
     
  21. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    It's really great that LDC has an open minded philosophy and is integrated with uSequencer. A request, would it be possible to use NGUI components with LDC. This would allow developers to have a choice of the GUI system they want to use. Unity Gui is OK but performance is not great and on Flash does not support text input. NGUI is much more robust and is more feature rich.
     
  22. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi rocki,

    Thanks for your comments, and I'm glad you're excited about the new API update! =)

    Adding compatibility for NGUI really is a huge undertaking. Also, it would mean that users who don't have NGUI would not benefit from the system which implies that the best way to offer such support would be through an add-on plugin that you can purchase for LDC. I'm a little hesitant to do that because that would slow development for the system ( I would have to create updates for both UnityGUI and NGUI ) and realistically all future updates will be halved ( at a minimum ) due to the fact of having to code the UI side of things twice and having them play nice together. Perhaps this will come at a later date.

    I understand your concerns about Flash as that seems to be your platform of choice right now, although according to these Unity Flash docs: http://docs.unity3d.com/Documentation/Manual/flash-whatssupported.html

    ... "UnityGUI classes that require text input" is in the "Not Currently Supported" box, which means that support is coming. Most features of LDC will work on Flash anyway, but obviously for now we're at the mercy of the Unity devs to make their Flash exporter more complete. In the meantime I will be looking into workarounds for the Token system and Flash and I'm hoping to have full support for it by v3.0 of the plugin!

    Feel free to suggest more ideas and improvements, hopefully I'll be able to add the next one! :)

    - Mel
     
  23. PabloCA

    PabloCA

    Joined:
    Apr 5, 2013
    Posts:
    3
    Hi Mel!

    First of all, excellent plug-in you made, congratulations!

    I bought it yesterday and I'm trying to make a videgame but I need some help with your plug-in. Maybe you have talked about this before, sorry if you have but I want to make, let's say, tokens that I can modify in a differente script. For example I have a character that says different kind of dialogs depending on what the player have made in the game so far, I save the player's progress in a data base so I know what he have done so far. Let's say he already got a key, last time he played, that triggers a specific dialog from an NPC.. how can I make a token depending on what I got from my data base? I don't know if I mae any sense... will the API you mentioned in this post work for this?
     
  24. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi PabloCA,

    Great to hear from you, and thanks for purchasing LDC! :)

    The good news is the existing API functions will easily do this for you! The new API functions are way more advanced and allows you to build entire Dialogs from scratch! Anyway, here is the solution for what you want to do:

    Syncing LDC Tokens To An External Script / Database

    1) The first thing you need to do is create a new DialogUI gameObject ( in the menu go to GameObject > Create Dialog UI).
    2) Make this GameObject a prefab, and put it into every scene in your game where you will need to access tokens (or the Dialog system).
    3) Next, go to your "DialogUI" gameObject and open the DialogUI component. You will see a "Tokens" group. Create Tokens that match what you have in your database. So for example, you could have player name, red key, blue key, etc. See screenshot below:

    $tokenSetup.png

    You will then need to create a script that copies the values of your existing data into the tokens so that LDC can use them with the in-built editors. Something like this should work:

    Code (csharp):
    1.  
    2.  
    3. var playerName : String = "Mike";
    4. var gotBlueKey : int = 0;
    5. var gotRedKey : int = 1;
    6.  
    7. function Start(){
    8.  
    9.    // You can load the values in from a database or PlayerPrefs here ..
    10.  
    11.    yield();  // Give the plugin 1 frame to setup its own tokens first!
    12.  
    13.    // Make sure that DialogUI is available
    14.    if( DialogUI !=null ){
    15.    
    16.       // Copy the values from your database to the tokens
    17.       DialogUI.API_SetToken("PlayerName", playerName);
    18.       DialogUI.API_SetToken("GotBlueKey", gotBlueKey);
    19.       DialogUI.API_SetToken("GotRedKey", gotRedKey);
    20.    }
    21.  
    22. }
    23.  
    24.  

    And then the tokens can use your values! At some point you will want to copy the values back to your database (perhaps at the end of the level?). You can easily do this with the "GetToken" function. like this:

    Code (csharp):
    1.  
    2.  
    3. playerName = DialogUI.API_GetTokenAsString("PlayerName");
    4. gotBlueKey = DialogUI.API_GetTokenAsFloat("GotBlueKey");
    5. gotRedKey = DialogUI.API_GetTokenAsFloat("GotRedKey");
    6.  
    7.  

    Hope that helps! :)

    - Mel
     
    Last edited: Apr 5, 2013
  25. PabloCA

    PabloCA

    Joined:
    Apr 5, 2013
    Posts:
    3
    Thank you for your fast reply!

    That was exactly was I was wondering! awesome plug-in.
     
  26. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    My pleasure, glad it worked out! :)

    - Mel
     
  27. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
  28. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
  29. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    @ rocki,

    thanks for the link - in LDC there doesn't seem to be a problem with reflection. The biggest Flash issue on my side right now is a good replacement of the TryParse() function (or wait until Unity add support for it) - thats what appears to be breaking the Flash builds in LDC right now.

    @ Everyone:

    Good news - today I've submitted LDC v2.6, it adds an advanced API that allows you to build dialog screens completely via script, as well as a hotfix for Flash builds. Most things should work, but Tokens will not, as will Data Entry and Password screens as Unity haven't added support for Text-based input yet.

    As soon as Flash becomes more complete in Unity, I'll be adding complete support for it!

    Thank you all for your continued support, as long as the community keeps investing in LDC, I'll keep updating! :)

    - Mel
     
  30. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Last edited: Apr 6, 2013
  31. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi rocki,

    haha thanks! :)

    yeah for the next build I was looking into a suitable alternative for TryParse, looks like I'll have to create my own to get Tokens working again. Hopefully I'll get that implemented for the next build!

    Unfortunately, I haven't used NGUI before so I'm not sure I can help you there. :(

    - Mel
     
  32. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Question about the advanced API 1.6 - build dialog screens completely via script.

    Use cases/feature.
    1. We imagine a scenario where the building of the entire story book can be done via an XML file or Json.
    2. in-game, when the user creates their own content, it's saved as an XML or Json.

    What is the data model that LDC uses. Better question is how to best do the above 2 use cases.

    About NGUI - Does LDC come with the source? we will have to do the NGUI thing ourselves.
     
    Last edited: Apr 6, 2013
  33. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi rocki,

    The good news is your implementation should work fine with the API. :)

    The Dynamic Dialogs API essentially works around 2 steps.

    1) You create a new base Dialog object using 1 simple function. :)

    2) You then add dialog screens by using 1 function per screen to build up the Dialog thread. So for example, there would be 1 function to build a "OneButton" screen, 1 function to build a "TwoButton" screen, 1 function to build a "MultipleButton" screen, etc. You call each function and send the appropriate content as arguments and it will build it for you.

    EXAMPLE:
    Code (csharp):
    1.  
    2.  
    3.    // STEP 1
    4.     // Create a new base Dialog Object with Autoplay enabled (true), starting after 1 second.
    5.     var go : GameObject = DialogUI.API_DialogCreate(true, 1);    
    6.  
    7.     // STEP 2
    8.     // Now we add the individual Dialog Screens. In this example, we'll use a Simple Next screen:
    9.  
    10.   var portraitToUse : Texture2D; // We can setup a Texture2D to use as a portrait/icon, or pull it in from somewhere else.
    11.  
    12.    DialogUI.API_DialogAddNextScreen(
    13.         go,                                          // <- Make sure you send the gameObject we are adding to here!
    14.         1,                                           // Dialog ID to use for this screen
    15.         portraitToUse,                               // Portrait (Texture2D)
    16.         "First Dialog",                              // Title / Actor Name
    17.         "This is the first screen",                  // Dialog Text
    18.         "",                                          // Audio filepath
    19.         6,                                           // Seconds to show
    20.         false,                                       // Hide Next Button
    21.         true,                                        // End after this
    22.         true,                                        // Destroy after this
    23.         false,                                       // Don't Fade Portrait In On This Screen
    24.         false,                                       // Don't Fade Portrait Out On This Screen
    25.         0                                            // Dialog ID to move to upon clicking Next.
    26.     );
    27.  
    28.  

    So in your case with the XML file, you will need to pull the "content" of each screen you want to build and then call the appropriate function! Pretty much as simple as that! :)

    - Mel

    PS - Yes, LDC comes with source! :)
     
    Last edited: Apr 6, 2013
  34. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Nice an simple. Great API.

    Does LDC come with the source because we will need to use NGUI.
     
  35. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi rocki,

    Thanks!

    .. And yes, LDC comes with full source, demos and docs! :)

    - Mel
     
  36. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi All,

    LDC v2.7 = FULL FLASH SUPPORT! :)

    So I decided I was going to take Flash support more seriously and I went ahead and purchased the Unity Flash license. Good news is, I've managed to get LDC fully compatible with Flash - tested on the latest version of Unity (currently version 4.1.2)

    I've pulled the 2.6 update, and we'll be jumping straight to 2.7 which includes FULL flash support! Even tokens, AND Data Entry and password screens! :)

    v2.7 of LDC Should hopefully be approved sometime in the next week! :)

    I hope this is welcome news!

    - Mel
     
  37. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    This is totally Awesome.

    How did you fix each problem. Please share this for those Unity Flashers.

    1. TryParse()
    2. DataEntry
    3. Other Flash problems.

    Also, how is the performance.
     
    Last edited: Apr 7, 2013
  38. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    We know that you are moving fast on adding features and it's been quite amazing.

    Some thoughts on the issue of supporting other GUI packages, we know this is a big undertaking although you might want to reconsider as LDC is becoming more of a platform for dynamic visual story telling. It seems that LDC is quite robust and the part that seems a bit hard-coded is the GUI. Perhaps if this GUI part could be abstracted so that it is GUI agnostic then other people can do the work for you. This open architecture design allows other GUI makers to add their own packages into LDC's platform without you having to support them. Taking this approach will also attract a large base of users that have already invested so much into their GUI systems. A plug and play open architecture is the stuff of great platforms.
     
  39. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi rocki,

    Performance

    Performance seems pretty good to me! I uploaded the overview demo scene online (exported as Flash), feel free to check it out:
    http://dl.dropboxusercontent.com/u/... Dialog Plugin/LDC Flash Test/Test Flash.html


    Flash Solutions

    I'm happy to share some of the workarounds I used for LDC to help others:


    TryParse

    This was specifically harder to fix as I'm using JS and it doesn't support reference variables in functions. Anyway, I had to come up with this solution to mimic TryParse.

    Code (csharp):
    1.  
    2.  
    3. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    4. //    PARSE FUNCTIONS
    5. //    Workaround For TryParse On Flash
    6. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    7.  
    8.  
    9. class floatRef{    var value : float = 0;    }    // We have to use this as a workaround in JS too.
    10. static function ParseTokenAsFloat( stringToParse : String, destination : floatRef ){
    11.     try {
    12.         destination.value = float.Parse(stringToParse);
    13.         return true;
    14.     }
    15.     catch (err) {
    16.        return false;
    17.     }
    18.     // If something weird happens, just return false ..
    19.     return false;
    20. }
    21.  
    22.  
    So basically, it works exactly the same way as float.TryParse except you need to send a floatRef variable instead of a float. Flash seems to like it this way! =)


    Scripts With A Space " " In The Name

    I also found that some demo scripts I had with a space in the name ( e.g. "API Test.js" ) would have its OnGUI function totally disabled. This had me baffled for a while, but as soon as you lose the space in the name things started working again.


    Data Entry Screens

    This was a weird one, turns out they just worked haha .. Maybe the new version of Unity 4.1.2 has fixed these?


    GUI Abstraction

    This is an interesting idea. I'll have a think about how this could work. If I do open this up it will be down to the developers of other GUI systems to keep up to date with the new features .. Haha they're going to hate me because I work fast! ;) Maybe we'll see this for v3. :)

    For the meantime though, theres no reason why you cant use NGUI for everything else as well as LDC. From what I understand they'll work fine together (although I haven't personally tested). LDC will just get overlaid over NGUI ( which is normal for conversational based UIs ). The performance is optimized too, as LDC was originally designed to work on the original iPhone! Many new features have been added since, but you should be seeing a full frame rate from the iPhone3Gs and up. Flash will definitely not be a problem as it has the power of a desktop machine to support it. I think that people are way too harsh on OnGUI for some reason, especially if you avoid GUILayout (which LDC does - All Rects are pre-calculated ). It's all about implementation - Thats just my 10cents anyway! :)

    Hope that helps! :)

    - Mel
     
    Last edited: Nov 1, 2013
  40. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Mel,

    Thanks for the detailed sharing of your hard-earned Flash exploits. Definitely valuable tips. Also appreciate you giving thoughts to GUI abstraction.

    I had a look at the Flash demo, seems smooth although our existing project requirements will probably push the boundaries of OnGUI. We have a number of 3d and 2d characters on screen together with animations and effects. With LDC added to the mix, we will quickly reach the limits of both draw calls and fill rate.

    Very interesting what you wrote about how to efficiently work with OnGUI. We don't have much experience with OnGUI but most developers are complaining about the high draw calls. Do you have the draw call stats or other stats regarding the draw calls in LDC.

    Thanks.
     
    Last edited: Apr 7, 2013
  41. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Mel,

    Use Case:

    What we would like to do is to create a base template of our visual story book using LDC's editor, save this base template, then in-game allow the user to customize and add their variations.

    The user's in-game creation will then be saved as an XML or Json using the format that LDC uses to store its own data and when the user return at a later time, their information can then be retrieved.

    How is LDC currently saving the in-editor Visual Story ? We will need to use this exact mecanism to store the user's in-game created content. Then to load in the user's created story, we will also need to use LDC's load function.
     
    Last edited: Apr 7, 2013
  42. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi Rocki,

    No problem about the Flash stuff, happy to help :)

    LDC and Drawcalls

    $LDC Drawcalls.png

    Haha I can already feel like I'm about to walk into some controversial debates here! LOL But none the less, I'll start by saying that I'm not disputing that fewer drawcalls generally aren't better for performance. However, in my experience, adding 6 draw calls ( the amount of drawcalls needed for a simple "Next" dialog screen in LDC ) is hardly going to make a dent. Perhaps on the original iPhone you would notice a slight hit, but definitely since the iPhone 4, that kind of number is not going to be noticeable. Also, when LDC isn't showing a Dialog, it actually uses zero drawcalls, and sits patiently waiting for something to do. :)

    Ok, back to solutions such as NGUI - I have much respect for their product and there is a definite need for it when you're talking about the UI for an entire game where we can be talking hundreds of elements because each one would count as a drawcall. In the scope of your entire game, it makes sense to use something like that for mobile if you need to get some extra performance out of your games, or more to the point, in my opinion the best benefit is it improves memory because I assume it combines graphics into the same texture - and that is important for mobile.

    Jumping back to LDC again, consider where you would use it in-game. I can imagine instances such as cutscenes, visual novels, or generally times in a game where things tend to slow down and usually other UI elements would fade out to give the dialog UI's the limelight temporarily. In this setting, I find it very unlikely users would notice a hit - and if they do, it will be more because of whats going on outside of the plugin rather than LDC itself.

    You can think of OnGUI to work pretty much like this. 1 element = 1 draw call. The more things you add, the higher the number. Users who complain about the high draw calls have a valid point if they are using it for everything in their games. But like I said in the previous post, it's all about "implementation". How and when you use it! :)

    Again, that's just my 10 cents. I'm sure there are different ideologies out there!

    Hope that helps! :)

    - Mel

    PS - All of LDC's data is stored in the gameObject itself using custom classes, etc. No external files.

    PPS - You can actually lower those 6 draw calls in LDC. You can turn off the background layer ( the black strip in the screenshot ) which will free up a draw call, and if you choose not to use a seperate Title for actor names and keep everything in the main dialog box, you'd free up an additional drawcall there. So if you were trying to get the absolute best performance out of it, you could actually achieve 4 draw calls for a Next Screen if you really wanted to. But personally, like I said before - I think thats overkill! LOL ;)
     
    Last edited: Apr 7, 2013
  43. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Mel,

    About the draw calls - Well explained. Agree, 6 draw calls are overkill.

    Regarding our use case: We were not thinking about using the simple template with only the next button, but we were thinking of creating custom templates with lots more Gui elements and more complex. In this case, the use of OnGui elements will definitely impact the performance. The reason for this is that we could use the existing serialization mechanism of LDC to save the content of the visual book. This is why we wanted to know how you are saving the data.

    A feature request:
    1. Would it be possible for LDC to provide the data as an XML or JSon ?
    2. A parser that converts the XML or Json into the visual story ?

    We have been using a plugin called Animator that has this feature of saving/ loading the scene as Json. It was great for other projects that didn't require export to flash.
    http://forum.unity3d.com/threads/13...Cutscene-Editor-for-Unity?p=922435#post922435
     
    Last edited: Apr 7, 2013
  44. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Animator looks pretty cool, never seen it before! :)

    XML / Json isn't really my forte to be honest, and also those feature requests seem very specific, and it sounds like the new API can do pretty much the same thing without having to get messy with those storage solutions - I'm not sure the majority of users would benefit from adding them.

    But, to help you in the right direction to achieve what you want, might I suggest:

    1 - You can use the new API to call LDC with it's built in dialog screens, etc. I imagine it would be pretty straight forward for you to pull the content from your saved XML / JSON files to build LDC screens with its easy API. You could write a specific function for your external files that convert them to LDC functions, which I imagine will be far easier to do for your project than it is for me to come up with a one size fits all solution for JSON. :)

    2 - For other elements you are custom-building, you dont have to use OnGUI right? :) If you've been using NGUI for other elements feel free to mix and match between both systems for best performance. Use LDC for the built-in screens it provides as its pretty lightweight, and use NGUI or another solution of your choice to help with the custom stuff - again, your specific XML / JSON files can hold the data for all of these things and call out to the other systems.

    3 - If you are trying to pull data from each LDC dialog screen, even though it isn't documented, you can do it directly like this:

    Code (csharp):
    1.  
    2.  
    3. var ds : DialogScreen;  // reference the screen one by one, or you can create a loop of GetComponent(DialogScreen)
    4.  
    5. // This is the Actor Name or Title
    6. print( ds.screen.actorName );
    7.  
    8. // This is the Dialog Text
    9. print( ds.screen.dialogText );
    10.  
    11.  
    12.  
    If you look at the DS_Screen class in DialogScreen.js, you'll find all the "content" of each dialog. You can pull out the ones you need directly very easily!

    Your problem sounds very specific, but I hope the info above helps you achieve what you want to do! :)

    - Mel
     
  45. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
  46. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi rocki,

    I appreciate that in some situations it could be useful, but for LDC to implement it, I have to build the storage side to be compatible with existing supported platforms and I already know from experience that saving and loading data to mobile devices will be more than a pain, let alone building XML or JSON parsers that are compatible, etc. On top of that, the .net libraries seem like a reliable way of doing it and many mobile developers wouldn't want to be forced to use the extra 1MB or memory to use .net for something they're not going to use. I will inevitably get to the point where one person says use JSON, no use XML, no use good old fashion INI files, etc. and then that will open up a whole new can of worms which I feel is really outside the scope of LDC anyway.

    From my current feedback, I can tell you most users don't even use the API and I believe leaving the actual choice of which storage format to use down to you guys and building the API to be as open as you previously requested is far more productive because you can use ANY storage method to save and load dialogs on the fly. I totally agree with you there and can see the wide-appeal, which is why that feature request along with Flash jumped the to-do list to the top! :)

    I can also tell you that I am putting a lot more thought into GUI Abstraction for v3! :)

    If there is a lot more demand for this feature I will definitely revisit it. I've already got a pretty big to-do list I'm working on at the moment so rest assured there will be new features coming soon! :)

    - Mel
     
    Last edited: Apr 8, 2013
  47. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Mel,

    Thanks for thinking about it. We know your Todo list is vast.

    Definitely agree that GUI abstraction is much more important.
     
  48. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Can i use your asset to give my player a quest and will it know later that i fullfilled it?
    Will it save the actual status?
     
  49. melgeorgiou

    melgeorgiou

    Joined:
    Nov 3, 2012
    Posts:
    772
    Hi RandAlThor,

    Thanks for your interest in LDC! :)

    Excellent question. Yes, you can use it to give quests and you can save their progress into tokens. At the moment, tokens are saved between levels but aren't saved to disk - although it is possible to do with the API (take a look at the example code I gave a few pages back!)

    But, this feature (Auto-Saving Tokens) is actually coming in the next update! You'll be able to check an option that automatically saves and loads your tokens to PlayerPrefs allowing you to fully focus on creating great narratives, and letting LDC do even more of the work! :)

    Expect this in v2.8 which should be out in the next week or so! :)

    - Mel
     
  50. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Thank you for the fast answer :)

    I have another question.
    What does resolution independent mean with this asset if i whant to make a game for different platforms?
    Will i be able to use different resolutions for a picture and will LDC then choose the right one for the specific platform?
    Can we read the documentation before buying the asset?

    Edit:
    I would like to see that it not only save ebrything on a level change but for larger levels something like save stone solution or that it saves all when the player gets to a special save place like i. e. his home.
     
    Last edited: Apr 8, 2013