1 / 31

DESC9180 Designing Virtual Worlds

DESC9180 Designing Virtual Worlds. Week 8 Interactivity I – Designing Dynamic Virtual Spaces 6pm – 9pm Tuesday, September 11 th , 2007 Kathryn Merrick and Owen Macindoe. DESC9180 Designing Virtual Worlds University of Sydney, September 2007.

cael
Download Presentation

DESC9180 Designing Virtual Worlds

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. DESC9180 Designing Virtual Worlds Week 8 Interactivity I – Designing Dynamic Virtual Spaces 6pm – 9pm Tuesday, September 11th, 2007 Kathryn Merrick and Owen Macindoe DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  2. Lecture Overview • What is a dynamic virtual world? • Designing dynamic virtual worlds: • Tools • Techniques • Introduction to LSL Scripting Something Fishy Sim in Second Life DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  3. What is a Dynamic Virtual World? • Dynamic virtual worlds can change over time: • Simple dynamics: looping animations or scripted action sequences • Complex dynamics: elements can respond or adapt to user actions • Two key approaches: • Dynamic characters • Dynamic objects Dynamic objects: a rock that chases avatars DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  4. Tools for Designing Dynamic Virtual Worlds • Function libraries • Scripting languages • Built into the virtual world • APIs for industrial strength programming languages • Open source clients LSL built into Second Life DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  5. Function Libraries • A short list of triggers and commands that may be performed by an object: • Triggers: specify what must occur for a command to be carried out: • Eg: “bump” • Commands: an action to perform • Eg: “rotate” or “animate” • Several triggers and commands may be used together Active Worlds object properties window, including action field. DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  6. Scripting Languages • Syntax for defining complex action sequences including: • Memory (variables) • Branches (if… then…) • Loops (for…) • More expressive than Function Libraries • Permit more complex world dynamics • Generally include a function library DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  7. APIs and Programming Languages • Application Programming Interfaces: • Gateways through which external computer software can communicate with a virtual world • Programming Languages: • Even more expressive than scripting languages • More memory, extended libraries… DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  8. Using External Programming Languages • Second Life • Active Worlds XML-RPC AW Server SL Server External programming language C/C++ External programming language Java/C/C++/ Python etc LSL LSL XML-RPC DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  9. Open Source Clients • Online virtual worlds use a client server architecture • Client software code may • Be publicly available or • Have official mod kits • Users make specialised client software • Statistics packages • Bug fixes Server Client Client DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  10. Techniques for Designing Dynamic Virtual Worlds • Scripted commands • (Today’s lecture) • Artificial Intelligence (AI) • (Next week’s lecture) DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  11. Editor and Compiler Script edit window New script Save and compile script Script location Error window Reset script Running toggle DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  12. Introduction to the Linden Scripting Language (LSL) • Editor and compiler • States and events • Built-in functions • Variables • Flow control • Communication The Virtual Sentient, a dynamic virtual environment DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  13. State Machines • LSL is a state-machine based scripting language • State-machine based languages are common for designing dynamic virtual worlds Wait Deliver order Take order Simple state machine for a bartender… DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  14. States and Events: A Talking Table DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  15. States and Events (I) • Every script must have a default state with at least one event handler • This is where the script begins • You may then define other states as required… default { state_entry() { state happy; } } DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  16. States and Events (II) state happy { state_entry() { llWhisper(OPEN_CHANNEL, "I'm feeling happy."); } collision(integer num_detected) { llWhisper(OPEN_CHANNEL, "Ouch!"); state grumpy; } DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  17. Built-in Functions:A Cheeky Chair • Use built-in functions to allow your scripts to monitor and modify the world • http://wiki.secondlife.com/wiki/LSL_Portal DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  18. Built-in Functions DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  19. Variables and Types • A variable represents a piece of memory • A variable has: • A type (green) • A meaningful name (black) • An assigned value (after = sign) vector current_pos = llGetPos(); DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  20. Types • LSL has seven types: integer my_day = 28; float my_float = 4.9; vector my_pos = <1.6, 7.0, 5.4>; rotation my_rot = <1.6, 7.0, 5.4, 3.7>; string my_name = “Kathryn”; key my_key = “00000000-0000-0000-0000-000000000000”; list my_list = [23, “Test”, llGetPos(), my_name]; DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  21. Flow Control: A Welcoming Mat • Flow control defines the order in which statements in your scripts are executed • Two important concepts are: • If statements • Loops DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  22. A Welcoming Mat DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  23. Loops • Use loops to repeat one or more actions: integer i; for(i=0; i<num_detected; i++) { llWhisper(OPEN_CHANNEL, "Hello " + llDetectedName(i)); } DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  24. If Statements • Use an if statement to check a condition: stringname = llDetectedName(i)); if(name == “Sahi Kipling”) { llWhisper(OPEN_CHANNEL, “Welcome!"); } else if(name == “Illykai Pussycat”) { llWhisper(OPEN_CHANNEL, “Hello!"); } else { llShout(OPEN_CHANNEL, “Intruder alert!"); } DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  25. Communication:Lights • Scripts can communicate with other scripts on hidden channels DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  26. Lights DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  27. Paper Review (I) • Review a research paper, magazine article or online publication about virtual worlds. • Presentations in class on 2/10/2007 starting at 6pm • To be done in pairs DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  28. Paper Review (II) • Present the main ideas and conclusions of the article and your opinion of these. • Be prepared to discuss the article and your views with the class. • Each pair will have 10 minutes to make a slide show presentation and 5 minutes of audience questions and discussion. DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  29. Paper Review (III) • Sources: • Conference proceedings • University research group websites • Popular websites • Other DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  30. Tutorial • Visit the Virtual Sentient in Furness (206, 9, 56) • Take a copy of some of the scripts you have seen in today’s lecture • Use the scripts as a starting point to build your own dynamic device DESC9180 Designing Virtual Worlds University of Sydney, September 2007

  31. For Next Week • Reading: • Maher, M-L., Merrick, K.: (2005) Agent Models for Dynamic 3D Virtual Worlds, Proceedings of the 2005 International Conference on Cyberworlds, Singapore, pp 27-34. • http://www.cs.usyd.edu.au/~kkas0686/publications/cw2005v06.pdf DESC9180 Designing Virtual Worlds University of Sydney, September 2007

More Related