Libsecondlife: Bots Hyungwook Park. LSL vs. libsecondlife Linden Script Language (LSL)  Programming language used by residents of Second Life  Controls.

Slides:



Advertisements
Similar presentations
ACT! “Web” Plugins ACC Webinar (Part 1of 2) Brian Mowka and Jamie Aurand December 2010.
Advertisements

1 The ns-2 Network Simulator H Plan: –Discuss discrete-event network simulation –Discuss ns-2 simulator in particular –Demonstration and examples: u Download,
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Version Control System (Sub)Version Control (SVN).
CSE 4939 Alex Riordan Brian Pruitt-Goddard Remote Unit Testing.
Languages for Dynamic Web Documents
Web-Database Integration Week 8 LBSC 690 Information Technology.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
Using Visual Basic 6.0 to Create Web-Based Database Applications
M OTION P LANNING IN R EAL AND V IRTUAL E NVIRONMENTS F ALL 2007 Second Life: Introduction Russell Gayle Comp – Robot Motion Planning Fall 2007.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
HTML Form Processing Learning Web Design – Chapter 9, pp Squirrel Book – Chapter 11, pp
Internet…issues Managing the Internet
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
VCT May 20, 2009 Sapna Blesson Advisor: Dr.Christopher Pollett.
LSL: Linden Scripting Language Andrew Orr 12/17/07.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
1 Web Services Visual C# 2008 Step by Step Chapter 30.
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
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.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Internet Protocols & Client Server Programming
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Sikuli Ivailo Dinkov QA Engineer PhoneX Team Telerik QA Academy.
JavaScript & jQuery the missing manual Chapter 11
ASP.NET Dr. Ralph Westfall May, Web Development Problem HTML designed to display static pages only interactive when user clicks links  can’t provide.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
DATA COMMUNICATION DONE BY: ALVIN SAMPATH CARLVIN SAMPATH.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
 Project made incollaboration with Alan Hudson (London Metropolitan University)  Use Second Life as platform for e- learning  Second Life has a great.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
JavaScript, Fourth Edition
Using Visual Basic 6.0 to Create Web-Based Database Applications
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
Subversion (SVN) Tutorial Source:
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Version Control Menggunakan TortoiseSVN
CS590VC – Tutorial 6 Client-side connection through external application.
RUBRIC IP1 Ruben Botero Web Design III. The different approaches to accessing data in a database through client-side scripting languages. – On the client.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
WEB SERVER SOFTWARE FEATURE SETS
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
Copyright © 2002 Pearson Education, Inc. Slide 3-1 Internet II A consortium of more than 180 universities, government agencies, and private businesses.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
.NET Mobile Application Development XML Web Services.
The overview How the open market works. Players and Bodies  The main players are –The component supplier  Document  Binary –The authorized supplier.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
 Project Team: Suzana Vaserman David Fleish Moran Zafir Tzvika Stein  Academic adviser: Dr. Mayer Goldberg  Technical adviser: Mr. Guy Wiener.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Redmond Protocols Plugfest 2016 Jinghui Zhang Office Interoperability Test Tools (Test Suites and Open Source Projects) Software Engineer Microsoft Corporation.
How to develop a VoIP softphone in C# that enables SIP Instant Messaging (IM) This presentation describes how to create a softphone in C# that allows you.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
How to use SVN K.Somiya Tokyo Tech.
RDP Protocol Test Suite
Introduction to .NET Framework Ch2 – Deitel’s Book
Computer Terms Review from what language did C++ originate?
The Internet and Electronic mail
Presentation transcript:

Libsecondlife: Bots Hyungwook Park

