English (United Kingdom) Hebrew

Mama Documentation

Contents

Introduction

Mama is an educational programming language built on top of Carnegie Mellon's great Alice development environment. Mama is designed to help young students start programming by building 3D animations and games.

Building of animations in Mama has two main parts: scene editing and program editing. Accordingly, the development environment contains two basic editing modes: scene editing mode and program editing mode. In scene editing mode (received by clicking on the '+' sign at the bottom of the 3D window) the 3D window is enlarged, the object gallery is displayed in the bottom window for selecting objects, and the right window contains controls used for editing. In program editing mode (default mode) the bottom window is the program editing area and the right window is the event editing area.

The collection of all objects and the events in the current session is called world. You can play a world, change it and save it into a file. At any given moment, there's a single world open in the development environment, which is the current world. You can open sample worlds by selecting 'Open' from the 'File' menu, and then select a file from the sample worlds.

There are several parts in Mama window: at the top you'll find the main menu and the toolbar, which let you execute commands such as create/open worlds, import 3D objects into the world, create a standalone application, export the animation to YouTube, etc.

Mama UI parts

The other 5 parts of the user interface are: When in scene editing mode, two of the above parts are replaced:
  • control panel - replaces the events area, and displays various controls that help manipulating objects in the 3D window.
  • object gallery - replaces the editor area, and displays objects in hierarchic folders to be selected and embedded in the 3D window.
Right click on any object opens a context menu, which lets you execute standard actions:
  • method - selecting a method to run on an object (design time call)
  • rename - rename the object
  • camera get a good look at this - will set the camera in a position and orientation optimal for watching the given object
  • capture pose - capture the current post of the object, making that pose available later as a target to the setPose method
  • delete - delete the object
  • save object to my library - will save the object under the user library (located under user home directory)
If the object was created using a plugged in modeling application, and additional option is displayed:
  • edit - edit the object in the modeling application (in which it was created)


Right click a code entity - an instruction, a method or a function - opens a context menu, which lets you execute standard actions:
  • duplicate - make copy of the code entity right following it
  • delete - delete the code entity
  • cut - delete the code entity and add it to the clipboard
  • copy - copy the code entity into the clipboard
  • paste - paste an code entity from the clipboard into the current position
  • pop-paste - like paste, but removes the code entity from the clipboard (thus enabling sequence of paste actions on code entities copied sequentially to the clipboard)




Installation

Before start of installation, please verify that the destination computer has the following minimal requirements:
  • Operating system: Windows XP / Vista / 7 / 2000 / ME
  • Memory (minimum): 512MB
After download run the setup program and follow the displayed instructions.



Getting Started

The Mama system comprises many topics: rich user interface, 3D animation, an object oriented programming language, an object gallery, and more. To overcome this complexity, you are suggested to study Mama systematically. First, try using Mama as a user , without doing any programming: open example worlds, run them and see what happens. Notice the various windows on the screen, select objects and review their details, try recording a movie and uploading it to your Youtube account, etc.

Next, the interactive tutorials provide a quick and simple way to study Mama programming. To open a tutorial, select 'File'=>'Open', and from the displayed dialog select the tutorials tab, where several tutorials are available. The tutorials are numbered, and it is suggested to follow the numeric order:
  • Tutorial 1: Monkey tale - introduce Mama and instructs basic work with objects, editing methods, playing the world, uploading to YouTube and Facebook
  • Tutorial 2: Naptime - further explains method editing and creation of new methods
  • Tutorial 3: Penguin Chorus - focused on events: creating and editing events, defining event actions
  • Tutorial 4: Space - focused on scene editing, embedding objects from the gallery in the 3D window
Each tutorial guides the student interactively, step by step, in building programs and worlds.

