1
Second Life in Education And
The LSL Scripting Language
By Jordan Widiker
Computer Science
University of Wisconsin – Platteville
Abstract
Second Life is a virtual world developed by Linden Lab in 2008. Since its conception, Second Life has grown into a thriving virtual community with over 1 million residents. Around 150 Universities and educational institutions have an officially recognized presence within Second Life, and many more that are not officially declared to Linden Labs as education-based. With this large number of institutions using Second Life as a teaching aid, we will consider and discuss the virtual space needs as a valid and viable alternate means of teaching and information transmission.
All content within Second Life has been created by its residents, for its residents. Many of these creations are given life and function through ‘scripts,’ small programs written in the Linden Scripting Language (LSL). LSL is a basic language that acts similar to C++, with a large well-documented library of specialized functions to interact and handle the virtual environment.
Introduction
“It seems that you've been living two lives. One life, you're Thomas A. Anderson, program writer for a respectable software company. You have a social security number, pay your taxes, and you... help your landlady carry out her garbage. The other life is lived in computers.” (Agent Smith, The Matrix)
For many, the words “Virtual Reality” likely induce visions straight out of a science fiction movie, with people trapped in a world much like our own, where the lines between the virtual world and the real one are blurred beyond recognition; a world where we can live a second life, separate and free from the constraints of this one. While this world is a long way off, the virtual worlds of today do allow users to be freed from some of the limitations of our world.
For some, it is the miracle of freedom from disabilities, such as the wheelchair-bound being free to walk and run everywhere. For others, it is obvious things like the ability to fly, or drive a giant robot. But for many, in what I consider the most important reason to discuss here, it allows them to overcome obstacles that keep them out of a classroom, and provides the ability to take part in the learning experience in a three-dimensional, interactive environment. We will discuss this freedom and how a number of universities are currently using it.
This freedom is especially useful for those just beginning to learn the sometimes strange and confusing world of computer programming. Second Life provides early programmers with a simple, easy-to-understand language that, while not likely to become an industry standard, shares many key features with languages that are taught in introductory programming classes. In addition, the language existing within a virtual world allows students to produce applications with a more visual feedback than a similar text-only based interface that is common to programs in introductory courses. This language and its features and applications will be discussed later.
Second Life
Second Life is owned and produced by Linden Lab, which was founded in 1999. It was developed for four years, ending in an initial release in June of 2003. It is a massive virtual world made up of roughly thirty thousand parcels of land known as simulators. Each simulator is 256 meters by 256 meters in size, totaling at around two billion square meters. Just under one third of that land is held in a set of large continent-sized clusters known as “The Mainland,” while the remaining two-thirds are separated in various smaller privately-owned clusters known as estates. As of March 23rd, 2012, there have been 28,465,253 accounts created on Second Life, with fifty to sixty thousand users online at the same time on average. [2]
Getting Started in Second Life
Account creation in Second Life is quick and easy, and a new user is able to be out and exploring all of the educational locations available within five minutes of account creation. Second Life is free and available to anyone age 16 and up. Any residents suspected of being under the age of 16 may have their account locked until they can provide evidence verifying their age. Despite this, Second Life does allow accounts to be used by students of age 13-15 as long as they remain on estates owned by sponsoring institutions, and do not wander the greater of Second Life.
The choices of starting appearance reflect the wide and varied community within Second Life, ranging from human to rabbit, vampire to robot, and even a miniature flying airship. All starting avatars are landed into an orientation location upon initial log-in, where they are taught basic controls and how to interact with the virtual environment. Once this orientation is complete, avatars are released into the world around and free to seek whatever they desire in their virtual experience.
Land in Second Life
As previously stated, over two-thirds of the land within Second Life is owned and operated by private residents. To buy land directly from Linden Lab, a user must have a premium account, which unlike the basic account does cost an annual rate of $72/year, but provides additional customer support, a small home, access to premium-only locations, and a stipend of the in-world currency, known as Linden Dollars. Because Linden Dollars are purchasable by anyone, offsetting the value of this stipend against the cost, the annual cost of a premium account allowing the free home and additional access costs merely $14/year. Despite this, many land owners are users of basic free accounts, who obtain land through third-party land developers, likely at a minor up-charge from the cost paid by the developer.
Simulators within Second Life come in a variety of different prices, based on the needs of the customer. All simulators are the same size, but they vary in the number of avatars and primitives, which are the basic building blocks of any creation within Second Life, that are supported on the simulator. The types of land available and their respective costs are shown in Table 1.
Table 1: Simulator Types in Second Life
Simulator Type / Avatars Supported / Primitives SupportedFull Sim / 100 / 15,000
Homestead Sim / 20 / 3,750
OpenSpace Sim / 10 / 750
Second Life and Education
As of late January 2012, over 150 educational institutions have registered as participating with Second Life. These institutions range from Saint Leo University in Saint Leo, Florida to the University of Queensland in Brisbane, Australia. As pointed out in the article by Hsiao-Cheng Han, the draw of virtual world learning environments is the ability to not only see the screen names of those present like in traditional distance-learning software, but also an avatar as a stronger visual representation of each individual present. This allows for a greater sense of community and a feeling of presence alongside others sharing the experience from far away. Educational locations within Second Life take a number of forms, from classrooms to museums, and learning can occur from interacting with other people in discussions, or from interacting with models and displays in giant dioramas.
Classrooms
Classrooms within Second Life can take a variety of forms. From a virtual replica of the traditional classroom and university layout to a ring of chairs in the middle of a large yard, classrooms can vary in shape, size, and style based entirely upon the needs and desires of the institution and of the students.
In the Ohio State University estate, a cluster of traditional brownstone buildings are constructed, with all of the key features of a college campus, from the lecture halls with seating for twelve-to-twenty-five students each, to small group video viewing areas, to a student lounge with various couches and games available for relaxation, to even such features as a cluster of three food-service establishments. These food locations, while obviously not necessary, are set up as part of a nutrition game to raise awareness of the nutritional information and effects of the kinds of food that students are likely to eat, offering such information as an estimation of how much weight a student may gain or lose in a week, month, or year of eating in the way that they do during the simulation.
In contrast, the Bowling Green State University virtual campus has a much more open feel, with whimsical bridges and vast interactive art exhibits showcasing the work of university students. Upon arriving in the BGSU estate, visitors are met by a sign advertising a six-week, three-credit introductory art course offered 100 percent online for non-art majors covering “Historical and aesthetic components of art with laboratory or online experiences with basic elements of creative expression.” Upon wandering deeper into the campus grounds, a visitor is met by a large, modern-art-inspired building with many rooms, including a 400-seat theater, that is a demonstrative model of the Wolfe Center for the Arts, a matching building intended to be built on the BGSU physical campus.
Museums
What a college or university may possess in a quantity of students, other forms of education- and science-related institutions make up for in materials and knowledge. These establishments, such as the International Spaceflight Museum and the Genome region, both in the science cluster known as SciLands.
The international Spaceflight Museum is a volunteer- owned and operated pair of simulators. It neighbor's NASA's Explorer Island, and the grounds hold a large number of informative and entertaining exhibits. These range from scale models of many historic spacecraft, satellites, and the planets along with matching-scale models of their moons, to moving, interactive diagrams explaining the complex concepts of space travel and exploration such as ion engines and how space telescopes work.
The Genome region, as the name implies, is centered around and full of information about genetics. In the center of the sim is a large tower, which is split into levels portraying the methods and findings of various genetic experiments performed throughout history, and their findings. Of special interest among these floors are the comparison of chromosomes between similar species of animals, most notably the comparison between humans and chimpanzees, and the complex, tangled model of lysozyme, the enzyme found in many types of human secretions that functions as an antibacterial.
Discussion
One of the greatest features of virtual worlds such as second life is the ability to, within seconds, cross the gap between any two places, and the resulting ability to meet and talk to people from all over the world at far less cost than an actual physical meeting would be. This allows for greater discussion and understanding across borders and between people that would otherwise not have the ability to learn from each other. There are a great many locations set up within Second Life to organize and encourage these discussions, such as the simulator Virtually Speaking and NPR's Science Friday's listening and question-asking location in Science School.
In the simulator Virtually Speaking, there is a large amphitheater where there are between three and five discussions held every week, which are recorded and available for later listening on iTunes. The topic of these discussions varies greatly, with shows focusing on science, the media, and politics from a number of different viewpoints. Some topics and
In the Science School sim, which is also part of the SciLands cluster, between displays explaining how various types of telescopes work and a cross-sectioned nuclear power plant, the weekly National Public Radio show called Science Fridays holds a listening circle, where fans of the show can listen to it live together and ask questions to the host's avatar, which may then be asked to the guests of the show on the air to be answered and discussed.
Dioramas
While interaction with other people is one of the best ways to learn and share information, it is known that for some visual interaction is the greatest means of learning. For these individuals there are several locations that exist within Second Life to provide a vast, immersive demonstration of the concepts being presented. Along with the museums discussed above, two locations of note are the Virtual Mine and University of Washington's Maya Island.
Virtual Mine is a region dedicated to the education of where our electricity comes from, and the realization of how prevalent the use of electricity is in our culture today. Upon landing in the region visitors are given a hard hat and perform the steps necessary to strip-mine an area for coal. These steps include such things as clearing the area for trees and placing explosives to blast the topsoil free from the deposits. Moving down the line, visitors are requested to turn off every device that is using electricity, the discovery of such is more difficult than a person would first believe. At the end of the line, visitors are allowed a look into alternative energy sources through the use of games, such as assembling solar panels in a Tetris-like style onto the roof of a barn, or assembling a set of pipes around rocks in the way to power a water turbine.
Maya Island is a large, intricate look into the ancient Mayan society. This look is taken in three parts: Mayan Agricultural practices, Mayan Medicinal practices, and Mayan pastimes. A visitor to the region will be astounded to learn of the advanced agricultural technologies that the ancient Mayans possessed, such as crop rotation, the lack of which in Europe led to such catastrophes as the great Potato Famine in Ireland. In the medicinal section, visitors learn about the practices of Mayan shamans, known as Ha'men, including the production of hallucinogens as part of ceremonies and for use in pain relief. In the pastime section, visitors are able to take part in the ancient Mayan ball game and learn the meaning of some Mayan symbols through a matching-game.
The LSL Programming Language
One of the most obvious fields of learning that can benefit from the use of Second Life is that of computer programming, with a closer focus on introduction to computer languages. The Linden Scripting Language, commonly shortened to LSL, is a programming language with many basic features similar to C or C++. It is a procedural, event-driven language that was originally compiled in Linden Lab's in-house LSL Bytecode, but Linden Lab has within recent years added the option of script compilation in Mono.
Mono Vs LSL Bytecode
With two options for compiling LSL programs, the simple and obvious question is: What's the difference. The key answer to that lies in memory. LSL code is now compiled into Mono by default because of two advantages related to memory. Mono-compiled code is given a maximum of 64 kilobytes of memory for storage as opposed to the LSL Bytecode's 16 kilobytes. Four times the space obviously allows for larger portions of code, which allows for lower coupling. This greater quantity of space is possible thanks to the fact that Mono-compiled code is allocated memory dynamically as opposed to statically like LSL Bytecode. When an LSL-compiled code is created, it is given exactly 16 kB to work with, and that memory is blocked off from use by other codes. Thus, no matter how simple of code it is, each instance of code within a simulator is taking up the maximum memory that it can, using up the simulator's resources much faster. With Mono-compiled code, if a portion of code only needs 2 kB, it only takes that much, and leaves the additional space for other portions of code to use. Additionally, multiple instances of the same Mono-compiled code share their allocated space within a server, further freeing up code memory space.
An additional difference between compilation in Mono and the LSL Bytecode is the handling of the mathematical taboo that is dividing by zero. A portion of code compiled in the LSL Bytecode will declare that it has encountered a math error and crash, with no means of recovery other than manually restarting the script. Mono on the other hand, handles the division by zero case by returning a value that is read by the code as infinity.
An LSL Script at a Glance
Programs in the LSL language, generally known as scripts, are portions of code created to perform any number of functions for the interaction between primitives and the virtual world around them, including avatar/primitive interaction. They are made up of states, the original and required of which is named “default” as shown in Figure 1, which are then broken down into various events, which are triggered by various means. Code may not reside within a state without also being contained within an event, but functions and variables global to the script may exist outside of states, to be shared between various events and states. Looking at the figure below, the reader may be amused to see that the script is one word off from being the classic beginner program “Hello World.”