Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    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:
    35
    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. Devision4

    Devision4

    Joined:
    Jan 12, 2013
    Posts:
    1,184
    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:
    35
    @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. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    849
    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:
    35
    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:
    3
    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:
    85
    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:
    35
    @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:
    85
    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:
    27
    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:
    35
    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:
    15
    Does this work with Unity 2017.1?
     
  14. Cyberschlumpf

    Cyberschlumpf

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

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    35
    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:
    13
    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:
    35
    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. mybreeze

    mybreeze

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

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    35
    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:
    41
    man, Is it support for pandoraBots? if not how to build my own data
     
  21. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    35
    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:
    112
  25. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    35
    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:
    112
    @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:
    35
    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.