An Effective Implementation of Agent’s Complex Actions by
R
eusing
Primitive Motions
Jun Sung Choi and Jong Hee Park
School of Electronics engineering
Graduate School, Kyungpook National University, Daegu, Korea
Keywords: Complex Action, Agent, Virtual World, Primitive Motion.
Abstract: The efficient implementation of various physical actions of an agent to respond to dynamically changing
situations is essential for the design of a realistic agent in a cyber world. To achieve a maximum diversity in
actions, we develop a mechanism that allows composite actions to be constructed by reusing a set of
primitive motions and enables an agent to instantly react to changes in the ambient states. Specifically we
model an agent’s body in terms of joints, and a primitive or composite motion is performed in a real time.
To implement this mechanism, we produce an animation for each basic joint movement and develop a
scheme to construct overall motions out of the primitive motions. These motions can be assembled into a
plan by which an agent can achieve a goal. In this manner, diverse actions can be implemented without
excessive efforts. This approach has conspicuous advantages when constructing a parallel action, e.g.,
eating while walking, that is, two or more parallel actions can be naturally merged into a parallel action with
an arbitration on their priority. We implemented several composite and parallel actions to demonstrate the
viability of our approach.
1 INTRODUCTION
Apart from the physical realism, the implementation
of various physical actions of an agent to respond to
dynamically changing situations is essential for the
design of a realistic agent in a cyber world (Lee,
2009). However, human actions in a realistic cyber-
world reveal such enormous diversity in its motions
and actions that it is prohibitively time-consuming to
precisely implement all its actions for individual
humans. However, the kinds of motions based on
Interpolation method or Motion capture, etc. in
computer animation are constrained to a small set
(Ryu, 2008; Choi, 2006). Further those existing
research efforts tend to focus on visual realism, so
they are limited in creating diverse actions or
reacting to unexpected situations (Parent, 2004). Our
modelling scheme for implementing agents' actions
in our cyber-world is aimed to maximize their
diversity rather than their realism.
To achieve a maximum diversity in actions, our
approach defines a set of primitive motions and
combines them into composite motions. Some of
those motions may be combined into an action to be
performed by an agent in order to accomplish its
goal. We develop a mechanism that allows complex
actions to be constructed by reusing those primitive
motions and enables an agent to promptly react to
changes in the ambient states. Specifically we model
an agent’s body in terms of the joints, and devise a
scheme to perform primitive or composite motions
in a real time. To implement this mechanism, we
produce an animation for each basic joint movement
and develop a method to construct overall motions
out of the primitive motions. Using a small set of
primitive motions, we can achieve an efficient
implementation of diverse complex actions though
sacrificing some visual realism. In this manner,
diverse actions that an agent performs to achieve a
goal in a situation can be implemented without
excessive efforts. This approach has another
conspicuous advantage when constructing a parallel
action, e.g., eating while walking, that is, two or
more parallel actions can be naturally merged into a
parallel action according to their priority. We
implemented several composite and parallel actions
to demonstrate the viability of our approach.
36
Choi J. and Park J..
An Effective Implementation of Agent’s Complex Actions by Reusing Primitive Motions.
DOI: 10.5220/0005026900360042
In Proceedings of the 4th International Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH-2014),
pages 36-42
ISBN: 978-989-758-038-3
Copyright
c
2014 SCITEPRESS (Science and Technology Publications, Lda.)
2 MODELING OF AGENT’S
MOTIONS
2.1 Representation of Agent’s Body
with Respect to Its Kinetic
Functions
An agent’s major motions can be described in terms
of the movements of its joints connecting its body
parts. Therefore we model an agent’s body structure
centered on its joints. We organize the body parts in
layers according to their interdependencies in order
to systematically express its kinetic composition and
to implement the diversity of its motions at levels.
Each connection point between body parts of an
agent corresponds to its associated joint, and a
primitive motion on a joint has an influence on its
associated upper and lower body parts. If body part
B is connected to body part A, a movement of A
directly affects B, where A is called the upper part of
B. The rotation direction of each joint generally
consists of two planar directions and a torsional
direction. The maximum rotation angle is set to the
largest angle a joint can be rotated. Figure 1 sketches
an agent’s structure as roughly modelled in terms of
associated bones, with showing body parts and joints
related to motions. The number in parentheses
indicates the degrees of freedom for each joint.
Figure 1: Agent's kinetic model.
According to the above kinetic agent model an
agent’s mechanical body structure is organized into
a hierarchical structure based on joints connecting
body parts (Lee, 2009). This structure is of a pure
tree to reflect the fact that no sequence of body parts
forms a cycle. The highest body part, which affects
all the other body parts, functions as the pivot for
any complex motion or posture. We choose the
pelvis as the highest body part since it functions as a
pivot in many composite motions like ‘walk’ and
‘pitch’, and diverse postures like ‘sit’ and ‘stoop.
Notice that the pelvis (and torso) is the only body
part that is not dependent on any other part.
2.2 Formulation of Force Propagation
from Upper Body Part to Lower
Body Parts
Description of a hierarchical body structure in a
model coordinate system is efficient for a situation
where an agent has little interaction with external
objects. In contrast a world coordinate system has
advantages in detecting collisions with external
objects (
Wright, 2005). In a 3D model coordinate
system an agent’s movement is described in terms of
rotation and movement. The Euler Angle for the
expression of a 3D space is a combination of three
angles to specify the location of an object (James,
2006). The propagation of a force from a body part
to its lower parts can be formulated as follows,
α

