Crowd Simulation with Feedback Based on
Locomotion State
Masaki Oshita

Jumpei Harazono

Kunio Yamamoto

Kyushu Institute of Technology
680-4 Kawazu, Iizuka,Fukuoka, Japanoshita@ai.kyutech.ac.jp

Kyushu Institute of Technology
680-4 Kawazu, Iizuka,Fukuoka, Japanharazono.jumpei403@mail.kyutech.jp

Kyushu Institute of Technology
680-4 Kawazu, Iizuka,Fukuoka, Japankunio@ai.kyutech.ac.jp

Abstract—Most crowd simulation methods treat each agent asa point and simulate the movements of these points. Although
animations of virtual characters can be generated based on
the trajectories of points, the generated motions often become
unnatural. For example, an agent may change its walking
direction suddenly in the middle of a step, even though it isimpossible for humans to do so. We propose a crowd simulation
method that considers the locomotion state of an agent. Whenan agent is in the middle of the step, a feedback force is applied
to the agent to prevent the agent from suddenly changing thewalking direction. However, when an agent is standing or at thebeginning of the step, the agent is allowed to change its walking
direction freely. We present experimental results and evaluate
the effectiveness of the proposed method.
Index Terms—crowd simulation, crowd animation, locomotion

I. I NTRODUCTION
Crowd simulation has been used to create computer animations of virtual characters. However, most crowd simulation methods treat each agent as a point and simulate themovements of these points. Although animations of virtual
characters can be generated based on the trajectories of points,
the generated motions often become unnatural. For example,
an agent may change its walking direction suddenly in themiddle of a step, even though it is impossible for humans to do
so. Consequently, unnatural walking motion can be generated.
Although such artifacts can be reduced by post-processing,such as inverse kinematics, the gap between the simulated
point and the generated motion becomes an issue. Such gaps
may cause collisions between the generated walking motionsof agents. Bipeds, including humans, change their walking
direction by swinging their legs toward the desired direction.
The direction of motion of the swinging leg is determined at
the beginning of the step and cannot be changed during thisstep. The agent should be moved according to this type oflocomotion state.
In this study, we propose a crowd simulation method thatconsiders the locomotion state of an agent. Our key idea isto adjust the velocity of the agent so that it is maintained
during the step while it is allowed to be changed at thebeginning of the step. Although our approach can be applied
to any type of crowd simulation method, in this study, weapply it to the social force model [1], [2] which is a common

crowd simulation method. The social force model also treats
each agent as a point and simulates the movements of thepoints by considering several forces that work on the agent.
We introduce a feedback force based on the locomotion stateof the agent. When an agent is in the middle of the step, afeedback force is applied to the agent to prevent the agent fromsuddenly changing the walking direction. However, when anagent is standing or at the beginning of the step, the agent
is allowed to change its walking direction freely. We also
introduce a motion generation method based on a feed-forward
model. Instead of simply applying a walking motion to thepositions of agents computed by crowd simulation, a walking
motion is generated in such a way that the position of thewalking motion follows the position in crowd simulation. We
present experimental results and evaluate the effectiveness ofthe proposed method.
The remainder of this paper is organized as follows. Section
II reviews related work. Section III provides an overview ofour proposed method. Sections IV and V describe the baseline
methods for crowd simulation and locomotion generation,respectively. Section VI describes the feedback-force model.
Section VII presents the experimental results and a discussion.
Finally, Section VIII concludes the paper.
II. R ELATED W ORK
Crowd simulation is an important research topic in the ﬁeldof computer animation. Many crowd simulation methods havebeen proposed [1]–[7]. Most previous methods treat each agent
as a point and simulate the movements of the points. Althoughmany studies have demonstrated the resulting animations ofvirtual characters, they simply applied walking motions to thesimulated trajectories of agents, and the generated animations
were not natural. Some research works have employed moresophisticated motion-generation methods. Sakuma et. al. [8]used a state machine that contained four states and a dozen
motions. Hughes et. al. [6] applied side-stepping motions
when they were appropriate, based on the trajectory of theagent. Although these approaches improve the naturalness ofmotions, the information of motion generation is not used incrowd simulation, and the gap between crowd simulation andmotion generation can become an issue.