Tutorials and other resources:
  • This document describes the basic principles of animation within Mama 3D environment
  • Animations basics - to understand animation, read and follow the animation tutorial. This guide provides a very good gradual explanation on how to create animation programs.
  • Advanced animation - for advanced users, the monkey tale guide provides a thorough explanation of a Mama application and its subdivision into modules, a better understanding of the Mama programming language, advanced animation, and an introduction to working with the camera.
  • Sample programs - rich sample programs in the samples directory provide valuable information (actually, some of the tutorials are based on samples from the samples directory). the sample programs provide a good way to explore Mama environment and to see what's are its capabilities. To open a sample program select 'File'=>'Open' and then select a sample world from the sample programs tab.
  • Reference Manual - reference manual for for immediate help on specific topics.
  • Mama forums - another valuable source of information, where you can post questions or answers, as well as exchange ideas and programs.
  • [www.alice.orgs/communitiy Alice forums - contain huge amount of information about Alice, on which Mama is based, so you can use it as another rich documentation source.
  • Baldwin's site - yet, another extremely useful source for Alice documentation can be found at Prof. Richard G. Baldwin's site. Prof. Baldwin's site contains documentation and tutorials in almost all aspects of Alice, and the content is very thorough and accurate. Much of the information in this site is relevant for Mama as well.


Keyboard shortcuts

Shortcut Action
F1 Help
Ctrl-O Open World
Ctrl-N New World
Ctrl-S Save World
F5 Play
Ctrl-Z Undo
Ctrl-Y Redo
Ctrl-C Copy
Ctrl-X Cut
Ctrl-V Paste
Ctrl-G Take Picture
Ctrl + Mouse left button Turn Objects Left and Right
Shift + Mouse left button Move Objects Up and Down
Ctrl + Shift + Mouse left button Turn/Move Objects Left/Right/Up/Down




Mama Configuration

The configuration of Mama is determined by two configuration files:
  • config.txt - administrator configuration file - under Mama installation root folder (normally c:/Program Files/Mama) - sets the main paths of Mama, and dominates the user configuration (config.xml). Settings in this file will override user settings.
  • config.xml - user configuration file - under C:/Documents and Settings/<user-name>/.mamaen - sets various variables of Mama
Within the administrator confix.txt file you will normally set administrator/instructor convenient variables, such as:
variable description defalut value
config.dir the user configuration file's directory c:/Documents and Settings/<user-name>/.mamaen
user.diruser home dirC:/Documents and Settings/<user-name>/Desktop/Mama_works
enableScriptingenable Mama scripting within method code linestrue
enableFreeScriptingenable Mama world scripting in a separate window (to enable this you'd have to enable 'enableScripting' toofalse
scriptingLanguagethe scripting language in use, current available languages are mama and pythonmama
encryptStandaloneencrypt standalone programs so that they cannot be editedtrue
Within config.xml you can set many variables. The following table contains useful configuration variables:
variable description defalut value
movieCapture.frameRate frame rate of video capturing - higher values (24, 32, 64) give a better quality but create bigger files 16 FPS
maxUndoCount undo stack size - bigger values might cause higher memory usage 25
enableRunntimeAsserts enables assertions at runtime using the keyword assert - you should set this flag to true while developing, and disable in production version true (false in standalone mode)
importDirectory default directory for the import file chooser C:/Documents and Settings/<user-name>/Desktop/Mama_works
worldsDirectory default directory for the user worlds C:/Documents and Settings/<user-name>/Desktop/Mama_works


Mama scripting

You can write scripts within your program using Mama programming language. For more about scripts see here.

Mama reference manual



For instructors

Mama was built to serve educational needs in computer science, and as such, it suits young and adult students studying their first programming language, as well as providing helpful tools for instructors.

General programming style

Two styles are available in the development environment:
  • Mama style - the programming style is similar to modern programming languages: identifier names do not contain spaces, and parentheses are used for bounding the arguments in a method/function definitions/call.
  • Alice style - simple style: spaces are allowed in identifier names, no parentheses in method/function definitions/calls. This style is suggested for very young students, or as a preceding stage before moving to Mama style.


For example, given an object named 'Miki', which includes a method named 'walk', this is how we call it:
  • Mama style:
 
Miki.walk(10, left)
 
  • Alice style:
 
Miki.walk 10, left
 
You can set the programming style from the menu 'Edit'/'Preferences' (You will need to restart Mama to apply the change). Selecting the programming style is an important decision that needs to be made by the instructor, considering the age of the students and their programming knowledge.

(For instructors who work with Alice style, you can get from here the reference manual the the sample programs in Alice style.

Building tutorials

As an instructor, you can create interactive tutorials for your students. This is a convenient and efficient way to teach, and is normally preferred over building programs using manual instructions. Within a tutorial you can determine within each step what the student is required to do, so that moving to the next step depends in completing successfully the current one. During run of the tutorial a dark glass screen is displayed which disables access to user interface parts in general, and enables access only to the components defined to be accessed in the current step of the tutorial.


Click here for help in building tutorials.