10 0
0 cosα sinα
0 sinα cosα
β

cosβ 0 sinβ
010
sinβ 0 cosβ
γ
cosγ sinγ 0
sinγ cosγ 0
001


γ
β
α

cosβcosγ sinαsinβcosγcosαsinγ cosαsinβcosγsinαsinγ
cosβsinγ sinαsinβsinγcosαcosγ cosαsinβsinγsinαcosγ
sinα sinαcosβ cosαcosβ

γ
β
α


cosβcos
γ
sinαsinβcos
γ
cosαsin
γ
cosαsinβcos
γ
sinαsin
γ
cosβsin
γ
sinαsinβsin
γ
cosαcos
γ
cosαsinβsin
γ
sinαcos
γ
sinα sinαcosβ cosαcosβ
00 0
(1)
Matrix
represents the sum of a movement
operation on a body part and a rotation operation on
a joint. Multiplication of a rotation matrix on a joint
and a movement matrix on a body part produces a
matrix to describe the overall body movement. Let
and
be position matrices on a body part and
on the highest body part, respectively, the position
of a body part is computed by a successive product
of the position matrices on all of its upper body parts,
that is,





⋯
. While
this model-coordinate-system-based method is
intuitive and effective, it is hard to locate the
collision positions among body parts. Hence, we
converts the actual position of a body part onto a
AnEffectiveImplementationofAgent'sComplexActionsbyReusingPrimitiveMotions
37
world coordinate system for efficient modeling of an
agent’s intraction with the external objects.
3 MODELING OF PRIMITIVE
MOTIONS
The movements of the agent are classified into the
primitive motions, composite motions, and actions.
A primitive motion refers to a movement invloving
only one joint, and a composite motion refers to one
invloving two or more joints. An action refers to a
sequence of motions for a specific goal. Many
primitive motions may be assembled into a new
motion. By performing its motions an agent attempts
to change a given situation toward a goal state. A
process to arrange those motions into a schedule is
an extension of a process to form a composite
motion out of many primitive motions.
The process to move from an initial state to a
goal state is visualized using a method that exploits
afterimage of stagnant objects as in animation. To
effectively create and render diverse motions, our
method expresses the dynamic movement by
changing the angle of a joint with setting a key
frame as the goal state the instant that the agent
initiates a motion (Ryu, 2008; Choi, 2006). The
motion capture method is analogous to an
implementation method based on a world coordinate
system in that it computes the length of a body part
and the angle of a joint using an interpolation with
respect to some selected points of the body. In a
virtual world without hardware supports, it is
impossible to continuously attain the values on the
length of a body part.
The effect of a motion is decided according to a
goal state assigned to the function for moving its
associated joint. These functions are to be executed
independently of each other for real time execution.
The resulting movement of the body part could be
portrayed as a gradual change in the angle of a joint
involved in the motion. This control of a body part is
formulated as,

∶
(2)
where Π denotes a temporal sequence, denotes an
angle of a joint, and denotes a primitive motion.
4 MODELING OF ACTIONS
4.1 Structure of an Action
A set of the primitive motions is predefined for each
joint, and some of them on different joints are
assembled in parallel sequences to form a composite
motion. Those composite motions may be arranged
into an action. An action is performed by iterating a
primitive or composite motion or executing a
sequence of motions. A primitive motion in an
action is defined as a phase, and a set of parallel
primitive motions constitute a composite phase. A
state S changes as a result of executing the motions
in an action.
∆


