Abstract
We present Menge, a cross-platform, extensible, modular framework for simulating pedestrian movement in a crowd. Menge's architecture is inspired by an implicit decomposition of the problem of simulating crowds into component subproblems. These subproblems can typically be solved in many ways; different combinations of subproblem solutions yield crowd simulators with likewise varying properties. Menge creates abstractions for those subproblems and provides a plug-in architecture so that a novel simulator can be dynamically configured by connecting built-in and bespoke implementations of solutions to the various subproblems. Use of this type of framework could facilitate crowd simulation research, evaluation, and applications by reducing the cost of entering the domain, facilitating collaboration, and making comparisons between algorithms simpler. We show how the Menge framework is compatible with many prior models and algorithms used in crowd simulation and illustrate its flexibility via a varied set of scenarios and applications.
Introduction
Crowd simulation is a fragmented field. Whether for visual effects, architectural safety, or robotics, researchers often find themselves building "ad hoc" simulators from scratch just to test a single new idea—such as a better way for agents to avoid each other. This leads to three major issues: a high barrier to entry for new researchers, "comparison chaos" where algorithms cannot be fairly evaluated against one another, and significant duplicated effort across independent research groups.
Menge is an open-source framework designed to solve these issues by providing a standardized "plug-and-play" architecture. By decomposing the complex task of crowd simulation into interchangeable subproblems, Menge enables researchers to conduct fair, apples-to-apples comparisons between different algorithms and significantly lowers the barrier to entry for new developers.
Functional Decomposition
The core principle of Menge is functional decomposition. The simulation of an agent is broken down into four distinct, composable stages:
- Goal Selection: Determining where an agent wants to go (e.g., a specific exit or a shop window).
- Plan Computation: Finding a global path to that goal (e.g., using navigation meshes or roadmaps).
- Plan Adaptation: Transforming the "ideal" path into a "feasible" one by reacting to local, dynamic obstacles like other people.
- Spatial Queries: Efficiently finding nearby agents or obstacles to inform the steps above.
This orthogonality allows researchers to swap a single component—such as changing a "Social Force" model for a "Velocity Obstacle" model—while keeping the environment and global path-planning identical. This isolation is crucial for understanding the specific impact of an algorithm on final crowd behavior.
System Architecture
Menge uses a Behavioral Finite State Machine (BFSM) to manage agent logic. For example, an agent might be in a "Walking" state until they reach a "Goal," which triggers a transition to an "Examine" state. This logic is defined in an external XML specification, allowing users to change the entire behavior of a crowd without recompiling the C++ source code.
The framework is designed for high performance and scalability on multi-core systems. In testing, Menge successfully simulated 64,000 agents at interactive rates, demonstrating significant speedups as more processor threads were utilized.
Evaluation and Results
Menge's flexibility has been demonstrated across diverse applications, from simulating airplane boarding strategies (Ped-Air) to multi-story office buildings. The authors evaluated the framework using standardized suites like SteerBench and real-world benchmarks, such as replicating experiments involving human subjects exiting a soccer stadium.
By running the same scenario with different pedestrian models, the framework highlights how subtle algorithmic choices lead to visibly different crowd patterns, such as the formation of lanes or chaotic "clumping." Furthermore, the framework makes it easy to combine disparate research; the authors demonstrated this by merging three independent papers—a stress model, a formation-walking algorithm, and a density-sensitivity model—into a single scenario with minimal effort.
Limitations and Future Work
While Menge provides a robust foundation, several areas for growth remain. Currently, the framework relies on BFSMs; the authors suggest that Behavior Trees, common in the gaming industry, would be a valuable future addition. Additionally, the current version assumes a fixed population size and does not yet easily support agents entering or leaving the scene mid-simulation. Finally, while Menge focuses on trajectories, it does not handle "Motion Synthesis" (the actual movement of limbs), though it provides the necessary data for external animation engines to do so.
Summary updated