Mr. Giansante
Alice 3D Programming
February ebruar y 2009
Table of Contents Learning Outcomes
..................................................
NETS Standards for Students What is Alice?
..................................
4
...........................................................
5
The Alice Environment Tutorials
3
.............................................
6
....................................................................
7
Example Worlds
.......................................................
Methods and Events Kangaroo Program
..................................................
11
.......................................................
12
Sample Programs
16
...................................................
17
Assignments
17
Assignment 1: 20 Second World
18
Assignment 2: Interactive W orld
19
Assignment 3: Three Minute World
20
Assignment 4: Large Interactive W orld
...............................................
Animating Character Motion Elements of Game Design
...................................
......................................
............................................................
Storyboard Example
...............................................
Storyboard Template
Mr. Giansante
Pages that need to be printed are marked with a printer icon.
.....................
Posting on YouTube
Storyboards
9
10
Detecting Collisions with the Ground
Please consider the environment before printing anything from this document.
8
.................................................
Continuous Motion Shark Program
.................................................
PRINTING
..............................................
-
.................. ..........
23
............................
24
........................
................ ..
25 26
21 22
Note: Note:
Students will choose either assignment 3 or assignment 4.
3D Programming with Alice - Table of Contents
Learning Outcomes The student will ... General
Demonstrate proper care of all computer equipment Demonstrate positive attitudes and work habits Demonstrate interpersonal and organizational skills Demonstrate Problem Solving Skills Make Productive Use of Time Demonstrate independence skills and only seek help when necessary
The Alice™ Environment
Place objects into the Alice World Change properties of the World Manipulate objects (size, orientation) at design time Use the Object Tree to select objects Use the Details Area to manipulate properties Use simple methods such as Move and Turn Use decision statements such as If Else Use repetition structures such as Loop, Do Together and While Play a World Export a World to YouTube Storyboarding a multimedia project -
Advanced
Create Methods Add a Key Typed Event Add a Mouse Clicked Event Add Mouse Clicked Details Use the Object Clicked On
Mr. Giansante
3D Programming with Alice - Page 3
NETS Standards for Students National Educational Technology Standards (NETS•S) and Performance Indicators for Students "What students should know and be able to do to learn effectively and live productively in an increasingly digital world ..." 1. Creativity and Innovation Students demonstrate creative thinking, construct knowledge, and develop innovative products and processes using technology. Students: a. b. c. d.
apply existing knowledge to generate new ideas, products, or processes. create original works as a m eans of personal or group expression. use models and simulations to explore complex systems and issues. identify trends and forecast possibilities.
2. Communication and Collaboration Students use digital media and environments to communicate and work collaboratively, including at a distance, to support individual learning and contribute to the learning of others. Students: a. b. c. d.
interact, collaborate, and publish with peers, experts, or others employing a variety of digital environments and media. communicate information and ideas effectively to multiple audiences using a variety of media and formats. develop cultural understanding and global awareness by engaging with learners of other cultures. contribute to project teams to produce original works or solve problems.
3. Research and Information Fluency Students apply digital tools to gather, evaluate, and use information. Students: a. b. c. d.
plan strategies to guide inquiry. locate, organize, analyze, evaluate, synthesize, and ethically use information from a variety of sources and m edia. evaluate and select information sources and digital tools based on the appropriateness to specific tasks. process data and report results.
4. Critical Thinking, Problem Solving, and Decision Making Students use critical thinking skills to plan and conduct research, manage projects, solve problems, and make informed decisions using appropriate digital tools and resources. Students: a. b. c. d.
identify and define authentic problems and significant questions for investigation. plan and manage activities to develop a solution or complete a project. collect and analyze data to identify solutions and/or make informed decisions. use multiple processes and diverse perspectives to explore alternative solutions.
5. Digital Citizenship Students understand human, cultural, and societal issues related to technology and practice legal and ethical behavior. Students: a. b. c. d.
advocate and practice safe, legal, and responsible use of information and technology. exhibit a positive attitude toward using technology that supports collaboration, learning, and productivity. demonstrate personal responsibility for lifelong learning. exhibit leadership for digital citizenship.
6. Technology Operations and Concepts Students demonstrate a sound understanding of technology concepts, systems, and operations. Students: a. b. c. d.
understand and use technology systems. select and use applications effectively and productively. troubleshoot systems and applications. transfer current knowledge to learning of new technologies.
© 2007 International Society for Technology in Education. ISTE® is a registered trademark of the International Society for Technology in Education.
Mr. Giansante
3D Programming with Alice - Page 4
What is Alice? Alice is an innovative 3D programming environment that makes it easy to create an animation for telling a story, playing an interactive game, or a video to share on the web. Alice is a free and open source object oriented educational programming language with an integrated development environment (IDE). Alice uses a drag and drop environment to create computer animations using 3D models. -
-
-
Alice allows users to learn fundamental programming concepts in the context of creating animated movies and simple video games. In Alice, 3 D objects populate a virtual world and the programmer can write code to animate the objects. -
Alice was developed by researchers at Carnegie Mellon University. The project leader was the late Randy Pausch, famous for his "The Last Lecture" (look it up on YouTube).
VIDEO Before starting this unit, watch the following videos: Alice Promo.wmv (8 minutes) Alice Demonstration.wmv (12 minutes) Inserting Objects.wmv (7 minutes) Basic Animation.wmv (9 minutes)
The current version is Alice 2.0 The latest beta version is Alice 2.2 Game maker Electronic Arts (EA) has agreed to help underwrite the development of Alice 3.0 and provide essential arts assets from The Sims™ the best selling PC video game of all time. The Sims content will transform the Alice software from a crude, 3D programming tool into a compelling and user friendly programming environment. Experts predict that when the transformation is complete, the new programming environment will be in position to become the national standard for teaching software programming. -
-
-
Sources: alice.org, WikiPedia.org
NOTE Alice Website
From the Alice website, you can download Alice onto your home computer. You can also download additional 3D models. www.alice.org
Alice 2.0
Mr. Giansante
Alice 3.0 Featuring characters from The Sims™
3D Programming with Alice - Page 5
The Alice Environment
World Window It shows you the world you are building.
Events Area It allows you to tell Alice when to make certain objects do certain things.
Object Tree It contains a list of the objects in your world.
Details Area It provides more information about the world or an object in the world.
Editor Area It allows you to make objects in your world do new things like move and spin.
Mr. Giansante
3D D Programming with Alice - Page 6
Tutorials When you start Alice, the following window should appear (you may need to click on the "Tutorial" tab). If the window does not appear, go to File | New World Complete the four tutorials included with Alice.
Tutorial 1
This tutorial will introduce you to the basics of Alice.
Tutorial 2
In this tutorial, you will learn how to teach Alice worlds and objects how to do new things.
Tutorial 3
In this tutorial, you will learn how to make Alice worlds respond to mouse clicks and key presses.
Tutorial 4
In this tutorial, you will learn how to create your own scenes.
Mr. Giansante
3D Programming with Alice - Page 7
Example Worlds Once you have completed the four tutorials, you should explore some of the example worlds that come with Alice. When you start Alice, the following window should appear (you will need to click on the "Examples" tab). If the window does not appear, go to File | New World
Example World - lakeSkater
This example world is a very good example of what you can do using Alice.
Example World - amusementPark
Use the arrow keys to navigate through the Amusement Park world.
Example World - flightSimulator
Use the arrow keys to turn plane left/right/up/down. Use the Space Bar to make the plane do a barrel roll. Go through all 5 rings to get a prize. Example World - snowLove
This example is a good guide for the first assignment "10 Second World".
Mr. Giansante
3D Programming with Alice - Page 8
Methods and Events A Method is a sequence of instructions that will be carried out when requested.
A Primitive Method is a Method that characters already know how to perform. Examples:
move turn say
orientTo(asSeenBy) roll(direction,amount) playSound(sound)
A Custom Method is a Method that is specific to a particular object. For example, an object constructed from the Penguin class has the following custom methods in addition to the primitive methods: wing_flap jumping turn_head_right walk
glide jump turn_head_left walking
In addition to the primitive methods and the custom methods, it is also possible for the programmer to create their own new methods for objects. These are known as User Created Methods.
An Event is some signal or action that can be detected and responded to by a program. Examples:
World starts The mouse is clicked on an object The user presses a key
An Event Handler is a method that performs some action when a particular event is triggered
Mr. Giansante
3D Programming with Alice - Page 9
Kangaroo Program The following program will make a kangaroo jump forward three times. The first command makes the kangaroo move up (jump) up 0.5 meters. The second command makes the kangaroo move forward 1 meter. Because they are in a "Do Together" loop, the two actions will happen simultaneously.
Now, we need to make the kangaroo return to the ground. The first command makes the kangaroo move down 0.5 meters. The second command makes the kangaroo move forward 1 meter. Because they are in a "Do Together" loop, the two actions will happen simultaneously.
The above code, when done in sequence, will result in the kangaroo jumping forward once. The kangaroo will reach a height of 0.5 meters and will have travelled a total of 2 meters (1 meter on the way up, and 1 meter on the way down). We can repeat this process 3 times by simply placing the above code in a "Loop" structure.
The motion could be made more realistic by turning the kangaroo's legs slightly when it jumps up and also when it lands.
Mr. Giansante
3D Programming with Alice - Page 10
Continuous Motion This world will illustrate how to create a simple game in which the user can control a rabbit. The idea will be that the user does not have to constantly press a key to make the rabbit move, but rather that the rabbit will constantly move forward. The user will be able to turn the rabbit left or right.
Create the method to turn the rabbit right ...
Create the method to turn the rabbit left ...
Create the method to constantly move the rabbit forward ...
Note the use of "Loop Infinity Times" as well as "Wait" Finally, create events the trigger the methods you have just created ...
Mr. Giansante
3D Programming with Alice - Page 11
Shark Program - Part Part 1 In this example, we will create a world with a shark that can be controlled by the user. The user will be able to turn the shark left or right, using the "left" and "right" arrow keys. The user will be able to move the shark forward, using the "up" arrow key. If the user clicks on one of the scuba divers, the shark will turn to face the scuba diver and then swim to it. Begin by creating a new world using the water template.
Add one shark object (found in the "animal" category). Add four scuba diver objects (found in the "people" category).
Arrange the items as indicated in the picture above. Note: You will need to move the scuba diver down into the water.
Select the Shark object.
Create a New Method.
Name the Method " turnLeft".
In the shark.turnLeft code area, enter the following:
Mr. Giansante
3D Programming with Alice - Page 12
Shark Program - Part Part 2 Create a New Method.
Name the Method " turnRight".
In the shark.turnRight code area, enter the following:
Create a New Method.
Name the Method " swim".
In the shark.swim code area, enter the following:
The swimming motion could be made more realistic by having the shark's body move left and right a small amount, but for simplicity, we will not do that.
Create a New Method.
Name the Method " gotoObject".
Mr. Giansante
3D Programming with Alice - Page 13
Shark Program - Part Part 3 Create a New Parameter
Name the Parameter: supper
In the shark.gotoObject code area, enter the following:
Now, we need to create Events and link them to the Methods we have created.
You will need to do this four times (once for each of the Events listed below, excluding the first one which is automatically there).
Mr. Giansante
3D Programming with Alice - Page 14
Shark Program - Part Part 4 We will now add code to the program that will allow the shark to submerge. The [SPACE] bar will control the sharks postion. If the shark is above the water and the [SPACE] bar is pressed, it will submerge. If the shark is below the water and the [SPACE] bar is pressed, it will return to the surface. Declare a Boolean (True or False) Variable in the Shark’s properties ...
The initial value of the variable is false since the Shark is at the surface. Create the Method to turn the submerge or surface the Shark ...
Finally, create an Event that will trigger the above Method when the [SPACE] bar is pressed.
Mr. Giansante
3D Programming with Alice - Page 15
Detecting Collisions with the Ground It is often useful to determine if an object has crashed with the ground (ex. flight simulator program). The distance to function is not ideal since it measures the distance from the center of the object to the center of the ground. So, unless the object is directly over the center of the ground, it will not produce the desired effect. We need to use the distance above function. Inserting the distance above method into an If Then statement is a bit tricky. -
Begin by inserting the If Then statement. -
Now, insert a function from the Math category of the World's available functions into the condition part of the If Then. -
Functions available in the Math category of the World's functions ... Equal to Not Equal to Great Than Greater Than or Equal to LessThan Less Than or Equal to
Finally, you can insert the distance above function from the object (in this case, a Blimp). The best place to insert the If Then statement is immediately after you move the object down. -
The code above simly set's the Blimp object's opacity to 50% when it hits the ground.
Mr. Giansante
3D Programming with Alice - Page 16
Sample Programs Open the following sample programs and play the worlds. You can view the code to determine how certain effects were achieved. Bouncing Ball.a2w Dragon Circling Castle.a2w Dragon Descends to Drawbridge.a2w Dragon Flapping Wings.a2w Dragon Shaking Head.a2w Girl Approaching Horse.a2w Girl Riding Horse.a2w Helicopter Flight Simulator.a2w Jumping Fish.a2w Marching Soldier.a2w Wizard and Trolls.a2w
Posting on YouTube It is possible to export Alice worlds to video. Note: The newest beta release of Alice (Alice 2.2) has this function built in. -
VIDEO Watch the following videos: Posting on YouTube Part 1 -
Posting on YouTube Part 2 -
Posting on YouTube Part 3 -
Mr. Giansante
3D Programming with Alice - Page 17
Animating Character Motion
Source: J. Foley www.erain.com
Mr. Giansante
3D Programming with Alice - Page 18
Elements of Game Design Game Development is the software development process by which a video game is developed. Development is undertaken by a game developer, which may range from a single person to a large business. Mainstream games are normally funded by a publisher and take several years to develop. Indie games can take less time and can be produced cheaply by individuals and small developers. The indie game industry has seen a rise in recent years with the growth of new online distribution systems and the mobile game market. Mainstream games are generally developed in phases. First, in pre production, pitches, prototypes, and game design documents are written. If the idea is approved and the developer receives funding, a full scale development begins. This usually involves a 20–100 man team of various responsibilities, such as designers, artists, programmers, testers, etc. -
-
Source: Wikipedia.org Video game development -
Game Design, a subset of game development, is the process of designing the content and rules of a game in the pre production stage and design of gameplay, environment, storyline, and characters during production stage. Game design requires artistic and technical competence as well as writing skills.
-
Source: Wikipedia.org Game design -
Components of a Game A game is made up of elements that work closely together. Space
The look and feel of a game come from the design of its space.
Compontents
Compontents are the parts of your game like your avatar, blocks and enemies. These are known as "nouns".
Mechanics
Mechanics are the actions in the game like jumping or collecting. These are known as "verbs".
Goals
Players try to achieve goals to win the game. Victory Conditions Actions that will result in a player(s) winning the game. Failure Conditions Actions that will result in a player(s) losing the game. -
Rules
Rules guide the player on how the game should be played.
Source: GameMaker documentation, FETC 2012 Presentation.
Challenge vs. Reward The best video games balance challenge and reward. Bad video games have too much challenge and/or little reward. Good video games also have "replay value". In other words, something about the game makes players want to play it many times.
Mr. Giansante
3D Programming with Alice - Page 19
Storyboards A storyboard can be loosely defined as a visual script. That visual script is a sort of comic strip, based on a written script. A good storyboard clearly and explicitly explains what happens in a film (for instance), where it happens, and how it happens.
Storyboard Example A scene from "Moon Escape", by Josh Sheppard
Mr. Giansante
3D Programming with Alice - Page 20
Storyboard Example The storyboard example on the previous page was produced by professional designer. Such results are very time consuming and require specialized drawing skills. For the purposes of this class, you should use the storyboard template on the following page and the results should look something like the example below. -
Mr. Giansante
3D Programming with Alice - Page 21
Title:
Page _____ of _____
by:
Date:
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
_________________________________________________
Mr. Giansante
Lincoln High School
Mr. Giansante
Mark (10)
3D Programming with Alice
20 Second World
Assignment Description Create a 20 second Alice world. A good example of what your finished product should look like is the snowLove world that can be found in the example worlds that come with Alice. However, your world should contain a minimum of 10 objects and last a minimum of 20 seconds. You must submit a storyboard for approval before starting this project. Storyboard should be 1 to 2 pages.
Please fill out all the information in this column using a pen before getting this assignment marked.
Production
_____________________________________________ Name
4 Marks
Minimum length requirement met Indicative of amount of time allotted Storyboard turned in Storyboard complete and accurate
_____________________________________________ Date
_________
Computer Science Computer Applications
Block
Animation
4 Marks
Academic Honesty
The work I am submitting is completely my own creation and has not been copied from anyone else's work. If I have received help on this project, the names of those who have assisted are listed below.
Realistically Timed Smooth Animation Animation is not limited to a few objects Simple Methods are used (example: move, turn)
_____________________________________________ Signature
Advanced Camera Motion Object Re sizing Complex Methods are used (example: turntoface, moveto) -
2 Marks
Lincoln High School
Mr. Giansante
3D Programming with Alice
Mark (20)
Interactive World
Assignment Description Create an Interactive Alice World. A good starting point is the flightSimulator and amusementPark worlds that can be found in the example worlds that come with Alice. The "Shark Program" example in these notes can also serve as a simple guideline. Your world should contain a minimum of 20 objects. You must submit a storyboard for approval before starting this project. Storyboard should be 1 to 2 pages.
Please fill out all the information in this column using a pen before getting this assignment marked.
Production
_____________________________________________
5 Marks
Indicative of amount of time allotted Storyboard turned in Storyboard complete and accurate
Name
_____________________________________________ Date
_________
Computer Science Computer Applications
Block
Animation
Academic Honesty The work I am submitting is completely my own creation and has not been copied from anyone else's work. If I have received help on this project, the names of those who have assisted are listed below.
10 Marks
Realistically Timed Smooth Animation Animation is not limited to a few objects A variety of Methods are used Sound and/or Music is used
_____________________________________________ Signature
Interactivity The user can control the motion of an object(s) or the camera. The program responds to key presses The program responds to mouse clicks The user is given feedback
5 Marks
Lincoln High School
Mr. Giansante
Mark (100)
3D Programming with Alice
3 Minute World
Assignment Description Create a 3 minute Alice world that is similar to a movie (ie. limited or no user interaction). Make sure you avoid ...
This is a major assignment. You will have roughly five to six weeks to complete it. Marks will be indicative of effort, time spent and quality of the finished product.
You must submit a storyboard for approval before starting this project. Storyboard should be 3 to 5 pages.
Please fill out all the information in this column using a pen before getting this assignment marked.
References to alcohol and drugs Scenes involving or related to sex Scenes involving or related to violence Scenes that could be hurtful to others
Pre-Production
10 Marks
Storyboard turned in Storyboard complete and accurate
_____________________________________________ Name
Production
_____________________________________________ Date
_________
Computer Science Computer Applications
Block
10 Marks
Minimum length requirement met Indicative of amount of time allotted Original Storyline and Plot
Animation
Academic Honesty
The work I am submitting is completely my own creation and has not been copied from anyone else's work. If I have received help on this project, the names of those who have assisted are listed below.
40 Marks
Realistically Timed Smooth Animation Animation is not limited to a few objects Simple Methods are used (example: move, turn)
Advanced
30 Marks
_____________________________________________ Signature
Camera Motion Object Re sizing Complex Methods are used (example: turntoface, moveto) -
Sound and Music
10 Marks
Background Music Sound Effects (pre recorded) Sound Effects (custom made) Recorded Voice -
-
Lincoln High School
Mr. Giansante
Mark (100)
3D Programming with Alice
Large Interactive World
Assignment Description Create a large interactive Alice world. A good starting point is the flightSimulator and amusementPark worlds that can be found in the example worlds that come with Alice.
Make sure you avoid ...
This is a major assignment. You will have roughly five to six weeks to complete it. Marks will be indicative of effort, time spent and quality of the finished product.
References to alcohol and drugs Scenes involving or related to sex Scenes involving or related to violence Scenes that could be hurtful to others
You must submit a storyboard for approval before starting this project. Storyboard should be 3 to 5 pages.
Please fill out all the information in this column using a pen before getting this assignment marked.
Pre-Production
10 Marks
Storyboard turned in Storyboard complete and accurate
_____________________________________________ Name
Production
_____________________________________________ Date
_________
Computer Science Computer Applications
10 Marks
Indicative of amount of time allotted Original Storyline and Plot
Animation
30 Marks
Block
Academic Honesty
The work I am submitting is completely my own creation and has not been copied from anyone else's work. If I have received help on this project, the names of those who have assisted are listed below.
Realistically Timed Smooth Animation Animation is not limited to a few objects Object Re sizing Simple Methods are used (example: move, turn) Complex Methods are used (example: turntoface, moveto) -
Interactivity _____________________________________________ Signature
40 Marks
The user can control the motion of an object(s) or the camera. The program responds to key presses The program responds to mouse clicks The user is given feedback
Sound and Music
10 Marks
Background Music Sound Effects (pre recorded) Sound Effects (custom made) Recorded Voice -
-