crowd simulation

positionand velocity

feedback force
and weightmotion generation

position in crowd simulation
feedback force

motion data

terminal point of step

positionand velocity
motion state, time, and pose

Fig. 1. The system structure and data ﬂow.

There are many methods for generating walking motionsof virtual characters [9]–[11]. They can be combined with acrowd simulation method to generate animations of the virtualcharacters. However, as explained in Section I, because thecrowd simulation method does not consider the locomotion
state, the unnatural movements of agents can be generated.
In this research, we introduce feedback from motion generation to crowd simulation to solve the problem of combining
crowd simulation and motion generation.
III. S YSTEM OVERVIEW

control force

position in motion generation

Fig. 2. Visualization of positions and forces in our system. The blue sphere
represent the position in crowd simulation ps . The red sphere represent theposition in motion generation pm . The green sphere represent the terminal
position of the current walking cycle pt . The control force (blue arrow) f
is computed as a sum of driving and collision avoidance forces in crowd
simulation. The feedback force (red arrow) ff b is computed based on theterminal position of current walking cycle so that the moving direction ismaintained during the middle of walking cycle.

A driving force fd that moves the agent towards the goal
position pg is applied to the agent. First, the desired velocity
vd for moving towards the goal position pg at the maximum
speed parameter smax is computed as follows:pg − ps
vd = smax.
(1)|pg − ps |Our system consists of crowd simulation and motion generation, as shown in Figure 1. Because our system generates
animations of agents on the ﬂy, it can be used for interactive
applications, such as computer games and virtual reality.
Crowd simulation and motion generation have their own
states for each agent, as shown in Figures 1 and 2. In crowd
simulation, the position ps and velocity vs are updated basedon a social force model (see Section IV). In motion generation,
position pm and velocity vm are updated to follow position
ps and velocity vs of the crowd simulation (see Section V).
An important feature of our system is the feedback frommotion generation to the crowd simulation (see Section VI).
The feedback force ff b and its weight wf b are computed basedon the locomotion state and terminal position of the current
walking cycle pt .
Motion generation uses a set of pre-created motion data,
including the body model. Although different motion data
and body models can be used for individual agents, in ourexperiments, we applied the same body model and motion
data (walking and standing motions) to all the agents.

The driving force (acceleration) is then computed to obtain
the desired velocity at a certain time Td according to
vd − vsfd = kd.
(2)
Td
In our implementation, Td = 1 s. For the scale parameter kd ,kd = 1 is used.
The collision avoidance force fc which is the sum of therepelling forces against nearby agents, is computed as:()∑2|pi − ps | pi − ps
fc =−kc R, R(x) = e−2x , (3)dc|pi − ps |IV. C ROWD S IMULATION

The velocity vs and position ps of the agent are updated
according to the control force f and time step ∆t of thesimulation.

For crowd simulation, we applied a simple force-basedmodel that extends the social force model [1]. The position
ps and velocity vs of each agent were updated based on thesum of the driving and collision avoidance forces. Each agent
has goal position pg and maximum speed parameter smax .
The velocities of the agents were controlled within the speedlimit.

i<G

where dc and kc are distance and scale parameters, respectively. R(x) denotes a radial basis function. G is the group ofnearby agents within distances dc and pi denotes the positionsof nearby agents. We used dc = 2.0 and kc = 2.0. The force
to avoid collisions with obstacles and walls fo is computed ina similar manner.
Finally, the control force f applied to the agent is computedasf = fd + fc + fo .
(4)v′s = vs + ∆tf, p′s = ps + ∆tv′s .

(5)With our feedback force model, in addition to the control
force f, the feedback force ff b is used. The details arepresented in Section VI.