LSL vs. libsecondlife Linden Script Language (LSL)  Programming language used by residents of Second Life  Controls the behavior of in-world objects and allows objects to interact with the Second Life world  State-event driven scripting language, in the sense of a finite state machine Libsecondlife (LibSL)  A software library to communicate with the servers that control the virtual world of Second Life Function by manipulating avatars  Reverse engineering of SL network protocol  Used both to query the state of the world and to send uploads and commands that will modify the state  Written in general purpose programming language (C#)

Bots in Second Life What is the difference between Avatar and Bot? Two types of bot  LSL based (prims) Come in many shapes and sizes Primarily server side code  LibSL based (avatars) Function by manipulating avatars Mixed computation from client and server  Network delay becomes an issue

Communication Network Second Life Server Client Second Life Server ClientDaemon Centralized network topology Client-server model Second LifeLibsecondlife Function Visualization

LSL Bot Prims with (motion) control  Control is defined through LSL  Integrated sensing (LSL sensors)  Can interface with remote resources Tour Guide (Aesthetica)

LSL Bots: LSL Limitations Language limitations  Emphasis on states and events  No native arrays, only sequential list can be used  Limited length for script (16KB)  make it difficult to develop large, complex applications Control limitations  Embedded in a prim, not in avatars  Cannot log into the world more than one avatar  Avatar cannot have the script, thus the prim has to be attached into the avatar

LibSecondLife Potential for complete avatar simulation  Reverse engineering of SL network protocol Based on C#  All C# features are available  Much more flexible programming environment Avatar control Client-server interface

LibSecondLife (continue) Disadvantages  Network traffic is subject to missed packets and limited by client performance  Not robust (Beta version v0.3.2) and lack of documentation  Combination with LSL will be one of possible solutions Demos  

LibSL: Getting Started (1) Prerequisites (For Windows)  C# compiler Visual Studio.NET 2005 (Windows) Visual Studio Express.NET (Windows, free)  Source code via SubVersion (SVN)* svn://openmetaverse.org/libsl/trunk  For more help: * Subversion (SVN) is a version control system. It is used to maintain current and historical versions of files such as source code, web pages, and documentation.

LibSL: Getting Started (2) Instructions  Create a folder named dev in C:\  In the dev folder, create a folder named libsecondlife.  Right click the libsecondlife folder, select SVN Checkout…  In the field for "URL of Repository", put svn://opensecondlife.org/libsl/trunk  Files should start getting downloaded.

How to create a basic libSL bot

LibSL: Sample code (1) using System; using System.Collections.Generic; using System.Text; using libsecondlife; namespace MyFirstBot { class MyFirstBot { public static SecondLife client = new SecondLife(); private static string first_name = "First"; private static string last_name = "Last"; private static string password = "password"; public static void Main() { client.Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnected); if (client.Network.Login(first_name, last_name, password, "My First Bot", "Your name")) Console.WriteLine("I logged into Second Life!"); else Console.WriteLine("I couldn't log in); } static void Network_OnConnected(object sender) { Console.WriteLine("I'm connected to the simulator"); client.Self.Chat("Hello World!", 0, ChatType.Normal); Console.WriteLine("Now I am going to logout of SL.. Goodbye!"); client.Network.Logout(); } Include libsecondlife libraries Define SecondLife client(s) Add your bot’s name Define a connected event Try to log in to the Grid When connected, send a message After your message, logout

LibSL: Sample code (2) using System; using System.Collections.Generic; using System.Text; using libsecondlife; namespace MyFirstBot { class MyFirstBot { public static SecondLife client = new SecondLife(); private static string first_name = "First"; private static string last_name = "Last"; private static string password = "password"; public static void Main() { client.Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnected); if (client.Network.Login(first_name, last_name, password, "My First Bot", "Your name")) Console.WriteLine("I logged into Second Life!"); else Console.WriteLine("I couldn't log in); } static void Network_OnConnected(object sender) { Console.WriteLine("I'm connected to the simulator"); client.Self.Chat("Hello World!", 0, ChatType.Normal); Console.WriteLine("Now I am going to logout of SL.. Goodbye!"); client.Network.Logout(); } string startLocation = NetworkManager.StartLocation("Second China", 179,165,31); if (client.Network.Login(first_name, last_name, password, "My First Bot", startLocation, "Your name")) string startLocation = NetworkManager.StartLocation("Second China", 179,165,31); if (client.Network.Login(first_name, last_name, password, "My First Bot", startLocation, "Your name"))

LibSL: Framework Most actions are defined within callbacks (events)  Network events OnConnected / OnDisconnected OnCurrentSimChanged  Client (Avatar) events OnInstantMessage OnChat OnTeleport  Object events OnNewAvatar / OnNewPrim OnObjectUpdated / OnObjectKilled

LibSL: Communication Send an instant message  client.Self.InstantMessage(target, "Hello, World!"); Say something  client.Self.Chat("Hey There World", 0, ChatType.Normal); Respond to instant message  client.Self.OnInstantMessage += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);  static void Self_OnInstantMessage(InstantMessage im, Simulator sim) Respond to chat  client.Self.OnChat += new AgentManager.ChatCallback(Self_OnChat);  static void Self_OnChat(string message, ChatAudibleLevel audible, ChatType type, ChatSourceType sourceType, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)

LibSL: Movement Teleport  client.Self.Teleport(“Second China", new LLVector3(128.0f, 128.0f, 50.0f));  client.Self.Teleport(new LLUUID("The-key-of-a-landmark"));  client.Self.OnTeleport += new AgentManager.TeleportCallback(Self_OnTeleport);  static void Self_OnTeleport(string message, AgentManager.TeleportStatus status, AgentManager.TeleportFlags flags)  LookAt(LLVector3 location) Walk  client.Self.AutopilotLocal(128, 128, 30); Animation  client.Self.AnimationStart(“UUID of animation”, true); System.Threading.Thread.Sleep(5000); client.Self.AnimationStop(“UUID of animation”, true);

Second China Demo Questions?