It's free to join Gamasutra!|Have a question? Want to know who runs this site? Here you go.|Targeting the game development market with your product or service? Get info on advertising here.||For altering your contact information or changing email subscription preferences.
Registered members can log in here.Back to the home page.

Search articles, jobs, buyers guide, and more.

By Kian Bee Ng
Gamasutra
October 11, 1999

Letters to the Editor:
Write a letter
View all letters


Features

 

User interface

Contents

Introduction

Requirements & Design

The Individual Model

User Interface

In Maya, you have a pre-defined set of MEL commands to create various types of user interfaces. These MEL commands allow you to write your own functions such as the control system, while still hiding the complexity through the custom user interface. The custom interface will allow your users to use your system without worrying about the underlying details.

Like any interface design, you should be aware of what your users want, and be able to bring the tools to them. Listing 2 shows an example of the user interface created using MEL that corresponds to the parameter control of the system.

Figure 5: An example of the user interface for the above system.

 

Listing 2: User interface creation for the control system.

global proc kbGCS()
{
waitCursor -state on;
string $window = "kbGCSWindow";
string $object = "InterfaceCtrl";

if (!`window –exists $window`)
makekbGCSWin($window, $object);

showWindow $window;

waitCursor -state off;

} // kbGCS //
//
//

global proc makekbGCSWin(string $window, string $object)
{
window
-title "kb Group Control System"
-iconName "kbGCS"
-titleBar true
-minimizeButton true
-maximizeButton false
-sizeable true
$window;

formLayout kbGCSForm;

textFieldGrp
-l "Group Leader Name"
-en 0
-tx "locator1" leaderName_ft;

attrFieldSliderGrp
-l "Number of Members"
-at ($object + ".Number")
-pre 0 numberMember_sf;

checkBoxGrp
-l "Collision Avoidance"
-l1 ""
-en 0
-v1 true Collision_bc;

separator -style "in" sep1;

text -l "Individual:" individual_t;

textFieldGrp
-l "Member Name"
-en 0
-tx "fish" memberName_ft;

attrFieldSliderGrp
-l "Maximum Height"
-at ($object + ".MaxHt")
-pre 2 maximumHeight_sf;

attrFieldSliderGrp
-l "Maximum Speed"
-at ($object + ".MaxSp")
-pre 2 maximumSpeed_sf;

separator -style "in" sep2;

text -l "Group:" group_t;

attrFieldSliderGrp
-l "Group Unity"
-at ($object + ".GrpUnity")
-pre 2 groupUnity_sf;

separator -style "in" sep3;

button
-l "Close"
-c ( "window -e -vis 0 " + $window ) close_b;

formLayout -e
-af leaderName_ft top 10
-af leaderName_ft left 10
-ac numberMember_sf top 10 leaderName_ft
-af numberMember_sf left 10
-ac Collision_bc top 10 numberMember_sf
-af Collision_bc left 10
-ac sep1 top 10 Collision_bc
-af sep1 left 0
-af sep1 right 0
-ac individual_t top 10 sep1
-af individual_t left 10
-ac memberName_ft top 10 individual_t
-af memberName_ft left 10
-ac maximumHeight_sf top 10 memberName_ft
-af maximumHeight_sf left 10
-ac maximumSpeed_sf top 10 maximumHeight_sf
-af maximumSpeed_sf left 10
-ac sep2 top 10 maximumSpeed_sf
-af sep2 left 0
-af sep2 right 0
-ac group_t top 10 sep2
-af group_t left 10
-ac groupUnity_sf top 10 group_t
-af groupUnity_sf left 10
-ac close_b top 10 groupUnity_sf
-af close_b left 15
-af close_b right 15

kbGCSForm;

} // makekbGCSWin //


 

What has been presented here are the fundamentals of developing a system to control a large number of actors. Like any solution to a problem, there is no single best approach. A new scenario will often require you to take a fresh multi-displinary view. However, bear in mind that a good system is usually one that is well designed, able to incorporate the physics requirement, and yet be aesthetically impressive. Hopefully this article will give you some ideas on how best to incorporate your own group behavioral control system for your next animation and game. Good luck!

Kian is currently working as a Technical Director for a production company in Japan. Though extremely busy with his production schedule, he still managed to steal some of his employer's time to finish a book called Digital Effects Animation Using Maya (http://www.4deffects.com). A more detailed and complete implementation of the examplein the article may be found in the book. You can email him with any comments at kian@4deffects.com.


[Back to] Introduction


join | contact us | advertise | write | my profile
news | features | companies | jobs | resumes | education | product guide | projects | store



Copyright © 2003 CMP Media LLC

privacy policy
| terms of service