3D Web Agents in Distributed Logic Programming Zhisheng Huang, Anton Eliens and Cees Visser {huang,eliens,ctv}@cs.vu.nl Intelligent Multimedia Group Vrije Universiteit The Netherlands 3D Web Agents are intelligent agents whose avatars can interact with users via Web browsers. These Web-based 3D avatars are usually constructed by means of the Virtual Reality Modeling Language VRML. Outline of This Talk 1 Main Features of 3D Web Agents 2 Requirements of Programming/Specification Languages for 3D Web Agents 3 Distributed Logic Programming Language (DLP) for 3D Web Agents 4 Examples 4.1 VRML-based Multi-User Soccer Game 4.2 Facial Animation in DLP 5 Conclusions Main Features of 3D Web Agents •Cross-Platform: Accessible for any Web browser with a VRML viewer; •Mobility: Accessible from anywhere over the Web; •Reactivity in Real Time: Can react in real time. No heavy rendering delay; •Flexibility: Rule-based knowledge representation makes the changes of behaviors rather easy. Need no re-programming. Requirements of General Programming/Specification Languages for 3D Web Agents • • • • VRML EAI support, like Java Multi-threaded control Object-Oriented Declarative language: rule-based knowledge representation/specification, like Prolog • Distributed communication/computation capabilities Architecture of Web Agents: Extended BDI Model Desire Intention Belief effectors sensors Sensor/Effector Primitives for 3D Web Agents getPosition(Object, X, Y, Z) setPosition(Object, X, Y, Z) getRotation(Object, X, Y, Z, R) setRotation(Object, X, Y, Z, R) getViewpointPosition(Agent, X, Y, Z) setViewpointPosition(Agent, X, Y, Z) getViewpointOrientation(Agent, X, Y, Z, R) setViewpointOrientation(Agent, X, Y, Z, R) Distributed Logic Programming DLP Distributed logic programming [Eliens:1992] combines logic programming, object-oriented programming and parallelism. DLP has been extended with a 3D VRML Client Interface Library, which includes the sensor/effector primitives for 3D web agents. Main Features of DLP for 3D Web Agents • Multi-threaded Language: modeling of independent intra or inter agent activities; • Distribution: high-level TCP/IP based facilities for distributed communication, thus DLP can be used to build virtual multi-user communities; • High-level communication Protocols: support for Agent Communication Languages (ACL); • Declarative Language: rule-based knowledge representation Benchmark Example: Soccer games on the Web Http://wasp.cs.vu.nl/wasp/ Features of VRML-based Soccer Games • • • • • • Multi-Agent Systems Multi-User Systems Reactivity Cooperation / Competition Dynamic Environments Distributed Communication Cognitive loop: sensing-thinking-acting thinking sensing Belief Intention Desire acting Cognitive model of soccer game Action Specification in Agent’s Knowledge-Bases • look-at-ball • run-to-ball • shooting • passing • move-around • run-and-trace • near-ball-then-kick • …... DLP code example: the action “Look-at-ball” look_at_ball(Player,Ball) :getPosition(Player, X,_,Z), getPosition(Ball, X1,_,Z1), X =\= X1, !, R is atan((Z-Z1)/(X-X1)) sign(X-X1)*1.57, setRotation(Player,0.0, 1.0, 0.0, R). DLP code example: the action “find-how-to-react” findHowtoReact(Agent, Ball, shooting):getPosition(Agent,X,Y,Z), getPosition(Ball, Xb,Yb,Zb), gatePosition(Agent,Xg,Yg,Zg), distance(X,Y,Z,Xb,Yb,Zb,Distb), distance(X,Y,Z,Xg,Yg,Zg,Distg), Distb =< kickableDistance Distg =< kickableGoalDistance. Agent Communication Language •agent communication languages (ACL) are used to serve as a high-level communication facility. •KQML and FIPA ACL which are based on speech act theory are popular agent communication languages. • A message in ACL usually consists of a communicative act, a sender name, a list of recipients, and additional content. • Communicative acts like 'tell', 'ask', and 'reply', are used to identify the communication actions which may change the mental attitudes of the agents. VRML-based client-server Architecture server VRML EAI VRML EAI VRML EAI browser browser browser client client client Shared Object •A shared object is an object whose state and behavior are to be synchronized across multiple clients 3D agent-based virtual communities •Virtual environments with embedded agents: autonomous agents are participants in virtual communities. •Virtual environments supported by ACL communication: Agent communication languages are designed to provide a high-level communication facility. The communication between the agents can be used for the realization of shared objects in virtual worlds. PAMELA as Presentation Agent Facial Animation H-anim 1.1 Compliant Avatars The intelligent agent avatars are designed to be H-anim 1.1 compliant, based on the specification for a standard humanoid proposed by Humanoid Animation Working Group. DLP code example: Eyebrow Up and Lip Move eyebrowUp_lipMove(Times,Interval, Range) :getPosition(eyebrowRight, X1,Y1,Z1), getPosition(eyebrowLeft, X2,Y2,Z2), eyebrow_up(eyebrowRight, 0.01), eyebrow_up(eyebrowLeft, 0.01), lipMove(lowerlip,Times,Interval,Range), setPosition(eyebrowRight, X1,Y1,Z1), setPosition(eyebrowLeft, X2,Y2,Z2). Conclusions • A technology for 3D web agents needs a general programming / specification language which merges aspects of object-oriented languages, web3D- oriented languages, and declarative languages. • The distributed logic programming language DLP is a general programming/specification language for 3D web agents. • DLP is a convenient tool for the implementation of 3D web agents.