Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Chatbot Asset - Approach To Simulate Human Being

Discussion in 'Assets and Asset Store' started by SkandYxyz, Jan 30, 2017.

  1. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    logo.png

    Asset to parse AIML 1.0.1 files in Unity. Webplayer basic example can be
    found here. This is used to make a chatbot. You can write your own AIML
    "brain" and let your characters speak and interact with your scripts.

    This is possible due to Jurassic, a fully integrated javascript runtime compiler.
    You can write your javascript into the AIML files and preprocess your AIML
    code through the javascript function main(){return"";} before the bot answers.
    Exception handling in Unity console, pass and get global variables, do regular
    java script commands while processing AIML files. Now Chatbot framework
    is introduced, bridging the gap between Program #, Jurassic and
    implementation in your game. Advanced Example added and will be improved
    continous in next updates, as there are thousends of categorys to rewrite.
    The possibilitys are infinite.

    Current supported platforms: PC, Mac & Linux standalone, Webplayer,
    WebGL for Unity 5.2.0f3 upwards, Android and IOS. Now full support for basic
    and advanced example on all named plattforms. More example scenes will be
    added in next updates.

    Supports Unity 4.0.0 - 5.x

    Visit www.chatbotunityasset.com for more information and download Chatbot
    on the Unity Asset Store.

    Visit the roadmap for further development.
     
    Last edited: Jan 30, 2017
  2. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    We are working on a alternate Reality Game like "Majestic12" and need a sophisticated bot that minicks a human on the other side of skype. would it be possible with API to connect the bot somehow to skype to make it more realistic?
     
  3. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    @Devision4:
    Hey!

    Yes, you can implement an interface like skype. To make the bot "intelligent" you can modify existing AIML 1.0.1 bots like integrated alice bot or use the more life like chatbot framework that is more interactive and simulates feelings and intentions etc. Here you'd need to modify the existing advanced example brain.
     
  4. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Looks great. Do you have a working webplayer? The link in your description isn't working. Thanks.
     
  5. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hey adamz,

    Yes, web gl and webplayer are working. I had to move the website to a different webspace and this might be the reason for the example not working. I will check it this evening.

    Best,
    Andre
     
  6. DADA_universe

    DADA_universe

    Joined:
    Mar 14, 2015
    Posts:
    38
    Hi,

    This looks real neat, a few curious questions please:

    What's the Jurassic compiler used for, why do you need Javascript in this?

    Is it possible to use AIML 2.0 with this?

    Your road map estimates you'll have a sample scene with a 3d avatar ready by July, if one tried out to implement something along that line in the interim, what would you advise?

    Any considerations for implementing text to speech with this, perhaps with inbuilt Windows.Speech integration in Unity?

    Does this work fully offline without http requests to some server? Asking because I'm considering this for a VR project where latency from http requests would be an issue.

    Thanks.
     
  7. McSwan

    McSwan

    Joined:
    Nov 21, 2013
    Posts:
    129
    HI,

    I have made my own basic .aiml file. How do I add it to the basic example? What .aimls does it load and where does it load them?
    eg I made this

    <category>
    <pattern>WHY SHOULD I JOIN A SYNDICATE*</pattern>
    <template>Have more fun playing. Increase your chances of winning. All costs and winnings are shared. Play together in a team</template>
    </category>
    Can I paste this into a aiml file somewhere and have the bot respond with the template code ?
     
    Last edited: Apr 5, 2017
  8. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    @DADA_universe:

    The Jurassic compiler adds more functionality to aiml and is even intended by aiml language with the javascript section. You can access the input text and perform string operations and change/read variables what you could never do this complex with aiml. Aiml itself only offers simple if else/switch syntax.
    AIML 2.0 will not work with chatbot. The reason, why I won't integrate AIML 2.0 is, that it is not designed for usage in games. I want to start from AIML 1.0.1 and develope it more for gaming usage to work as npc.
    To use chatbot with an avatar, I would use rigged 3d models with blendshapes and write a mono behaviour to interact with it. MCS Male for example has a free male/female version that includes facial blendshapes.
    You can use open source text to speech modules. But I guess in a final game you would record the sentences and play them as output. It works offline, but you could also store and access the files on a server. But offline is much faster, as WWW class is quite slow.

    @McSwan:

    You need to include it into the aiml folder, where the other aiml files are located. Then you need to open the config/Settings file and add your aiml file there.The files named in the Settings file are loaded. They get loaded, by this code:
    Code (CSharp):
    1. bot.loadSettings(Application.dataPath + "/Chatbot/Program #/config/Settings.xml");
    2. // Load AIML files from AIML path defined in Settings.xml
    3. bot.loadAIMLFromFiles();
    You can find those lines in the AIMLTestChat.cs file.
    Yes you can create new templates or even create your own new aiml folder with your aiml files.
     
  9. McSwan

    McSwan

    Joined:
    Nov 21, 2013
    Posts:
    129
    Hi,

    Thanks for your help. I made a very specific aiml file and it worked. I think the other aiml file I had didn't work because the pattern might have been picked up elsewhere.
     
  10. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
    Hi @SkandYxyz

    Question please, is it possible to add new responses while that game is playing?
    or saving certain variables while chatting with Alice?

    Thanks.
     
  11. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi @alsharefeeee,

    yes, this is possible. There are several ways to achive this. In general all you need to do is add a category to the bot and store the changes in an custom aiml file.

    Yes you can receive variables from chatbot and store them in a file, e.g. .asset file.

    Best,
    Andre
     
  12. Dragon972

    Dragon972

    Joined:
    Apr 16, 2015
    Posts:
    1
    Hello

    I have a problem, every time i close my app on android , my bot lost all memory of names and more
    Do you know how to solve this problem? and the scene reset the bot memory all the time.
     
  13. Shturmovik

    Shturmovik

    Joined:
    Nov 5, 2014
    Posts:
    29
    Does this work with Unity 2017.1?
     
  14. Cassiopeiae-73

    Cassiopeiae-73

    Joined:
    May 2, 2016
    Posts:
    6
    Yes, Chatbot works with Unity 2017.1.1f1
     
  15. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi Dragon972,

    Names and other informations are stored in an array/list and are not stored on hdd unless you save and restore them yourself. You could write a store and a reload function and save the information to an asset and reload them again into the variables. You could create an information class and store it as an asset in a resources folder.

    Best,
    Andre
     
  16. foundway

    foundway

    Joined:
    May 30, 2013
    Posts:
    14
    Hi, we are testing ChatBot in our new game. We noticed that the Basic Example takes a long time to load on Android build. Is it possible to reduce the loading time? (perhaps load fewer AIML libraries?)
     
  17. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi,

    What slows down is when aiml files are loaded via www class. As far as i remember i implemented a way to load aiml files from resources path what is much faster. How to do this is written in the documentation. Else you could of course reduce the aiml files to only the ones you need.

    Best,
    Andre
     
  18. unknown17771

    unknown17771

    Joined:
    Nov 12, 2016
    Posts:
    19
    is this support for unity 2017.2?
     
  19. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi mybreeze,

    As Program # and jurassic are both almost only c# libraries without big interface to unity, compatibility to newer unity versions was no problem till now, but i did not test yet.

    Best,
    Andre

    Edit: Above it was tested successful with 2017.1 and there are only minor changes to 2017.2
     
  20. Dekata

    Dekata

    Joined:
    May 20, 2016
    Posts:
    47
    man, Is it support for pandoraBots? if not how to build my own data
     
  21. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hello dekata,

    pandorabots use a modified aiml language. So you'd have to modify the parser to work with those files. Creation of own aiml files is described in the manual. You could for example use gaitobot to create the entries.

    Best,
    Andre
     
    Dekata likes this.
  22. eduisfun

    eduisfun

    Joined:
    Apr 2, 2015
    Posts:
    7
    Dear SkandY / Community members,
    We purchased the unity asset a couple of days earlier.
    Firstly, great job to have an asset which helps fit basic Alice bot directly into any game.

    Secondly, we were facing couple of issues while building the same, wanted your help / comments on the same.
    1) The Advance bot is not working - its loading but not pulling responses from all the AIML files as the basic bot (also the emoticon shows only one image of don't know)
    2) The basic bot is better in response than advance. But it times out very quickly most of the times. Also, does the badanswer.aiml works in the bot - so that we can teach it new responses? I was trying to integrate newer AIMLs into the current (https://github.com/hosford42/AIML_Sets/tree/master/aiml_sets) - the more interesting one is the Learn.aiml in mitsuku folder - but we are not able to make the basic badanswer.aiml (file given in default project) work - Learn.aiml is an advance version of the same. (http://alicebot.wikidot.com/learn-aiml)
    3) Is the basic bot able to remember things said to it 5 chat earlier - basically saving the conversation - becoming smarter and smarter everytime? Or its only one comment a time thing and it forgets everything before that? So, if I make it remember my name at the start of a conversation - even after opening the app again - it should be able to save / remember the same? Is there a provision for this? Or its not possible for now?
    4) I want to achieve adding my own AIMLs to the current project using reversed AIML. Let me know if you have any knowledge in this area? Example - I have a fact -
    "An object at rest stays at rest and an object in motion stays in motion with the same speed and in the same direction unless acted upon by an unbalanced force"
    Which if I apply reverse AIML to - should give me all possible combos of questions a user might ask on the topic.


    Let me know if you can help me with all the four of my concerns. To a large extend - 2,3&4 are related and can be resolved if you have a tiny bit idea on the subject. Thanks a tonne in advance :)
     
  23. eduisfun

    eduisfun

    Joined:
    Apr 2, 2015
    Posts:
    7
    P.S: Your Email mail@chatbotasset.com fails. Please find attached screenshot. Screen Shot 2018-05-01 at 11.35.52 AM.png
     
  24. ocimpean

    ocimpean

    Joined:
    Aug 10, 2013
    Posts:
    128
  25. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi,

    @eduisfun: the correct email is mail@chatbotunityasset.com. tested and works aswell as mail@nexusgamesoft.com.
    as its night and my flight will depart in some hours i will respond to you when I'm back from holidays.

    @ocimpean:
    I did not yet update the product description. at the moment i do not maintain a roadmap, as i am working as fulltime engineer and do steps on my assets when i find the time.

    besides program # it is also coupled with jurassic, a java script library, because aiml language is quite limited in syntax. (despite the fact that you could extend the interpreter). On top of both is an interactive realtime system called chatbot framework reacting on triggers, simulating feelings and motives. E.g. if you move the mouse in the advanced example the first time this triggers the motive to greet and puts a task to the planner which once executed activates a gif with a greeting smiley and enables the emotion happiness. If you then ask how he feels he responds that he's happy and if you ask why he might even know why he's happy, because there's a deliberate variable holding the reason, why he feels, what he feels. this of cause will only work if set before in aiml category as reaction on an text input or in a motive. the chatbot framework is thus an inspirational approach of how an ai could be created.

    best,
    Andre
     
  26. ocimpean

    ocimpean

    Joined:
    Aug 10, 2013
    Posts:
    128
    @Andre: I appreciate your answer. There is something fascinating about this old technology, I believe they wrote the first Aiml bot between 1995-2000. I wonder what is the complexity level of Google AI in 2018...

    I have played with a Unity bot and another for RenPy. While using them, I had the same issue, if I wanted to edit a .aiml file or add my own categories with Simple AIML Editor or Gaitobot, no changes I made were reflected in the conversation with the bot.
    Reading the posts above, I understand you are editing successfully .aiml files or add new (like the files available here: http://www.square-bear.co.uk/aiml/).
    What is the brain file and who checks the .aiml files and updates the changes to the bot in your example? Also, you mention in a post above, a function to store and reload information in a variable. Is it something you want to implement in the future?
    Thanks
     
  27. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    I guess the fascinating point is the approach of creating an illusion of a self-aware being. Propably self-awareness of humans is also an illusion.

    To answer your questions:

    The brain file is the sum of all loaded aiml files.
    Files are parsed by program # and jurassic java script compiler. Variable handling is already integrated. Global variables of program # and jurassic are synchronised and accessible from everywhere. When using aiml 1.0.1 files from other resources or when writing your own you need to consider, that bot variables and user variables now share the same array. E.g. you need to make sure that variable for bot's name is not same as variable for user name.

    Best,
    Andre
     
    ocimpean likes this.
  28. jphales

    jphales

    Joined:
    Nov 15, 2012
    Posts:
    7
    Thank you for the great Chatbot asset!
    It was such an incredible and convenient add to our language learning app!
    Thanks for your quick response and fix to our <topic> tag question.

    Sincerely,
    Jon
     
    Last edited: Nov 2, 2018
  29. congty3Dart

    congty3Dart

    Joined:
    Nov 17, 2018
    Posts:
    5
    Thank for asset, I come from Vietnam. I've edit AIML files, in <pattern> I use Vietnamese language like
    Code (CSharp):
    1. <category><pattern>Em ơi</pattern>
    2. <template>Dạ.</template>
    3. </category>
    But when I chat with bot "Em ơi", she don't answer me "Dạ"

    Thanks,
    Linh
     
  30. BadSeedProductions

    BadSeedProductions

    Joined:
    Dec 26, 2014
    Posts:
    144
    When I build the "Basic Example" for PC it doesn't work. Chat window appears, but bot doesn't respond. (works in editor)

    using Unity 2018.2.18f1
     
    Last edited: Apr 11, 2019
  31. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi BadSeedProductions,

    it sounds like problems with loading the aiml files and/or configuration settings. Did you follow the manual and place the aiml files at the right position? If so please send me a download link via mail so i can take a closer look this weekend.

    Best,
    Andre
     
  32. congty3Dart

    congty3Dart

    Joined:
    Nov 17, 2018
    Posts:
    5
    I was update Unity to newest version 2019.1.0f2 and when I import this asset it has issue
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.
    So how can I fix that?
     
  33. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi congty3DDart,

    I will release a new compatibility update for recent Unity versions soon. The reason for this problem is the system.drawing.dll. A .net 3.5 dll Version is included in the chatbot asset whereas a .net 4 dll version is also included by default, located e.g. in C:\Program Files\Unity\Hub\Editor\2019.1.0f2\Editor\Data\NetStandard\compat\2.0.0\shims\netfx. But this .net 4 version discarded System.Drawing.Imaging class and not supports gif importing anymore.
    A fast fix is to remove system.drawing.dll out of asset, comment out lines 52-98 of file SimpleEmoticonChat.cs and also using System.Drawing; and using System.Drawing.Imaging;
    I will implement UniGif to handle gif's independant from System.Drawing.dll.
    There is also a hidden character at ProgramSharpWebplayerCoroutine.cs line 469 that must be deleted.

    Best,
    Andre

    Edit 20.04.2019:
    New update is now in the review queue.
     
    Last edited: Apr 20, 2019
  34. congty3Dart

    congty3Dart

    Joined:
    Nov 17, 2018
    Posts:
    5
    Thanks your answer, wish your asset update soon.
     
  35. MRKane

    MRKane

    Joined:
    Oct 4, 2012
    Posts:
    54
    Hello, I've a quick question about the Chatbot asset you have here. While it seems to be very good for a situation where a user has a keyboard, we are developing a VR educational experience where the user won't have access to any input devices besides the two hand controllers. This means that the user could really only answer with "Yes", "No", or other such simple replies.

    Would it be possible for the chatbot to be setup in such a way that it would talk away to the player (about anything - it doesn't matter as the goal is teaching reading) using such limited responses from the player?
     
  36. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi MRKane,

    First, if you target VR, you need to implement your own GUI, as current examples do not support VR. But this can be done quite easy. I guess you could achieve this with the topic keyword of aiml language. You can set topic keyword and if you answer a question, only categories with current topic are evaluated.

    Best,
    Andre
     
  37. agrzegoo

    agrzegoo

    Joined:
    May 30, 2019
    Posts:
    3
    Hey,
    I've the question. Does this asset supports AR technology in Vuforia Unity?
     
  38. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Hi agrzegoo,

    unfortunately i did not test, wether chatbot compiles with Vuforia. You could try and i could help or refund if you encounter problems.

    Best,
    Andre
     
  39. agrzegoo

    agrzegoo

    Joined:
    May 30, 2019
    Posts:
    3
    Hello,
    so I got this asset and tested it with Vuforia. What turned out, it works perfectly! I can recommend it to every Vuforia developer as everything is fine.
    I just have another question (as I am not so into ChatBots) if it is possible to change any aiml database with for example some single words and to add my own fragments of possible conversation? If yes, what is the simpliest and I would prefer for free way?
    Also, I would like to ask about the look of chatbox window. How am I able to change it for example in the basic example for my own (as well as to change the database fragments)? I am asking because for me it is not so simple written in the manual.

    Thanks for answer.
    Greetings.
     
    Wolfmoss likes this.
  40. agrzegoo

    agrzegoo

    Joined:
    May 30, 2019
    Posts:
    3
    Hey, and about changing the GUI of box. How is it possible to make the box transparent instead of black and in the center?
     
  41. EvelynWu

    EvelynWu

    Joined:
    Dec 30, 2018
    Posts:
    2
    I'm wondering how can I change the size of chatbox? It is too small when I test on my phone (iphoneX size)
     
  42. jphales

    jphales

    Joined:
    Nov 15, 2012
    Posts:
    7
    Hi EvelynWu,

    This is really a Unity UI implementation, not really a chatbox deal.
    That said, I made a quick Unity package for you that implements the basic example of chatbox in a Unity canvas.
    You can run the Basic Example Canvas scene in landscape mode to see it in action. It should give you a head start. But, further implementation will most likely require some UI and scripting knowledge and a good reading/understanding of the ChatBox documentation.

    A friend,
    Jon
     

    Attached Files:

  43. EvelynWu

    EvelynWu

    Joined:
    Dec 30, 2018
    Posts:
    2
    Hi Jon, thanks a lot!
     
  44. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    This look great. Is it setup to allow it to "learn", such as remember names, favorite color, etc? I remember reading some AIML will allow that to happen. Thanks.
     
  45. jphales

    jphales

    Joined:
    Nov 15, 2012
    Posts:
    7
    It is an AIML 1.0 implementation. So, check for appropriate features.

    Also, though, some interesting game-specific implementations.

    ** However, the basic version dll stopped compiling for me after the latest Unity 2019 or so - so it doesn't build for android. Been in contact with Andre and he 'might' be working on it but haven't heard from him now for a few weeks.**
     
    Last edited: Aug 10, 2019
  46. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Sounds like you might have this asset then. have you tried it? I'm seeing if you can "teach" the bot responses through conversation and have it remember upon loading the app/game later.
     
  47. Thomas_DK

    Thomas_DK

    Joined:
    Feb 1, 2018
    Posts:
    3
    Hi guy's

    I am working my way through this great asset - and more or less editing my post everytime I find a solution ...hihi

    So today's question is, do any of you know why the bot sometimes is answering with the phrase "REDUCTION" in the middle of the sentence?

    Any help would be greatly appriciated!


    Best Wishes
    /Thomas
     
    Last edited: Aug 24, 2019
  48. Potion

    Potion

    Joined:
    Feb 5, 2018
    Posts:
    2
    I built a bot, but it cannot remember anything I teach it after I deactivate unity editor, what do I do?
     
    DigitalAdam likes this.
  49. Bartaty

    Bartaty

    Joined:
    Sep 29, 2016
    Posts:
    1
    Hey guys! I need the bot to work in Cyrillic. After replacing the encoding in .aiml with 1251, he began to output russian letters, but still cannot read them. Please help solve this problem.

    UPD. Solved by modificate Settings.xml file. But I have a new problem. Is it possible to break the sentence into separate phrases and answer all? For example, pattern "Hello, how are you?" break into the pattern "Hello *" and "* how are you?" and answer them accordingly in one or two messages. Now from this phrase the bot responds only to "Hello".
     
    Last edited: May 25, 2020
  50. LESCI

    LESCI

    Joined:
    Apr 12, 2017
    Posts:
    2
    Hello.

    I deleted (backup) the originals AIML's files and put mines there, but the bot is still using the originals AIML files, why?

    ----

    Update: I created a new project in Unity and re-downloaded the ChatBot. NOW if I remove the originals aiml files, the console shows an error and when you type a message in the play move it doesn't work (this didn't happens the first time I backed up the originals aiml). However... If I put my owns aimls the "aiml" directory (default's directory in the config/settings), the bot doesn't regonize me. So:

    1. How can I add my owns aimls? (I putted them in the default aiml folder; didn't work)
    2. How can I start "fresh"? I won't use any of your aiml (by the moment) and if I try to delete one of them, I receive an error in the console.
     
    Last edited: Aug 26, 2020