V. L OCOMOTION G ENERATIONIn this section, we introduce a locomotion generation
method that uses a cycle of straightforward walking andstanding motions. This method uses two states, walking andstanding. During walking, the current pose of the walking
motion is applied to the position pm and orientation om of
the agent. The orientation of agent om is computed based on
the changes in position pm . The current pose is obtained fromthe walking motion based on the current generic motion time t(0 < t < 1), which is incremented cyclically based on velocity
vm . When each foot is in contact with the ground, inverse
kinematics is applied to the leg pose to maintain the foot in
the contact position. During standing, the current pose of theagent was obtained from standing motion data.
We introduce a feed-forward model in which the positionpm and velocity vm in motion generation follow the position
ps and velocity vs in crowd simulation. A virtual force forlocomotion fm is computed such that position pm and velocity
vm satisfy position ps and velocity vs in a certain time window
Tm . The acceleration av that satisﬁes the velocity vs at Tm is
computed by:vs − vm.
(6)av =Tmt
0.0

0.25

0.5

0.75

1.0

wfb
wmax

0Fig. 3. Walking cycle and feedback force weight function. In the middle ofstep at around t=0.25 and 0.75, a stronger force is applied. At the beginningand end of step around t=0.5 and 1.0, a weaker force is applied.

The locomotion force (acceleration) fm is determined by av
and ap as follows:

using equations (6)–(8). Instead of the position pm , velocity
vm and time Tm , the position pt , velocity vt , and time Tt of
the terminal point of the current walking cycle are used. If thefeedback force ff b becomes excessively large at the end of thewalking cycle, it is limited to the maximum speed smax .
The strength of the feedback force was adjusted based on
the locomotion state, as shown in Figure 3. In the middle ofthe step, a stronger force was applied to prevent changes inthe direction of movement. At the beginning and end of thestep, a weaker force was applied so that the agent could freelychange its moving direction. The weight of the feedback force
wf b is computed using a sinus function as follows:

fm = wp ap + (1 − wp )av ,wf b = 0.5 × wmax (1 − cos(2πt)),

The acceleration ap that satisﬁes position ps at Tm is computedby2
ap =(p − pm − Tm vm ).
(7)
Tm s

(8)

where blending weight wp is used to adjust the balance
between the two constraints. In our experiments, Tm = 0.5
and wp = 0.5 are used. The position pm and velocity vm are
updated based on the force fm using Equation (5).
The state of the agent is changed between walking andstanding, as follows: During walking, when the velocity islower than the threshold at the end of a walking cycle, thestate is changed to standing. While standing, when the position
is moved over the threshold, the state is changed to walking.
During the transition between walking and standing, the posesof the two motions are interpolated.
Although our method can generate walking motion along acurved trajectory, the generated motion may become unnaturalwhen the agent makes sharp turns or small steps, even at
the beginning of the step. Such motions can be generated byintroducing other states and motion data. Because our primaryobjective was to introduce the feedback force, such extensionsof locomotion generation were not tested.
VI. F EEDBACK F ORCE BASED ON L OCOMOTION S TATEThis section describes the feedback force from motion
generation to the crowd simulation.
The feedback force ff b maintains the velocity of the agents.
It is computed in a manner similar to the locomotion force fm(9)where t is the current generic motion time (0 < t < 1) andwmax is the maximum weight parameter. In our experiments,
wmax = 0.5 is used.
Based on the feedback force ff b and its weight wf b , thecombined force f′ is computed as:f′ = (1 − wf b )f + wf b ff b .

(10)′The combined force f is used with equation (5) to update
the position ps and velocity vs of the agent in the crowd
simulation.
By introducing this method, the average driving and collision avoidance forces decreased. To compensate for this, theparameters for these forces, kd , kc , ko are multiplied by two.
VII. E XPERIMENTAL R ESULTS
In this section, we present experimental results. As it
is difﬁcult to quantitatively evaluate the naturalness of thegenerated motions, we present the results of crowd animation
with and without our method on several scenes and comparethem to identify the effectiveness of our method. The resulting
animations were included in the accompanying video.
First, we present the results for a scene with a small numberof agents in Figure 4. One agent moves from left to rightthrough two other agents that move in the opposite direction.

(a) generated animation without feedback force(b) generated animation with feedback force

Fig. 4. Results of simulation obtained without (top) and with (bottom) our method. The series of images show the progress of two simulations (left to right).
One agent that travels from left to right passes between two agents that travel from right to left.

