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