,
⊃
(3)
Where denotes a state, denotes a motion,
denotes an action, denotes the number of phases
and denotes the number of motions in each phase,
denotes a phasic development and
Σ denotes a set
of parallel motions.
4.2 Synchronization for a Composite
Motion
For realistic construction of a composite motion all
the movements of the body parts involved are to be
synchronized. The angular velocity of each joint
used in the motion is adjusted in proportion to the
distance from the initial state to the goal state. As a
result every motion in an action is executed in the
same time interval. Fig. 2 illustrates a state change in
the body parts involved in a composite motion of
‘walk’. To briefly narrate, Leg L steps on the
ground, then Leg R steps forward along with its
pelvis. According to the hierarchical structure of
body composition, all its body parts simultaneously
move by 3 units. The Length 1 in Leg L’s movement
by the joint’s rotation indicates the distance up to the
point the foot stands perpendicular to the ground in
reference to the pelvis. The Length 2 indicates the
distance Leg R moves from the point it is
perpendicular to the pelvis after Leg R steps on the
ground. If the distance Leg R moves due to the
joint’s rotation does not match the sum of Length 1
and Length 2, the speed the feet step on the ground
would not synchronize with that of the overall body,
resulting in an unnatural action.
SIMULTECH2014-4thInternationalConferenceonSimulationandModelingMethodologies,Technologiesand
Applications
38
Figure 2: Synchronization of motions in walking.
4.3 Planning for Actions
The movement in a motion has directivity with
respect to initial state and goal state. In a ‘walk’
occurrence, for example, the angle of a joint
controlling the arms and legs could be described in
terms of movement of a single rotation pivot from an
initial state to a goal state. A real human’s motion in
practice involves not only a pivot for a major
rotation but other pivots for auxiliary rotations
(Calvert, 1989). Because a primitive motion only
proceeds in one direction, the number of composite
phases in an action is determined according to the
number of changeable directions. In case of a
repetitive action where different motions may end at
different times, the number of composite phases
accordingly increases. If performing a composite
action of ‘walking’ and ‘eating’ in parallel, an arm
used for eating may end its motion at a moment
different from that for walking. Hence, we divide the
goal state of a joint’s motion into composite phases
(Winston, 1992). The minimum time unit in which
an action with composite phases is described is t,
which is defined to be a temporal difference between
mismatching motions.
4.4 Precision of Action
The precision of an action is determined by the
number of composite phases in the action. When the
required degrees of precision differ among different
body parts each body part needs to be divided in the
finest unit for their synchronization. The precision of
an action could be gauged by,

(4)
denotes the maximum directivity of a composite
phase,
denotes the directivity of body parts
involved in an action during its performance time, .
4.5 Combination of Actions into a
Parallel or Concurrent Action
A parallel action refers to a composite action which
performs two or more individual actions at the same
time. We implement a parallel action by combining
actions instead of assembling primitive motions.
Those actions are implemented in terms of
composite motions. When combining two individual
actions we need to evaluate the priority between
them for each body part, which is to be used
exclusively by either one of the actions. Such a
priority could be compared between the actions to be
combined using Table 1.
Table 1: Relative priority between actions on body part.
Action 2
A
ction 1
Null
Optional
Essential
Null Not
applicable
Action 2 Action 2
Optional Action 1 Toss-up Action 2
Essential Action 1 Action 1 Impossible
As for a parallel action of ‘eating while walking’,
an essential motion for ‘walking’ is a motion on
each leg with a motion on each arm optional in an
auxiliary role. Those stagnant parts like the torso and
the head are judged irrelevant to walking. Likewise
the essential motions for ‘eating’ include those on
the mouth and an arm and all the other motions are
irrelevant. Because their essential motions do not
overlap each other those two actions could be
combined into a parallel action.
If two actions are not compatible for a parallel
action, they can still be concurrently performed. A
concurrent action refers to performing two or more
independent actions alternately at a high frequency.
Those independent actions cannot be executed
simultaneously but they take turns to be completed
at the same time or to effectively proceed in parallel.
The difference of a concurrent action from a
composite motion is that it considers only two
motions on a body part where a concurrent action is
not possible to be performed.
To construct a parallel action its associated
motions need to be described in the same unit of
AnEffectiveImplementationofAgent'sComplexActionsbyReusingPrimitiveMotions
39
body parts. That is, each unit is associated with a
function. A composite motion can be modelled in
terms of the arms, legs, torso and head, or of a
dichotomy between the upper and lower bodies.
,

,

,

⋯

(5)
where
denotes a functional body part on level n
in a hierarchical structure as arms, legs.
The body parts have connection links to transfer
mechanical force. A composite motion needs to
include the body parts connected via those links.
With
the highest body part, the body parts as the
functional units of a composite motion are connected
from
to

.
5 INTERACTION BETWEEN
OBJECTS VIA ACTIONS
An interaction between objects is preceded by a
spatial collocation or collision (Kim, 2012). We
model states just as realistic as they can be
recognized so we can avoid using a physics engine
to detect collisions like in a computation heavy
game. We classify the objects in our cyber world
into the active objects and the passive objects. An
active object like a human not only behaves
autonomously but induces reactions from other
objects. That is, it sends a message to other objects
to perform an action.
To handle the actions of all the objects in the
cyber world a multi-tasking control mechanism is
needed. Even though all the motions on a scene look
independent they technically belong to a single task
requiring no context switching. A state of our cyber
world resulting from the effect of many agents’
actions could be formulated by extending (3) as,





