For example, an agent with C=0.7 has the chance of 70 percent of going to the meeting point ... chances to win the fight. Moreover, the cohesion rate of squads is ...
A Model for Generating and Animating Groups of Virtual Agents Marta Becker Villamil, Soraia Raupp Musse, and Luiz Paulo Luna de Oliveira University of Vale do Rio dos Sinos Masters in Applied Computing, Sao Leopoldo, Brazil {martabv,soraiarm,luna}@exatas.unisinos.br Abstract. This paper presents a model to generate and animate groups which emerge as a function of interaction among virtual agents. The agents are characterized through the following parameters: sociability, communication, comfort, perception and memory. The emergent groups are characterized through the cohesion parameter which describes the homogeneity of ideas of the group members. In this work we are mainly interested in investigating the formation of groups (membership and time for grouping), the groups characterization (cohesion parameter) and their visual representation (group formation). The overall results suggest that the interaction among agents contributes to larger groups and higher crowd cohesion values.
1
Introduction
Behavioral modelling for animation and virtual reality have advanced dramatically over the past decade, revolutionizing the motion picture, game and multimedia industries. The field advanced from purely geometric models to more elaborated physics-biological based models[19]. Motivated by our developed researches concerning crowd simulation[13][5], we are currently interested in providing a model to generate emergent groups as a function of interaction among virtual agents. Moreover, the idea is not only describe an algorithm to model groups but characterize those groups with internal attributes and visual representation. The main application of this work is combat games, where players are able to build squads and it is desired that the these squads could provide different behaviors as a function of their memberships. For instance, by applying our model in such kind of game, the players could chose the initial population, and as consequence, squads cohesion would emerge as a function of the soldiers interactions and their internal attributes. Consequently, these squads can be endowed with different abilities according to the different groups attributes. Furthermore, we are interested in providing a model with the following characteristics: i)agents can be characterized with the following attributes: sociability, communication, comfort, perception and memory, ii) agents can interact with others and their attributes can be updated iii) groups can be created as a function of interaction among agents and iv) groups can be characterized in two points of view: internal (group cohesion) and visual attributes (formation). Concerning the agents aspects, we used an hypothesis where the agent sociability is described as a function of its interaction with others and the quality of these interactions. Moreover in our work, a social agent is able to generate groups with others.
2
Marta Becker Villamil et al.
We justified this decision by adopting concepts of social behavioral learning which is the process of acquiring new patterns of behavior in a social context, remaining as an important aspect of social interaction in animal life[12]. In order to investigate the groups aspects, we used the concept of group cohesion. When every member of a group has a strong feeling of belonging to the group, we can say that the group has a high cohesion. The first theoretical discussions about group characteristics describe that, when a group becomes organized as a limited social system, there are growing attractions inside it[11]. A high cohesion value expresses more difficulty of abandoning the group. Similarity of interests, values and attitudes are important attraction aspects related to the group[9]. In this work, we intend to provide visual representation of the groups formation coherent with the emerged cohesion. The context of this paper is behavioral animation, considered as the visual simulation of mathematical models describing agents behavior that change over the time. In addition, we are interested in applying this methodology in games, which requires real-time processing. Consequently, sophisticated AI methods have been avoided in this work since we want to provide realistic visualization of synthetic human agents. That is the main argument of major part of the pragmatic decisions taken in this paper in order to provide real-time simulations involving big number of synthetic virtual human agents.
2
Related Work
Some researchers have worked to simulate in a realistic way the behavior of groups of agents. Reynolds[16] simulated group behaviors, (more specifically, birds and fishes) where each bird or fish is an autonomous agent that navigates according to its own local perception of the dynamic environment. Still concerning virtual perception, Renault et al [15] described a way to animate virtual agents based on the concept of synthetic vision. Mataric’s model[12] is based on behaviors usually seen in nature. The group of basic behaviors applied by virtual agents or mobile robots was: avoiding, following, forming groups and scattering. There is also the possibility of grouping some of these basic behaviors generating some more complex ones. ViCrowd, the system proposed by Musse and Thalmann[13], manages information from hierarchical crowds generating behaviors of groups and individuals with different levels of autonomy: programmed, guided or autonomous behaviors. Contrasting with the concept that behaviors which use the same resources are mutually exclusive, Lamarche and Donikian[10] have proposed a parallel behavioral model. Which aims to synchronize behaviors (e.g. to smoke, to drink a coffee and to read a newspaper) and allowing an efficient behavior alternation in agreement with importance notion of resources and priorities. Tu and Terzopoulos[20] modelled autonomous animated agents in a marine virtual world with realistic appearance and individual movement and behavior, and patterns of social behaviors evident in animal groups. Their computational model achieved the goals capturing the essential characteristics of biological creatures - biomechanics, locomotion, perception and behavior. Recently, the ACUMEN system proposed by Allbeck, Badler et al [2] analyzes the movements of aggregate entities. The virtual agents can use the extracted motion data to form assessments of trainee cognitive and emotional state. This work presents a rule-based system in order to simulate the formation and the behaviors of groups of virtual humans. Like the model of Tu and Terzopoulos [20], some
Lecture Notes in Computer Science
3
abilities which characterize artificial life (perception, locomotion and group behavior) are implemented in this model.
3
A Model for Grouping Social Agents
Our model describes a method for agents progression until acquiring the ability of grouping. Then, we analyze the groups’ characteristics obtained as a function of the agents parameters. Each interacting agent is endowed with the ability of learning (based on rewards) how to behave socially in order to group with others. Next, we give detailed descriptions about the agents as well as the model for social behavior learning.
3.1
The Agents
One of the hypothesis we have used in this work concerns that agents are modelled with a set of attributes which characterize its personality and internal status. All attributes are normalized to the interval [0,1] as follows: – Interaction Counter (IC) - for each interaction the agent has during the simulation, the IC is increased by 1. – Sociability (S) - this attribute is intended to be the individual motivation of interacting with other agents. It changes at each interaction with others as specified later in Equations 2 and 3. It can be initially distributed randomly or by the user via script. – Communication (C) - it denotes how communicative the agent is. It is considered as a fixed value in the agent personality and can be determined by the user or set randomly. A higher value defines a more communicative agent. – Comfort (Co) - it denotes how comfortable the individual feels and it changes on each interaction depending on the quality of the interactions experienced in the past as described in Equation 4. Initially, the comfort attribute is set to zero. The other attributes characterize the agent mobility and perception. – velocity - each agent receives randomly a motion speed. – perception region - it is the combination of perception distance di and the perception angle θi . They are fixed values attributed randomly at the beginning of simulation. The perception regions are different for each agent to characterize that people have different perception abilities (Fig. 1-left). The agent’s abilities are classified in two groups: basic abilities (inherent to the individual) and acquired abilities (those that the individual can “learn” depending on its level of rewards). The agent’s basic abilities are: – Movement - at the beginning, before acquiring any ability, the agents move randomly according to their attributed velocity. Afterwards, the agents move according to their evolution level. – Perception - each agent is capable of checking if another agent is inside its perception region (Fig. 1-left). – Interaction - it happens when two agents perceive each other (Fig. 1-right). At this moment, the agents attributes and abilities are evaluated and can be updated.
4
Marta Becker Villamil et al.
Fig. 1. The figure in the left side shows the graphic representation of perception angle and distance and in the right side, there are two agents which are perceiving each other.
– Memory - the memory of an agent is represented by an array which contains the agents it interacts with, and the quality of these interactions represented by Iij (presented later on Equation 1). A second variable in the agents memory is represented by the Interactions Counter (IC) which indicates the number of interactions the agent had and it is increased at each interaction. At the beginning of the simulation all agents have IC set to zero. During the simulation, each i-agent can acquire the following new social abilities. – To Follow - the agent is able to follow other agents. – To Access Memory - the agents access their memory to search for the information about the quality of past interactions. – To Select - the agents are able to select which agents they had a good quality of interaction identified by a score of Iij > 0.6 (Equation 1). We assumed that the quality of interaction greater than 0.6 represents a ”good” interaction. – To Group - after having attained the last level of rewards (Table 1), the agents are able to form groups with the ones they had a good quality of interaction (Iij > 0.6).
3.2
The Model for Social Behavior
The simulation begins with a randomly distributed population of agents in a 3D-world space. At the beginning, each agent (i-agent) moves changing its direction randomly at each step of time. An interaction between i-agent and j-agent happens when both are in the perception region of each other (Fig. 1). For each interaction Iij between the i-agent and j -agent, one point is added to ICi and ICj . Moreover, the quality of interaction (Iij ) between i-agent and j-agent is defined as Iij =
Si Ci + Sj Cj . Ci + Cj
(1)
This equation presents a definition we assumed in order to evaluate the interaction between two agents. The goal of having the C (communication parameter) in this equation is justified by the hypothesis that more communicative agents have more influence over the motivation of behaving socially (Si and Sj ). In order to describe the mutual influence that happens when people interact among themselves [4] we defined that the agent motivation of behaving socially can be updated
Lecture Notes in Computer Science
5
during the simulation. The Si and Sj attributes change at each interaction considering the quality of interaction (Iij ) and sociability itself. The agent which has the lower S will have its value increased and the opposite will happen to the other agent, representing the referred mutual influence. Therefore, the new Si and Sj will achieve the same value as shown in the following equations: Si = Si + ((Sj − Si )(1 − Iij ))
(2)
Sj = Sj + ((Si − Sj )(Iij ))
(3)
In addition, the level of agent comfort is also updated as indicated in Equation 4. This parameter represents how comfortable the agents feel at each time of simulation and it influences the speed the agent evolves in the rewards levels.
P Coi = Si
Iij ICi
(4)
All agents follow the same levels of rewards. The condition to attain new reward levels is described by a relation between the agents attributes. It is inspired in Social Sciences where the behavioral social learning happens as a function of individuals attributes and their past experiences [4]. We defined that attributes Si , Coi and ICi represent this condition in our model (Table 1). The values (val1, val2 and val3) used in order to attain new levels, can be customized by the user and it can influence the time spent by agents to evolve in the levels of reward.
Reward Levels 1 2 3
Si + Coi + ICi
abilities related
≤ val1 moving,perceiving,relating and memorizing >val1 and ≤val2 moving,perceiving,relating,memorizing, and following >val2 and ≤val3 moving,perceiving,relating,memorizing, following,access memory and selecting 4 >val3 moving,perceiving,relating,memorizing,following access memory,selecting and grouping Table 1. Levels of rewards for each agent. Text in bold are the abilities acquired at each level.
3.3
The Groups
Groups usually are more cohesive if there is some basic compatibility among their members. The compatibility may relate to a set of factors such as physical, ideological, moral, intellectual and academic [17, 7, 8]. These aspects are not universal, but are important in groups that were not formed on their own, but were created by some external force (e.g. military units). In this work, each group is created by an i-agent called leader which satisfies the condition Si ≥ 0.6. When an agent attained the last level of reward, it is ready to group with others. In addition, if it satisfies the leaders condition, it becomes a leader and start to move in order to aggregate with other agents. Furthermore, the condition to one agent be aggregated by a leader is the quality of interaction they recorded in their memories: Ii ≥ 0.6.
6
Marta Becker Villamil et al.
Since a group is formed, the cohesion rate (K ) can be calculated [4]. Inspired by the social literature, the cohesion expresses the group homogeneity, consequently we defined it inversely proportional to the standard deviation of the group sociability. Related to Group 1 : 1 K1 = 1 P , (5) [(Si − Si )2 ] N1 where N1 represents the number of individuals of group 1. Consequently, the greater is the standard deviation, smaller will be the cohesion. The group cohesion is visually represented by the spatial formation of its members. All agents of the group follow a leader in a shape described by an angle and a distance (Fig. 2-middle). Visually, the leader is the agent who is located at the vertex of the shape. As a function of the group cohesion rate, the groups can be classified as 3 different types: i) groups with high cohesion, the members do not abandon the group and they have a high homogeneity. Generally they walk very close to each other. (e.g. families and close friends) (Fig. 2-left), ii) these groups have a medium cohesion. Their members walk in a less aggregated way and sometimes can abandon the group or can form another one (e.g. team supporters) (Fig. 2-middle) and iii) this group is formed for a short period of time and the cohesion is very low (e.g. group of people walking in the shadow in a hot day) (Fig. 2-right).
Fig. 2. The figure in the left side represents a group with a high cohesion rate (K > 400). In the middle, there is the representation of a group with medium cohesion rate (100 < K < 400). And in the right side, there is a group with low cohesion rate (K < 100).
4
Visualization Architecture
This work is integrated with a visualization framework where the visualization process is completely isolated from the behavioral model. The goal is to work with different kinds of viewers depending on the simulation purpose. A script file containing information about the simulation is provided by the user. The example below exemplifies the script notation used in the result discussed in Section 5. 1 AGENTS 20 (number of agents that participate in the simulation) OUTPUT VIEWER RTKrowd (the selected viewer) 50 COMMUNICABILITY 0.3 (the characterization of agents) 50 COMMUNICABILITY 0.8 In order to visualize the simulation we are able to use two viewers which are briefly explained below. Their main difference between them is in the level of realism provided.
Lecture Notes in Computer Science
7
– Caterva[3] - it is a simple OpenGL-based viewer[23]. The models (for agents and scenario) are read from files in Wavefront’s OBJ format[22]. Caterva is designed to be capable of displaying a large number of agents using very simple 3D models with few polygons (Fig. 2). – RTKrowd[3] - it is based on the RTK Motion toolkit, a commercial product developed by Softimage[18]. Its a more realistic viewer, capable of displaying more complex models, with more polygons and textures. Also, RTKrowd’s actors are capable to perform key framed animations (Fig. 3-left).
5
Result Analysis
The performed simulations aim to describe the influence of a meeting point in the virtual space in order to change the social behavior of agents. In this case we generated a region in the center of virtual room with more probability to be visited, consequently providing more interactions among agents (Fig. 3-left).
Fig. 3. The figure in the left side represents the meeting point in the virtual space and the figure in the right side represents the measuring of the impact of a meeting point in the virtual space: the agents form larger groups in less time of simulation.
We assumed that agents tend to go to the meeting point with a probability proportional to the agent communication. For example, an agent with C=0.7 has the chance of 70 percent of going to the meeting point every 20 iterations. We performed 10 simulations with all agents having high communication levels (C=1) and 10 simulations with all agents having low communication levels (C=0.1). The results (Fig. 3-right) indicate that agents which go to the meeting point, can easily perceive others and consequently interact more times. Moreover, the groups are formed in less time and at the end of simulation more people have grouped. A movie showing the meeting point influence can be seen at http://inf.unisinos.br/cglab/meeting.zip.
6
Further Discussions and Future Works
This paper presented a model to describe emergent group cohesion based on agents parameters such as perception, memory and individualities. The agents are modelled through a rules-based system where rewards phases are pre-defined in order to provide social abilities to the agents. Moreover, individualities can be changed based on agents
8
Marta Becker Villamil et al.
past interactions. When agents are ready to form groups, its possible to measure the groups cohesion as a function of grouped social agents. We are currently investigating the possibility of applying this methodology in combat games. For instance, Command and Conquer Generals [6], Age of Mitology[1] and Rainbow Six[14] which involve army and combats. A squad is a small team, consisting of up to a dozen members, with its own goals. Squads typically have a leader, in some cases, this leader is very visible and has a different role than the squad members [21]. By applying our methodology in a combat game, we can imagine that the players could chose the initial population for their army and squads cohesion would emerge as a function of the soldiers interactions. The emergent behavior can be more than the sum of the squad members behaviors and can be visually represented by the spatial density of the squads. Consequently, squads could have different abilities as well as different chances to win the fight. Moreover, the cohesion rate of squads is dynamic and could change as a function of new members or other existing rules. For instance, depending on the user interaction, the group can become more cohesive, providing changes in the agents attributes.
References 1. “Age of mitology,” http://www.ensemblestudios.com/aom/, 2003. 2. Allbeck, J., Badler, N., Bindiganavale, R.: Describing human and group movements for interactive use by reactive virtual characters. In:Army Science Conference, (2002). 3. Barros L. M., Evers T., Musse, S. R.: A framework to investigate behavioral models. In: Journal of WSCG, 40-47, (2002). 4. Belnesch, H.: Atlas de la Psychologie, Encyclopdies d’Aujourd’hui, (1995). 5. Braun, A., Musse S.R., Oliveira L.P.L., Bodman B. E. J.: Modeling Individual Behaviors in Crowd Simulation. In: Computer Animation and Social Agents, 143-148, (2003). 6. “Command and conquer generals,” http://www.westwood.com, 2003. 7. Fisher, A.: Small Group Decision Making, McGraw-Hill, 2 ed., (1980). 8. Fisher, A.: Cohesion in the US Military, National Defense University Press (1984). 9. Hartley, R. E., Relationship between perceived values and acceptance of a new reference group. Journal of Social Psychology, (1960), 51, 181-190. 10. Lamarche, F., Donikian, S.: The orchestration of behaviours using resources and priority levels. In: EGCAS, XII, 171-182, (2001). 11. Lewin, K., Field Theory and Experiment in Social Psychology: concepts and methods. (1939). 12. Mataric, M. J.: Learning to behave socially. In: From Animals to Animats:International Conference on Simulation of Adaptative Behavior, 453-462, (1994). 13. Musse, S.R., Thalmann, D.: Hierarquical model for real time simulation of virtual human crowds. In: IEEE Transactions on Visualization and Computer Graphics, Vol. 7,152-164, (2001). 14. “Rainbow six,” http://www.raven-shield.com/, 2003. 15. Renault, 0., Magnenat-Thalmann, N., Thalmann D.: A vision-based approach to behavioral animation. In: The journal of Visualization and Computer Animation, Vol. 1, no. 1, 18-21, (1990). 16. Reynolds, C. W., Flocks, herds, and schools: A distributed behavioral model. Computer Graphics, Vol. 21, no. 4, 25-34, (1987). 17. Shaw, M.: Group Dynamics. The Psychology of Small Group Behavior, McGraw Hill (1971). 18. “Softimage,” http://www.softimage.com, July 2001. 19. Terzopoulos, D.: Artificial life for computer graphics, In: Communications of the ACM, (1999), Vol. 42, 33–42. 20. Tu, X., Terzopoulos, D.: Artificial fishes: Physics, locomotion, perception, behavior. In:Computer Animation, 43-50, (1994). 21. van der Sterren, W.: Squads tactics: Planned maneuvers, AI Game Programming Wisdom,Charles River Media (2002), Inc., 247-259. 22. Wavefront Technologies. The Advanced Visualizer–User’s Guide. Appendix B. (1991). 23. Woo M.: OpenGL Programming Guide: the official guide to learning OpenGL, Addison Wesley, 2 ed. (1996).