PrologVirtualWorlds Douglas
Miles
This Site is Still
under Heavy Construction |
|
This
site will supply you with information and libraries to
use an Edinburgh style of Prolog language in conjunction with a first person
VRML/MOO system. By combining two powerful tools: Microsoft Virtual Worlds
and SWI-Prolog we can represent episodic models of memory, diagrams for belief
engines, or just fun 3D role playing games. SWI-Prolog is a stable, free,
professional distribution of the prolog virtual machine and compiler.
Microsoft Virtual Worlds provides a complementary graphical environment: It
supports rapid prototyping of distributed multi-user applications of 3D virtual
communities with streaming media and chat. But most importantly it
supports a persistent, changeable world state that preserves object level
information.
The
Virtual Worlds Group http://vworlds.research.microsoft.com
is an organization of individuals who are dedicated to helping
advance the body of research on online multi-user applications. The founding
members of this group are employees of Microsoft
Research and
have created a software platform that enables users to build these applications
and quickly prototype user interfaces. They have released the source code of the
Virtual Worlds software in conjunction with the binary builds in an effort to
actively foster research. The platform is very general purpose and, as such, can
be used to build almost any type of multi-user application. You don't have to
know C++; you should have a basic knowledge of scripting. Interface and object
behavior is programmable in languages like VBScript, Jscript, DHTML and now
available through the Prolog compiler.
SWI-Prolog
was developed by Jan
Wielemaker at the University of Amsterdam's Department of Social
Science Informatics. SWI
needs no graphical capabilities and will not get them to ensure any logic
system can be embedded in an application with a low overhead under 1 MB. Prolog
is cross-platform and runs on Microsoft Windows 9x/NT/2000 and most
distributions of UNIX/Linux. It is connected to these systems using pipes and
shared libraries. Traditionally, people in the Prolog community have
written wrappers around the native (C) API of their system. Most of these API's
are fairly low-level and a lot of work is required to get the data types of the
API properly and naturally represented in Prolog. With a contribution to
SWI-Prolog by David
Hovel of SwiActX library, it is now possible to write prolog programs
that use Windows ActiveX/COM objects. SwiActX gives us access to
IDispatch/IUnknown named methods using
prolog style arguments. It also deals with collections and converts
variant data-types.
This enables RAD tools like Visual Basic to be used to manufacture extralogical
predicates. With a little care a programmer can make the objects work in a
manner respectful to prolog event interoperability.
PrologVirtualWorlds
Architecture Background
The Microsoft Virtual Worlds
Service is an object remote brokering system (ORBS): It is based on
many clients and a server sharing references to instances.
PrologVirtualWorlds takes advantage of this by using Agents. An agent is connected
to virtual worlds as an (in)visible Avatar to programmatically alter objects and
invoke methods. It can create or remove properties, design new
methods, and manufacture new object types. Other agents may assist in work
and run from different machines or languages. An agent itself is an
object and can alter it's own interface members, or of others. The
server maintains the consistency of the objects and facilitates news that may
have affected an agent. This
allows us power beyond conventional object orientated programming.
A simple example of agent orientated
programming inside a Moo:
-
A Rain Agent that enters a room object and emotes that it is raining.
It then begins adding a 'wetness counter' property to each object in
the room. The longer it stays in the room the more it
increments. (This does not have any functional impact on the current workings of
the objects in the room)
-
Later
you may want to write another agent who enters the room called
'Sun Agent' who's duty is to look for objects that have the property 'wetness'
to decrement.
-
A third
agent called 'Common Cold' can go thru and look for both a 'health property' and
a 'wetness property' and then decide to alter the 'smile method' from emoting
'beaming smile' to 'tries to smile from behind a stuffed up nose'.
Why
is this important?
As
since all of these actions are moving thru representation terms (it can be
graphically depicted) another agent may in tandem try to analyze what had
just happened and build a 'story script' object. The properties of such a script
are in an action-level-ontology language the represents an instantiated
scene ('story script' objects have a method called replay). Since
information about the methods and properties were public at the time the system
may at later replay the scenario placing different objects in place of the
originals in a non-deterministic way.
Sometimes
we do not have all of the information to heuristically search for a given
situation. As we discover new facts, the situation we learn was not
correctly represented. Since the situation is persistable we can re-instantiate
the episode and put better-educated agents to the task of understanding.
This one day I hope will further our technology and searchablity of
'scenario' and will allow better rule styles to be designed.
Brokering
Model (sites
are not places on the internet they are memory spaces that the object
resides in)
Virtual
World Server Site
|
It
holds the persistable objects and maintains the World Model Database.
The server system uses TCP and soon UDP to communicate to clients (Client
Site) about changes to the objects they are referencing.
|
Virtual
World Client Site
|
This
holds object interfaces shaped like the server objects. So they look
and act real to programmed code. When you invoke a method on an
object, a signal is sent to the server and it resolves the method to the
proper inheritance level. The correct code at the correct site is
then executed. If you expected a return object, it gives you a
proxy reference to the returned object.
|
Prolog
Virtual Worlds Client Site
|
This site holds references to the Virtual Worlds Client Site Interface
Objects.
This allows access in the below domains
Typelibinfo Morphism
Engine (TLM)
|
This is the wrapper site that resolves Prolog termed objects to
the Virtual World Client Site. It also reshapes the objects
based on user's belief settings. It is where the initial overloading of
method/properties takes place. Redirecting it to the proper
site/interface and properly reacts to prolog events.
|
PrologClient Site
(PCS)
|
PLWIN.EXE that is using SWIACTX.
The programmer places the code here to manipulate agents
and objects.
|
PrologServer Site
(PSS)
|
The object models
are kept track of inside a prolog wrapper ProQuery.dll that
uses another instance of SWI Prolog that is dedicated to the
(u/w) graph walking of object models and resolving both ways from the
Prolog Client terms to the Morphism wrapper objects. This
site was optional but really sped up the delivery of information and
later can be used to persist your prolog discontiguous global
settings.
|
|