Troubleshooting the Simulation
 
 
 

To see the results of the motion synthesis, you can check each biped's motion flow script.

Set up the lesson:

Check the results:

  1. Press H on the keyboard. Select any available part of a biped, and then go to the Motion panel.
  2. In the Motion Flow Script rollout, scroll through the script.

    Their scripts show the sequence of clips used for a specific biped's movement in the simulation. The script is generated when the simulation is solved.

  3. Select another biped, and look at its script.

    Each uses a different sequence of walking and turning clips to move through the scene.

    In addition to the techniques you learned in this tutorial, there are many other ways to improve a crowd simulation.

If the crowd simulation isn't working at all:

  1. Try removing all behaviors but one (such as a Seek behavior) and solving the simulation. If the bipeds follow that one behavior just fine, then the problem is with one or more of the other behaviors; add the behaviors back one at a time, and solve each time to determine which behavior is causing the problem.
  2. If the bipeds don't follow that one behavior, then the problem is with the clips. Try adding more varied clips to the shared motion flow. Bipeds can only follow the clips they have in the graph. For example, if all clips move the bipeds straight forward, they will not be able to turn to avoid other bipeds or obstacles in the scene.
  3. To see exactly where a problem is occurring, turn on Update Display in the Solve rollout, and set Frequency to a low number such as 5. This will update the display every 5 frames. Watch the simulation as it solves, and look for problem areas, such as places where bipeds collide or go somewhere they shouldn’t. This will help you spot which behavior is causing the problem.

If collisions occur at the start of the simulation:

  1. If delegates are placed too close together at the start of the simulation, the simulation won’t detect potential collisions at the start. This happens because the Avoid behavior checks to see if a collision between delegates is going to occur; that is, if two bipeds' hard radii will intersect at some frame in the future, not if it has already occurred. You can solve this problem by moving delegates farther apart at the start of the simulation so their hard radii don’t intersect. Remember that if you move a delegate, the biped won’t align with the delegate until you solve again.
  2. Try adding additional random start clips to the graph. This will give the crowd system more choices when starting the simulation.
  3. Move delegates at frame 0 to allow more time for transitions.

If collisions occur during the simulation:

  1. Increase the Avoid behavior’s Hard Radius to a higher number, and solve again.
  2. You can also try changing the Priority and Start Frame values for individual delegates to keep bipeds from colliding. You can change these values individually by selecting the delegate and going to the Modify panel, or with the tools on the Crowd helper > Modify panel > Priority rollout.

If one or more bipeds can't find a solution even with backtracking:

  1. Decrease the Hard Radius value on the Avoid behavior, and solve again. If the Hard Radius is too high, bipeds will have nowhere they can go without detecting a collision.
  2. Make motion clips as short as possible, so the crowd system doesn't have to back up too far when backtracking.
  3. You can also change transition probabilities in the motion flow graph to make some clips more likely to be used than others.

General tips for working with biped crowds:

  1. Use freeform clips rather than footsteps to prevent viewports from becoming cluttered with footsteps.
  2. After the simulation is complete, you can select a biped and scroll through its script on the Motion Flow rollout. This will tell you if some clips are being used more than others, and can give you clues about which clips should be added to give the bipeds more variety to choose from.
  3. When creating a simulation for a large number of bipeds, a common workflow is to place the camera in such a way that some bipeds aren't visible at the very start or end of the simulation. For example, if you have set the Start Frame for some delegates to a frame later than the simulation start, these delegates and bipeds won't move until their Start Frame comes up. The delegates and camera should be placed in such a way that these bipeds are "offscreen" until they move into view.
  4. You can use more than one motion flow graph in a scene. For example, you could have one graph with running motions, and another with walking motions. In this way, some bipeds could run around the scene while others walk. Each biped can use only one graph.