Thursday, February 28, 2013

Crowd Simulation: Part 1

Eventually I have got the time to get on with my crowd simulation project. I have 7 days to go on the project, so, I won't be able to add in animation. At the moment I am trying to achieve some believable behavioral animation. I am trying to simulate a medieval fight scene.

Here is the output so far. In this screenshot you can see there are two kinds of agents. The front rows are foot soldiers and the back portion consists of horses, which will hopefully have riders on them soon.

Formation with different agent types
First of all I started by defining a basic human agent.

Basic human agent with primitive geometry
 I would have gone on with just using cubes, but the app I am using requires a bone structure
Basic human agent with rig attached to it
Instantiating the agent to start building a crowd:

Creating instances of agents
Here I have gone on and added some variation to the population field. The agents are more dis-organised and have a randomised orientation

Adding variation to the population field
Now I go ahead and add variation to the model itself. This is being done at two different levels:
First, I add variation to the overall agent scale. As you can notice in the screen-shot below, the overall size of the agents populating the scene has some variation.

Agents with added variation in the overall scaling
At the next level of variation, variation has been added to the individual body parts. The head and the stomach pieces show variation in the next screen-shot

Variation added on a per-bodypart basis
Next I tried out having different types of agents populating the same population field. In the screenshot below, the scene has, a human, a car and a horse crowdEntityType

Population field populated with different types of agents
Next I started working with formations. The screenshot below illustrates a rectangular formation of horses. Some randomness and variation has been added into the orientation and columns and rows of the field to break the even-ness

A formation of horses
The example below illustrates placement along a curve.

A formation driven by curves
As the last thing tonight I made a formation of horses facing inwards. The rider may be preparing for an attack in this situation.


No comments:

Post a Comment