# Crowd force weights

How the Houdini crowd solver decides which behaviors to apply to an agent at each time step.

## Overview ¶

Houdini has many useful POP forces that you could use as behavior nodes to control the movement of the underlying particles that the agents are attached to. These “steering force” nodes are essentially particle forces with the added concept of weights, and they provide useful crowd behaviors such as “move toward a point” or “follow a path”. At any given moment, an agent could be affected by multiple forces (for example, both “follow this path” and “avoid obstacles”). The crowd solver deals with multiple forces by normalizing the weights (scaling them so they add up to 1), and then multiplying the individual forces by the normalized weights.

Along with the crowd steering force nodes, there are also default forces on the crowd solver that have the concept of weights.

## Example ¶

Consider an agent with the following forces applied to it at a given moment:

Force type

Force amount

Weight

Avoid

10

1.0

1

0.5

Align

2

0.2

The crowd solver uses weights to deal with multiple forces that are present on an agent:

1. The crowd solver normalizes the weights so they add up to 1:

• Avoid weight: 0.59

• Align weight: 0.12

2. The solver then multiplies the force amounts by the normalized weights:

• Avoid force: 10 `*` 0.59 = 5.9

• Follow path force: 1 `*` 0.29 = 0.29

• Align force: 2 `*` 0.2 = 0.4

3. Finally, the solver adds the forces to get the overall force on the agent.

## Using weights ¶

All the forces in the agent’s current state, and any forces that apply to all agents regardless of their state, are applied to the agent. It is not possible to have a behavior that completely overrides any other behavior. However, you can use a very high weight for a particular force (for example, `10`), so that when other forces are normalized, they are made unnoticeably small.

## Particle forces ¶

You can use regular particle force nodes and other DOPs inside a state to define behavior, not just crowd-specific “steering” nodes. However, non-crowd-specific nodes don’t have Weight parameters, so they will not be subject to the normalization described above. Instead they will simply be added on to any other forces on the agents.

# Crowd simulations

## Getting started ¶

• An overview of Houdini crowd simulation concepts.

• How to set up and edit a crowd simulation.

## The moving parts ¶

• About agents, the moving actors that make up a crowd simulation.

• About agent states, the virtual mood of each agent that controls the agent’s animation and the behaviors it runs.

• How to specify conditions that cause agents to change from one state to another.

## Behavior ¶

• Useful attributes for reading in triggers, or that you can set to affect behavior.

• How the Houdini crowd solver decides which behaviors to apply to an agent at each time step.

• Tips on setting up interaction between agents and other types of dynamics.

## Appearance ¶

• How to create a more realistic crowd by making agents look and act differently.

• You can add and constrain vellum cloth as part of agent shape geometry, and then simulate the cloth based on agent movements.

## Terrain ¶

• How to set up agents to adapt their animation to terrain and prevent skating.

• How to specify terrain geometry for agents to walk across.

• How to set up obstacles for agents to avoid.

## SOP crowds ¶

• How to use SOP motion paths to modify the behavior of a small number of agents.

• Attributes for SOP crowd motion paths.

## Crowd Procedural ¶

• Optimize crowd scenes at render time.