Here we use formations together with RVO2 to create a potential crosswalk scene. Each group is assigned a random formation from a set of three and a random color. The goal for each group is to get to the oppisite side of the screen.
Here is a video of 10 agents changing formations. First we can see the magnificent creation of a horizontal row formation, then the group quickly changes into a stable vertical line formation and finally they end up in a triangle formation without colliding.
Here's a video of our attempt to remake the implementation of RVO (made by Stephen J. Guy, et al. http://gamma.cs.unc.edu/RVO2/).
The movement of the agents are working and most of them seem to be moving towards the opposite side of the circle (as specified as the goal for the agent). However, the agents doesn't seem to be avoiding each other nor do they change direction during the simulation, which they should do at some point.
But the simulation does run at a reasonable fps, so the computations aren't too heavy on the CPU.
Today we have experimented with some group formations. We have implemented an abstract base class for making the agents align in a specific formation. To use this class one has to inherit it and implement the method CreateTemplate(). In this method there needs to be specified how the relative positions to the leader of the group are placed. Also, the nr of agents has to be stated in the inspector and which of the agents is the leader.
Here is a demo of a group formation for walking on a line:
Here is a demo of a group walking in a triangle formation:
In this scene we have made different approaches to making the agents avoid each other. First we tried using the UnitySteer script "Steer For Spherical Obstacles" on one of the agents. This script was not supposed to be used in that way, we found out. Then we tried with the script "Steer For Evasion". This script uses another agent as the reference to avoid. The disadvantage with that is that the agent can only avoid one other object for each script.
The hard part in the simulation was to find out which parameter to change in order to avoid collisions between the agents. We needed to find the radius parameter for which represented the agents "comfort zone". In the end we found this to be a combination of the "Safety Distance" and the vehicles radius. The result is shown in the video above. In the video above ther's a slight offset in the vertical axis between the two agents.
If there's no offset the agents will do the same movements for a while and then diverge from each other. This is something that can happen in the real world too, but maybe not this extreme.
Today we experimented with different types of collision avoidance for our agent. The following scene in these videos is composed of one agent and one obstacle. The agent will collide straight on the obstacle, without any angle of incidence. The agent's goal is to pass the obstacle and end up on the other side.
In this scene we used Unitysteer's biped ve script for our agent. By using this our agent got stuck and didn't make any progress.
Our nex step was to try Unitysteer's Autonomous Vehicle scrip with the same scene setup as above. When we tried this the agent managed to avoid the obstacle and steer around it.