Stochastic activity authoring with direct user control

Aline Normoyle, Maxim Likhachev, Alla SafonovaI3d 2014 · DOI

TL;DR

This paper introduces a novel method for controlling crowd behavior in simulations by automatically computing stochastic transition rates. Instead of tedious manual tweaking, animators can specify desired high-level crowd appearances, and the system generates the underlying parameters, ensuring convergence and supporting complex constraints. This significantly streamlines the authoring process for realistic and dynamic crowd simulations.

What Problem Does This Paper Address?

Creating believable and heterogeneous crowd behavior in simulations is a significant challenge. Traditionally, animators rely on randomized parameters within agent behaviors (like finite state machines) to achieve this. However, tuning these parameters is notoriously difficult. It's hard to predict how changes at the individual agent level will translate to the overall crowd's appearance. This often leads to a tedious trial-and-error process where animators repeatedly adjust parameters and re-run simulations to achieve a desired effect, such as making a food court appear busy during peak hours. Furthermore, these parameters are often brittle and need re-configuration when the environment, activities, or scenario changes. This paper aims to solve this by providing a direct, constraint-based method for authoring crowd behavior.

Methods

The core of the paper's contribution lies in framing the problem of crowd activity authoring as a convex optimization problem. The authors model agent activities and their transitions as a directed graph, where nodes represent activities and edges represent possible transitions with associated rates.

  1. Stochastic Graph Modeling: Activities are represented as nodes in a graph. A transition matrix $K$ is defined, where $k_{ij}$ is the rate at which an agent transitions from activity $j$ to activity $i$.
  2. Convex Optimization: The problem of finding the transition rates $K$ that lead to a desired steady-state distribution $x_d$ is formulated as a convex optimization problem. This is achieved by defining the rate of change of agent proportions in each activity and setting it to zero for the steady state, leading to the equation $Kx_d = 0$.
  3. Constraint Satisfaction: The method supports various constraints, including:
  4. Activity Ordering: Ensuring certain activities must precede others (e.g., ordering food before eating).
  5. Activity Durations: Modeling fixed or exponentially distributed durations for activities. This is handled by expanding activity nodes into chains or using soft/hard constraints on repeat transition rates.
  6. Travel Time: Incorporating travel time between locations by introducing transition nodes representing travel.
  7. Preferences: Allowing users to specify preferences for certain activities or locations.
  8. Spatial Distribution: Mapping activities to specific locations and distributing agents across them based on environmental properties (e.g., distance, area).
  9. Pre-computation: Crucially, the transition rates are computed offline. Once computed, they can be plugged into the simulation, requiring no additional runtime processing, which is vital for performance in real-time applications.

Datasets

Not discussed in the paper. The paper focuses on a methodology and demonstrates its application with custom-built scenarios and examples within the Unity game engine.

Key Insights and Ideas

  • Direct Control via High-Level Appearance: The most significant insight is shifting the authoring paradigm from low-level parameter tuning to high-level specification of desired crowd appearance. This makes the authoring process far more intuitive.
  • Guaranteed Convergence: By formulating the problem as a convex optimization, the method guarantees that the computed transition rates will lead the crowd simulation to converge to the specified high-level distribution, regardless of the initial state.
  • Unified Framework for Constraints: The approach provides a unified way to handle a complex interplay of constraints (timing, sequencing, spatial distribution, preferences) that are difficult to manage with traditional heuristic methods.
  • Decentralized Simulation: The computed rates enable decentralized agent decision-making, meaning each agent can independently choose its next activity based on the probabilities, without needing a central controller.
  • Offline Computation for Runtime Efficiency: Pre-computing the transition rates is a key enabler for real-time applications, as it offloads the computational burden from runtime.

Key Results

The paper demonstrates the effectiveness of its method through several examples:

  • Bird Behaviors: The method successfully computed transition rates that maintained a desired proportion of birds pecking, overcoming the challenge posed by longer sleeping durations and travel times, which traditional methods failed to achieve. The average deviation from the specified distribution was significantly reduced (0.04 vs. 0.24).
  • Food Court: The system correctly handled sequential activities (ordering before pickup) and differing activity durations, achieving a low average deviation (0.03) compared to naive approaches that resulted in significant deviations (0.43 and 0.73).
  • Wandering Zombies: The method was used to automatically distribute zombies across a mall environment based on distance and area preferences, demonstrating its scalability to a large number of locations.
  • Performance: The pre-computation times for the demos were reported, showing that for typical scenarios with a moderate number of activities and constraints, computation is feasible within reasonable limits (e.g., 0.5s to 10.95s for various demos, with a notable increase for distance preferences due to additional constraints). Runtime sampling for next activities took less than 1ms.

Limitations and Future Work

  • Reactive Behaviors: The current model does not directly support reactive behaviors, where agents need to respond dynamically to player actions or sudden environmental changes. The authors suggest that agents could switch to a detailed AI script for such situations and then revert to the basic stochastic model.
  • Detailed Agent Simulation: The approach is best suited for large numbers of agents where aggregate behavior is more important than individual detail. It may not be appropriate for simulating a small number of highly detailed agents.
  • Assumptions: The model assumes agents can always reach destinations, interactions are deterministic, and resources are always available.
  • Future Work:
    • Extending the model to support more complex distributions for durations and conditional probabilities.
  • Applying the techniques to AI level-of-detail and dynamically computing spawn/exit rates around players.
  • Exploring applications in sound authoring (e.g., crowd cheers in sports games).
  • Verifying the potential for massive scalability in massively multiplayer online games.
  • Investigating hierarchical stochastic models for a larger number of actions.

Summary updated

BibTeX
@inproceedings{normoyle2014stochastic,
  author = {Aline Normoyle and Maxim Likhachev and Alla Safonova},
  title = {{Stochastic activity authoring with direct user control}},
  booktitle = {I3d},
  year = {2014},
  doi = {10.1145/2556700.2556714},
}
Figure