Presentation is loading. Please wait.

Presentation is loading. Please wait.

A.I. in Second Life Akihiro Eguchi. Why Second Life? Real world like environment where we can visually show the demo of our work E.g. ◦ Workflow ◦ Ontology.

Similar presentations


Presentation on theme: "A.I. in Second Life Akihiro Eguchi. Why Second Life? Real world like environment where we can visually show the demo of our work E.g. ◦ Workflow ◦ Ontology."— Presentation transcript:

1 A.I. in Second Life Akihiro Eguchi

2 Why Second Life? Real world like environment where we can visually show the demo of our work E.g. ◦ Workflow ◦ Ontology ◦ Smart Object ◦ Autonomous Avatar Navigation ◦ Avatar Capable of Logical Reasonings ◦ Chatbots …

3 Retail Workflow http://www.youtube.com/watch?v=_KY5LwFy-4s

4 Smart Objects http://www.youtube.com/watch?v=Je3As2Vp6gU Akihiro Eguchi, Craig W. Thompson, "Towards a Semantic World: Smart Objects in a Virtual World," International Journal of Computer Information Systems and Industrial Management, Volume 3, 2011. pp. 905-911.[pdf]pdf

5 Autonomous Avatar Navigation http://www.youtube.com/watch?v=kO8FQt7yXcs Hung Nguyen, Akihiro Eguchi, Daniel Hooten, "In Search of a Cost Effective Way to Develop Autonomous Floor Mapping Robots,"9th IEEE International Symposium on Robotic and Sensors Environments (ROSE 2011), 2011, Montreal, Canada.

6 Other Related Works RPI Demo of Eddie, The Four-Year-Old Avatar Chatting with an AI in Second Life Automated Avatars in Second Life AI patient in second life using scripted prim and challenge response AI patient in second life using scripted prim and challenge response Joshua Eno, Craig Thompson, "Virtual (and Real) World Ontology Services," IEEE Internet Computing, 16 May. 2011. IEEE computer Society Digital Library. IEEE Computer Society. and etc..

7 How to program in SL Tutorial of Linden Scripting Language

8 Create an account 1. Visit https://join.secondlife.com to create your accounthttps://join.secondlife.com 2. Send me the account so that I can register you to U of A. island 3. Download and Install the Viewer 4. Search U of A. island and teleport

9 Learn how to control Walk Run Fly Control View + drag mouse

10 Creating Objects Right click any place in the island to Edit Choose Create button Pick one shape and click any location where you want to place the prim at.

11 Editing Object If you click the object, you can change the xyz coordinate Rotate the object with keep pressing Ctrl Change the size of the object with keep pressing Ctrl + Shift

12 Link Objects together Shift + click objects you want to link together Then, Ctrl + L to link If you want to edit only a part of linked object, click Edit linked.

13 STATES A "State" in LSL is a section that is running, and waiting for events. Only one state can be active at a time per script. Every script must have a default state. Except for the default state, each state is defined by the word STATE followed by the name of the state.

14 EVENTS Events are inside of states. When that state is active, those events wait to be triggered and run the code inside them. "state_entry": triggered by the state being enteredstate_entry "touch_start": triggered when anyone touches an object.touch_start

15 FUNCTIONS Functions lay inside of events. Built in functions: ◦ all start with two lowercase L's. E.g., llSay(0, "Hello")llSay ◦ llSay takes arguments of a number and a string. User define functions: ◦ You can define own function before default ◦ E.g.: sayOutloud(string message) { llSay(0, message); }

16 Scripting! Right Click Object -> edit -> Content -> New Script -> Open New Script This script will basically say "Hello, Avatar!" on the public channel which is 0, and will then say "Touched." on the public channel when a user touches or clicks it.

17 Output in a chat box 10m range: ◦ llWhisper(Channel, "WHISPER STUFF"); 20m range ◦ llSay(Channel, "SAY STUFF "); 100m range ◦ llShout(Channel, "SHOUT STUFF"); Anywhere on the region ◦ llRegionSay(Channel, "REGION SAY STUFF"); Use Channel 0 to talk, others (-2147483648 ~ 2147483647) for obj-to-obj communication

18 LSL variables examples integer count = 2; //A whole number float measure = 1.2; //A number with decimal places string chars = "Lee"; //Any text within " " list words = ["This", "Is", "A", "List"]; list entries = ["A list may contain many types of values such as", 2, 1.2, ]; vector vec_2 = ; //Generally used for position as xyz, but can be used to store 3 numbers to be parsed out later rotation _rot = ; //Can also be used to store 4 numbers to be parsed out later

19 On/Off Example Using States default { state_entry() { llSay(0, "turning on!"); llSetColor(, ALL_SIDES); } touch_start(integer total_number) { state off; // sets the script to a new "state" and starts running "state off" } state off { state_entry() { llSay(0, "turning off!"); llSetColor(, ALL_SIDES); } touch_start(integer total_number) { state default; } If you click, it changes the state and changes the color

20 Use If /else. default{ state_entry(){ llSay(0, "Hello, Avatar!"); } touch_start(integer total_number){ if (llDetectedKey(0) == llGetOwner()){ llSay(0, "Owner Touched."); } else{ llSay(0, "Someone Else Touched."); } If the Owner touch, it says “Owner Touched.” Else it says “Someone Else Touched”

21 Obj-to-Obj communication Sender default { state_entry() { } touch_start(integer total_number) { llWhisper(5, "SayOne"); } Receiver default { state_entry() { llListen(5,"","",""); } listen(integer channel,string name, key id, string message) { if(message == "SayOne") { llSay(0, "One"); } Object 1 sends a command “SayOne” through the channel 5. Object 2 listens to the channel 5, and whenever it receives the message “SayOne”, It says “One”.

22 Use PHP key requestid; default { state_entry(){} touch_start(integer total_number){ requestid = llHTTPRequest("http://.../a.php?ids=a", [HTTP_METHOD,"GET"],""); } http_response(key request_id, integer status, list metadata, string body){ if (request_id == requestid{ llOwnerSay(body); } Send http request to a certain php file and receives the response

23 If you wanna program in C# OpenMetaverse foundation provides a C# library to directly connect to the SL http://openmetaverse.org/

24 Useful Links List of the built-in functions: ◦ http://lslwiki.net/lslwiki/wakka.php?wakka=fun ctions http://lslwiki.net/lslwiki/wakka.php?wakka=fun ctions LSL tutorials ◦ http://wiki.secondlife.com/wiki/LSL_Tutorial http://wiki.secondlife.com/wiki/LSL_Tutorial


Download ppt "A.I. in Second Life Akihiro Eguchi. Why Second Life? Real world like environment where we can visually show the demo of our work E.g. ◦ Workflow ◦ Ontology."

Similar presentations


Ads by Google