(6)
denotes the agents, and the other notations are
referred to (3).
6 IMPLEMENTATION OF
EXAMPLE MOTIONS AND
ACTIONS
We implemented our method based on the reuse of
motions and superimposition of composite motions
to realize parallel actions. We demonstrate the
viability of our method through several actions such
as ‘walk’, ‘open’ and ‘eating while walking’. ‘walk’
is a basic action implemented as an iterative
composite motion. ‘open’ is an action involving an
interaction between an agent and a door. ‘eating
while walking’ is a parallel action between ‘eat’ and
‘walk’. Our implementation tools included Visual
studio 2008 and OpenGL, along with the Microsoft
Access 2007 as the database environment.
An agent performs a movement by executing
‘walk’ motion iteratively toward the goal location.
Even though the distances from the initial state to
the goal state differ between the arms and the legs, a
walking action naturally proceeds by their
synchronization.
1 2
3 4
5 6
Figure 3: A Sequence of motions for walking.
An active object interacts with other objects by
sending a message to them. The following sequence
of scenes show an agent opens a passive object of a
door by exchanging messages.
SIMULTECH2014-4thInternationalConferenceonSimulationandModelingMethodologies,Technologiesand
Applications
40
1 2
3 4
Figure 4: A Sequence of motions for opening a door.
In a real situation, it is an important capability to
react to an abrupt change in state. Such capability of
our method is used to efficiently implement parallel
and concurrent actions.
1 2
3 4
5 6
Figure 5: A Sequence of motions for eating while walking.
We show an agent is walking eating something.
We superimposed an eating motion on top of a
walking motion instead of assembling the primitive
motions. That superimposion is determined by the
priority table.
A concurrent action can be implemented using
the same method that is used for a parallel action.
The resulting scene is visually equivalent to an
iterative composite motion.
6 CONCLUSION
We have developed an efficient scheme for
implementing a diversity of actions to be performed
by agents in a virtual world. We first defined a set of
primitive motions and combined them into
composite motions. Those primitive motions are
reused to construct concurrent and parallel actions,
and their associated design method enables an agent
to instantly react to changes in its ambient states.
Specifically an agent’s body was modelled in terms
of joints, and a primitive or composite motion can be
performed in a real time. We produced an animation
for basic joint movements and developed a method
to construct overall motions out of the primitive
motions. These motions can be assembled into a
plan by which an agent can achieve a goal. In this
manner, diverse actions can be implemented without
excessive efforts. This approach has a conspicuous
advantage when constructing parallel actions, e.g.,
eating while walking. Two or more actions as they
are can be merged into a parallel action according to
their priority. We traded some visual realism off to
accomplish an efficient implementation of complex
actions. To demonstrate the viability of our scheme
we implement several actions of different types of
complex actions. A composite action of ‘walk’ was
shown to be implemented by iterating a composite
motion and an interactive composite action of
‘opening a door’ was shown to allow an agent to
interact with an external object of a door by sending
a message. A parallel action of ‘eating while
walking’ was implemented to show how two
composite actions of eating and walking can be
superimposed as they are to construct a parallel
action.
ACKNOWLEDGEMENTS
This research was supported by the BK21 Plus
project funded by the Ministry of Education, Korea
(21A20131600011).
This research was supported by Kyungpook
National University Research Fund, 2012
AnEffectiveImplementationofAgent'sComplexActionsbyReusingPrimitiveMotions
41
REFERENCES
Lee, J., 2009. "Modelling Human Actions based on
Primitive Action and Class Inherit", The Graduate
School Kyungpook National University.
Ryu, S., et al. 2008. “3D game character animation pipe-
line to improve utilization of motion capture”, Journal
of Korea Contents Association, Vol.8, No.7.
Choi, T., et al. 2006. “Abstract of digital motion capture
system and 3D game character animation application”,
Kongju National University.
Parent, R., 2004. Computer Animation - Algorithms and
Techniques, Ajin publishing company.
Wright, R., Lipchak, T. and Choi, H., 2005. OpenGL
super bible, Information Publishing Group, p.190 –
p.219.
James, D., 2006. “Representing Attitude: Euler Angles,
Unit Quaternions, and Rotation Vectors”, Stanford
University.
Calvert, W., 1989. “Goal-Directed, Dynamic Animation of
Human Walking”, Computer Graphics, Vol. 23, No. 3.
Winston, P., 1992. ARTIFICIAL INTELLIGENCE Third
Edition, Addison-Wesley Publishing Company, p.323
– p.346.
Kim, T., 2012. “Representation of physical Phenomena
and Spatial Relations in the virtual reality”, Journal of
Korea Contents Association, Vol.12, No.6.
SIMULTECH2014-4thInternationalConferenceonSimulationandModelingMethodologies,Technologiesand
Applications
42