1 / 24

A.I. in Second Life

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 Smart Object Autonomous Avatar Navigation Avatar Capable of Logical Reasonings Chatbots …. Retail Workflow .

korene
Download Presentation

A.I. in Second Life

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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]

  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 • 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 • Visit https://join.secondlife.com to create your account • Send me the account so that I can register you to U of A. island • Download and Install the Viewer • 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 entered • "touch_start": triggered when anyone touches an object.

  15. FUNCTIONS • Functions lay inside of events. • Built in functions: • all start with two lowercase L's. E.g., llSay(0, "Hello") • llSay takes arguments of a number and a string. • User define functions: • You can define own function beforedefault • 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, <0.4, 0.8, 1.6>]; vector vec_2 = <1,6,2>; //Generally used for position as xyz, but can be used to store 3 numbers to be parsed out later rotation _rot = <1,2,3,4>; //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(<1.0, 1.0, 1.0>, 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(<0.0, 0.0, 0.0>, 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 • Receiver • default • { • state_entry() • { • llListen(5,"","",""); • } • listen(integer channel,stringname, key id, string message) • { • if(message == "SayOne") • { • llSay(0, "One"); • } • } • Sender default { state_entry() { } touch_start(integer total_number) { llWhisper(5, "SayOne"); } } • 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 keyrequestid; default { state_entry(){} touch_start(integertotal_number){ requestid = llHTTPRequest("http://.../a.php?ids=a", [HTTP_METHOD,"GET"],""); } http_response(keyrequest_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=functions • LSL tutorials • http://wiki.secondlife.com/wiki/LSL_Tutorial

More Related