DOTS-native pedestrian crowd simulation for Unity. Lane graph navigation, spatial hashing, ORCA-style forces, LOD, obstacle avoidance, and traffic signal support — built for AAA production scale.Up and running in under a minute.Create your pedestrian prefab, add TrafficCrowdAgentAuthoring. Drop a TrafficCrowdSpawnerAuthoring in your scene, point it at the prefab, set your count — done. Thousands of fully simulated DOTS entities, live in your scene with zero boilerplate.📖 Documentation | 💬 Discord | 📧 Email SupportTrafficEngine Crowd is a DOTS-native pedestrian simulation plugin for Unity. Every system runs as a Burst-compiled parallel job — no MonoBehaviour overhead, no polling loops. The simulation is built to hold frame budgets at crowd sizes where traditional approaches break down.Agents navigate a lane graph using spline-based look-ahead, respond to traffic signals, queue behind congestion, avoid static obstacles, separate from each other, and conform to terrain surfaces including stairs and ramps. Each behaviour is isolated to its own system with a clear ownership contract — navigation writes intent, downstream systems modify it, movement commits the final result.Navigation - Agents follow lane splines with a 2 m look-ahead for smooth directional sampling. Lane transitions, boundary containment, and dead-end reversals are all handled within the navigation pass.Queuing & Traffic Signals - Each agent scans forward for red signals and congestion. A stop is only triggered by genuine blockage — preventing false stops from isolated stationary pedestrians. Queuing yields immediately if an avoidance commitment is active.Agent Separation - ORCA-style separation forces are applied between neighbouring agents using spatial hash lookups. Head-on encounters automatically resolve to opposite sides with no shared state or write contention.Obstacle Avoidance - A forward cast confirms a real obstacle before avoidance engages. Nine candidate rays fan around the lane forward axis, each measuring its navigable corridor depth against the lane boundary polygon before casting, then scoring on alignment, clearance, and temporal stability. The committed direction persists across frames to prevent oscillation.Surface Conforming - Two raycasts per agent per frame keep agents grounded on terrain, ramps, and stairs. A grace period absorbs transient misses at step edges and physics seams before fall state engages.LOD System - Three distance tiers implemented via enableable components. Full simulation at close range, progressively reduced at distance. No structural entity changes occur during transitions — just component enable/disable.Spawner - Agents spawn inside valid lane boundaries with boundary compatibility pre-computed once at startup. Collider avoidance on spawn is configurable via layer mask to prevent agents spawning inside geometry(eg. obstacles).Simulation PipelineExecution order: NavigationSystem → QueuingSystem → AwarenessSystem → ObstacleAvoidanceSystem → SurfaceSystem → MovementSystemSpatial HashingSimulation cell size: 5 m, spawn cell size: 2 mO(1) neighbor queries per agentSecondary snapshot map provides O(1) position, velocity, and state reads across systems without structural queriesLODThree tiers: High 0–50 m, Medium 50–120 m, Low 120 m+Implemented via enableable components — no structural entity changes during transitionsFull simulation at High, obstacle avoidance skipped on alternate frames at Medium, navigation and movement only at LowDistances configurable via the authoring inspectorObstacle AvoidanceForward sphere cast confirms a real obstacle before avoidance engagesNine scan rays fanned ±82.5° around the lane forward axisPer-ray boundary corridor depth computed before casting — prevents false rejections at lane seams and narrow cornersRays scored on goal alignment, absolute clearance, and temporal stabilityCommitted direction persists across frames to prevent oscillationQueuing & Traffic SignalsForward scan distance: 4 mForward cone threshold: cos(53°) ≈ 0.6Minimum 3 blocking agents required before a congestion stop triggersYields immediately when an avoidance commitment is activeAgent SeparationORCA-style separation forces via spatial hash neighbor lookupsHead-on encounters resolve to opposite sides using XOR of entity indices — no shared state or write contentionSurface ConformingTwo raycasts per agent per frame: center probe for Y-authority, forward probe for surface look-aheadThree consecutive misses required before fall state engages — absorbs transient gaps at step edges and physics seamsSpawnerBoundary compatibility pre-computed once per spawner at startup — O(1) per spawn attemptUp to 20 placement candidates attempted per agentCollider avoidance on spawn configurable via layer maskEditor Menu (Tools → Traffic Engine → Crowd)Create Spawner in Scene — places TrafficCrowdSpawnerAuthoring directly inside your DOTS Sub-scene, ready to bakeValidate Scene Setup — runs all pre-play checks and surfaces missing or misconfigured dependenciesDebug Mode → Enable / Disable — adds or removes the TRAFFIC_ENGINE_DEBUG scripting define and recompiles automaticallyCreate Visual Debug Config — creates the debug config ScriptableObject under Assets/Resources/Open Documentation — opens online documentation in the default browserDebug VisualizationEnabled via TRAFFIC_ENGINE_DEBUG scripting define — zero cost in release builds, all debug code strippedEight independently toggleable categories: Core, Entity ID, Navigation, Avoidance, Queuing, Awareness, Movement, SurfaceCore draws a LOD-tier ground disc per agentEntity ID shows a screen-space label with entity index, speed, and current stateNavigation draws the desired velocity arrowAvoidance draws the forward detect cast, all 9 cone rays, committed direction arrow, and obstacle contact pointQueuing shows a state tick above the agent headAwareness draws the ORCA influence radius ring and separation force arrowMovement overlays DesiredVelocity and smoothed Velocity as two separate arrowsSurface draws every probe raycast line colored by outcomeStrict one-hue-per-semantic-role color contract: Blue = navigation intent, Green = valid state, Red = blocked or failed, Yellow = committed avoidance or congestion hold, Orange = separation force, White = boundary too narrow, Magenta = full probe range, Cyan = forward step hit, Gray = ORCA influence radiusLOD filter and configurable max draw distance (150 m default) keep overhead manageable in large scenesRequirements (most packages are automatically included)Unity 6.0 or newercom.unity.entitiescom.unity.entities.graphicscom.unity.burstcom.unity.collectionscom.unity.mathematicscom.unity.physicsLane GraphPackage Contents30+ C# source files2 sample scenes - Basic and Advanced setup.One sample prefab showcasing Animecs based pedestrian character setup.Doxygen-style documentation throughoutIdeal ForUrban simulations and city buildersOpen-world games with high pedestrian countsArchitectural visualisationsAny project requiring large crowds without sacrificing frame budget



