by Lloyd Borrett
AVBUG Backup, February 1997
ActiveX Technology for
Interactive Software Agents
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
Well Microsoft Agent is an ActiveX control that lets 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.
Microsofts 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 didnt mean much to me, so it was a while before I
got around to trying out Microsoft Agent. But now that I have,
Im 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
Microsofts 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 its 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 youll need speaker or headphones,
and for the speech recognition to work youll need a
Once you have downloaded and installed Microsoft Agent, use MS
Internet Explorer v3 or later to check out the examples on
Microsofts 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 Ive 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 heres a sample piece of
'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.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
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.
Heres an example:
'-- This method creates the commands
'-- Petals Around the Rose will use.
'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"
. (you can easily fill in the lines of code that were here)
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 were likely to
have a selection of characters to choose from.
Whats 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
MyAgent.Speak "Good one!"
MyAgent.Speak "Well done!"
MyAgent.Speak "You betcha!"
MyAgent.Speak "Got it!"
MyAgent.Speak "Good on ya mate!"
MyAgent.Speak "Fair dinkum!"
MyAgent.Speak strResult & " is correct!"
But wouldnt 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.
Saturday, 15 October 2011