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.
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?
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.
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.
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.
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
WHY SHOULD I JOIN A SYNDICATE*
Have more fun playing. Increase your chances of winning. All costs and winnings are shared. Play together in a team
Can I paste this into a aiml file somewhere and have the bot respond with the template code ?
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.
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:
bot.loadSettings(Application.dataPath + "/Chatbot/Program #/config/Settings.xml");
// Load AIML files from AIML path defined in Settings.xml
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.
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.
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.
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.
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.
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?)
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.
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