Lloyd Robert Borrett

Follow Lloyd on Twitter Friend Lloyd on Facebook Connect with Lloyd on LinkedIn Follow Lloyd on Pinterest

Microsoft Agent

by Lloyd Borrett
AVBUG Backup, February 1997

ActiveX Technology for
Interactive Software Agents

Imagine being able to interact with the users of your programs using an animated "genie" like character. The character has a range of animation sequences you can play for your users. You can move the character to a location on the screen and have it point to another location to highlight something. You can have the character "talk" to the user via its speech output facility and simultaneously display the text in cartoon-style word balloons. And the character supports speech recognition. It actually can listen to what the user says and let you respond accordingly.

Well Microsoft Agent is an ActiveX control that let’s you do all of this and much more. You simply add the appropriate calls to Microsoft Agent in your program and your users will have a "genie" to help them. No, this is not the new Office Assistant in MS Office 97. This is something much better. Microsoft’s own description of Microsoft Agent is:

"Microsoft Agent is a set of software services that supports the use of software agents as interactive personalities within the Microsoft Windows interface. By providing support for visual personalities, Microsoft Agent facilitates a new form of user interaction known as conversational interfaces, interfaces that leverage natural aspects of human dialogue and social interaction (also known as social interface), making interfaces more appealing and approachable for a wider variety of users."

That didn’t mean much to me, so it was a while before I got around to trying out Microsoft Agent. But now that I have, I’m quite excited by the ways in which Windows programmers will be able to use Microsoft Agent to enhance their programs.

The beta version of Microsoft Agent has been available from Microsoft’s web site at http://www.microsoft.com/intdev/agent since October ’96. Okay, so a single .EXE file that is 4.7 Mb in size does take a while to download, but it’s worth it. So much so that you should also download the Microsoft Agent documentation in Microsoft Word format (140 Kb).

The beta release of Microsoft Agent requires Windows 95 or Windows NT 4 (x86) and Internet Explorer 3.0 or later, a Pentium 100 MHz PC (or faster) with at least 16 Mb of RAM and 9 Mb of free disk space, plus a Windows compatible sound card. Naturally, to hear the speech output you’ll need speaker or headphones, and for the speech recognition to work you’ll need a suitable microphone.

Once you have downloaded and installed Microsoft Agent, use MS Internet Explorer v3 or later to check out the examples on Microsoft’s web site. Another web site with information about Microsoft Agent is run by Argo Technologies Inc. at http://www.argolink.com.

You can also visit a web page created to implement a challenge called "Petals Around the Rose" at http://www.borrett.id.au/computing/petals.htm. On this web page I’ve used VBScript to call Microsoft Agent and provide a friendly "genie" to help users taking the challenge. If a lapsed programmer like me can sit down with the Microsoft Agent documentation and produce a result like the "Petals Around the Rose" web page in one afternoon, it must be easy. Just how easy? Well here’s a sample piece of VBScript:

'Make the page client active
MyAgent.Active = True
On Error Resume Next
'Move the Agent and play the introduction
MyAgent.MoveTo 320, 90, True
MyAgent.Play "Greet"
MyAgent.Speak "Welcome to Petals Around the Rose."

The MoveTo method is used to move the Agent around the screen. No rocket science here.

The Play method plays the defined action and its associated animation. Currently there are some 28 animation sequences such as Acknowledge, Confused, Explain, GestureLeft, GlanceDown, Read, Sad, Surprised and Think. It really is that simple.

The Speak method uses the speech output engine to speak the specified text.

The Microsoft Agent can also maintain a list of commands that are currently available to the user. The user can use voice input or left mouse click on the Agent to access the commands. The Commands object is built using the Add or Insert method. Here’s an example:

'-- InitializeCommands
'-- This method creates the commands
'-- Petals Around the Rose will use.
SUB InitializeCommands
  'Disable the Commands object
  MyAgent.Commands.Enabled = False
  'Add the Order button
  MyAgent.Commands.Add "Roll","Roll","...[please] roll [the] [(dice|die)]"
  MyAgent.Commands.Add "Hint","Hint","...[please] [give] [me] [a] (hint|help) [please]"
  MyAgent.Commands.Add "Guess",,"...[accept] guess"
  MyAgent.Commands.AddSeparator "Gap"
  MyAgent.Commands.Add "Zero","Zero","(zero|0|oh)"
  MyAgent.Commands.Add "One",,"(one|1)"
  MyAgent.Commands.Add "Two","Two","(two|2)"
  . (you can easily fill in the lines of code that were here)
  MyAgent.Commands.Add "Nineteen",,"(nineteen|19)"
  MyAgent.Commands.Add "Twenty","Twenty","(twenty|20)"
  MyAgent.Commands.Enabled = True

It really is that easy to add such a useful new interface to your programs. And you should see the look of amazement on the faces of users when they see Microsoft Agent in action!

Microsoft plans to release information on how to create your own characters for Microsoft Agent. So soon we’re likely to have a selection of characters to choose from.

What’s the down side? Well I guess the percentage of business PCs with a sound card, speakers and microphone is still not high and an office full of people talking to their Windows programs could be noisy. But this configuration is becoming more common in home PCs. Plus, even without speech recognition and/or speech output active, the Microsoft Agent is still a valuable addition to the user interface.

It can be a bit tedious adding in appropriate sets of responses to be randomly chosen so as to keep the user dialogue more fresh and interesting. For example:

Select Case int(rnd*8)+1
  Case 1
    MyAgent.Play "Congratulate"
    MyAgent.Speak "Good one!"
  Case 2
    MyAgent.Play "Pleased"
    MyAgent.Speak "Yes!"
  Case 3
    MyAgent.Play "Surprised"
    MyAgent.Speak "Excellent!"
  Case 4
    MyAgent.Play "Acknowledge"
    MyAgent.Speak "Well done!"
  Case 5
    MyAgent.Play "Pleased"
    MyAgent.Speak "You betcha!"
  Case 6
    MyAgent.Play "Acknowledge"
    MyAgent.Speak "Got it!"
  Case 7
    MyAgent.Play "Pleased"
    MyAgent.Speak "Good on ya mate!"
  Case 8
    MyAgent.Play "Surprised"
    MyAgent.Speak "Fair dinkum!"
End Select
MyAgent.Speak strResult & " is correct!"

But wouldn’t it be great if all onorous programming chores were that difficult!

Well hopefully this introduction to Microsoft Agent has made you interested enough to download it and at least visit some of the web sites mentioned so that you can see Agent in action. Then it will only be a case of exercising your imagination and deciding just how you can use Microsoft Agent to improve the user interface of your programs.

Last modified: Saturday, 15 October 2011

home | about | weird mob | computing | interests | insight
Copyright © 1995-2021 Lloyd Borrett. All rights reserved.  ::  www.borrett.id.au
mob 0418 170 044  ::  tel +61 3 5904 9005  ::  email lloyd@borrett.id.au  ::  skype lloyd_borrett
twitter @borrett  ::  facebook lloyd.borrett  ::  linkedin lloydborrett