Kraut /kʁaʊt/

Real-Time Crowd Simulation

A lightweight crowd simulation library for native platforms and the browser. Try the WebAssembly build or download a prebuilt SDK; the recorded Linux run uses 100,000 agents on a tile map.

Reference run
100,000 agents
Simulation step
30 Hz fixed step
Runtime
Native + WebAssembly
Crowd simulation trajectories flowing around obstacles

Video

Native reference run

Recorded on Linux with a fixed 30 Hz simulation step. The run displays 100,000 agents using the default solver.

Watch on YouTube

Implementation

Simulation pipeline

The implementation uses four main stages for routing, neighbor lookup, local avoidance, and congestion handling.

  1. 01

    Reverse flow field

    One shared field provides global routing across the tile map.

  2. 02

    Packed spatial bins

    Nearby agents are found quickly without scanning the whole crowd.

  3. 03

    Bounded ORCA avoidance

    A bounded local solve computes collision-avoiding velocities.

  4. 04

    Density + clearance fields

    Density and obstacle clearance influence movement in congested areas.