After the agent avoids the ﬁrst opponent, the direction ofmovement must be changed to avoid the second opponent.
Without the feedback force, when the agent changes direction,
the generated motion becomes unnatural. With the feedback
force, although the agent still changed its moving direction,
the naturalness of the generated motion was improved.
Second, we presented the results for a scene with a relatively
large number (approximately 30) of agents in the accompanying video. Agents randomly appeared on the left or right endof the scene and moved toward the other end of the scene. In
the resulting animations, motions similar to those in the ﬁrst
scene are observed.
Using feedback force, responsiveness may be reduced in
exchange for the naturalness of motion. This can be solved byintroducing a method for predicting the movements of nearby
agents and responding to them early.
Regarding computation speed, because our method is simple, the additional computational costs for computing andapplying the feedback force are small. It is possible to animate
a large number of agents in real-time.
VIII. C ONCLUSION
In this study, we proposed a crowd simulation method thatconsiders the locomotion state of an agent. Our key idea is toadjust the velocity of the agent so that it is maintained during
the step while it is allowed to be changed at the beginningof the step. Although we applied our approach to the social
force model in this study, it can also be applied to other crowd
simulation methods.
Our future work will extend our method to consider moredetails of the locomotion state. Our current method uses only
the walking motion time and does not use the pose of theagent for crowd simulation. By considering this, more precise
control is possible. The application of our approach to othercrowd simulation and motion generation methods will be
investigated in future work. In particular, a combination ofdata-driven motion generation methods, such as [10], [11],can generate more natural motions.
ACKNOWLEDGEMENTS
This work was supported in part by a Grant-in-Aid for
Scientiﬁc Research (No. 21K12192) from the Japan Society
for the Promotion of Science (JSPS).
R EFERENCES[1] D. Helbing and P. Molnár, “Social force model for pedestrian dynamics,”
Physical Review E, vol. 51, no. 5, pp. 4282–4286, 1995.
[2] Y. Sun and H. Liu, “Crowd evacuation simulation method combining thedensity ﬁeld and social force model,” Physica A: Statistical Mechanics
and its Applications, vol. 566, p. 125652, 2021.
[3] A. Treuille, S. Cooper, and Z. Popović, “Continuum crowds,” ACM
Transactions on Graphics (ACM SIGGRAPH 2006), vol. 25, no. 3, pp.
1160–1168, 2006.
[4] R. Narain, A. Golas, S. Curtis, and M. C. Lin, “Aggregate dynamics
for dense crowd simulation,” ACM Transactions on Graphics (ACM
SIGGRAPH Asia 2009), vol. 28, no. 5, pp. 122:1–8, 2009.
[5] J. van den Berg, S. J. Guy, M. C. Lin, and D. Manocha, “Reciprocal nbody collision avoidance,” in Robotics Research: The 14th International
Symposium ISRR, 2011, pp. 3–19.
[6] R. Hughes, J. Ondrej, and J. Dingliana, “Holonomic collision avoidancefor virtual crowds,” in ACM SIGGRAPH/Eurographics Symposium on
Computer Animation (SCA) 2014, 2014, pp. 203–111.
[7] J. Lee, J. Won, and J. Lee, “Crowd simulation by deep reinforcement
learning,” in Motion, Interaction and Games (MIG) 2018, 2018, pp.
2:1–7.
[8] S. K. Takeshi Sakuma, Tomohiko Mukai, “Psychological model for animating crowded pedestrians,” Computer Animation and Virtual Worlds,
vol. 16, no. 3-4, pp. 343–351, 2005.
[9] N. Lockwood and K. Singh, “Biomechanically-inspired motion pathediting,” in Proc. of ACM SIGGRAPH/Eurographics Symposium on
Computer Animation 2011, 2011, pp. 281–287.
[10] K. Kovar, M. Gleicher, and F. Pighin, “Motion graphs,” ACM Transactions on Graphics, vol. 21, no. 3, pp. 473–482, 2002.
[11] D. Holden, T. Komura, and J. Saito, “Phase-functioned neural networks
for character control,” ACM Transactions on Graphics, vol. 36, no. 4,
pp. Article No. 42, 1–13, 2017.