# Realistic Multi-Agent Formation Using Discretionary Group Behavior (DGB)
## 1 Introduction  
Group formation in crowd simulation has gotten huge attention in recent years due to its wide range of usage in virtual environments such as video games and movies. This work can be beneficial for bringing about more reasonable movements of groups in the simulation of video games. Also, this topic can be useful in training systems such as the study of human behaviors in emergency evacuation situations or common urban environments. Groups in a crowd have a significant effect on presenting a realistic simulated crowd. Thus, a realistic motion of groups in each of these situations can help to improve the quality of the training systems. This topic can easily be defined by a crowd of robots navigating in the environment while trying to maintain their specific formation as a group. The concept of group behaviors has been well studied recently. However, they do not take into account that, usually real people in a group can individually decide how to avoid other people and obstacles while trying to keep the group's formation. In other words, it is better to not have any pre-connection between agents to make them stay in their formation [1]. Furthermore, sometimes an agent may get out of the band or falls behind the group for some reason while it can later return to its predefined and desired spot in the group. Put it differently, people are not always following a subgroup during their motion in the entire group [1]. In this paper, we present a new method (Discretionary Group Behavior--DGB) for having more realistic group formation and behavior in front of other agents and complicated obstacles in which the behavior of agents in groups is discretionary, meaning that members do not have mandatory connections to each other. This method can be useful in human-like multi-robot navigation or group formation of crowds in video games such as the collision-free motion of armies passing through each other, keeping their uniform cohesion. In this paper, we address a velocity-based method, implemented from Optimal Reciprocal Collision Avoidance (ORCA) half-planes [2], to make each agent move with its group members in a particular formation while avoiding collisions and having no unnecessary connection to other members. The goals of our work are as follows. Our method presents usual and familiar scenarios for a group of agents starting from the initial position, moving to their target position. We can consider a leader and the group's followers that try to reach themselves to their target area. There are other groups, individual agents and obstacles which are on the group's way, simultaneously. Each agent has its unique style to avoid others, like a real human. Meanwhile, all agents try their best to keep the group's formation and cohesion. In this context, group formation is a specific shape that can be made by aggregation of several agents together (which in our work is a specific uniform formation) and consequently, keeping the formation means that members of a group adjust their directions and positions while moving to maintain at that specific shape as a whole group. Let's describe the two main scenarios. First, if an agent is not in its proper location, by adding two more half-planes and limiting the set of allowable velocities, the agent will change its direction toward that position. And second, if there are obstacles on the agent's way, the agent tries to pick one of the other members of the group as its subleader and then again by producing more half-planes, the agent can follow the subleader until passes the challenging environment. After passing obstacles, agents will recover from the destroyed formation to the main formation of the group. We should notice the fact that there is no time requirement for agents to do that. However, each member will increase its speed to return to its proper location and help the group to transform into the previous formation as soon as possible.