Skip to content

What is ORCA

Tim edited this page Jan 2, 2022 · 2 revisions

ORCA stands for Optimal Reciprocal Collision Avoidance. It's primarily used in robotics but is also of tremendous value for agent navigation in a game or any interactive product with moving agents that aren't supposed to collide with each other, or with obstacles on their way.

Long story short

ORCA takes a group of dynamic agents (each with his own radius and prefered velocity), static & dynamic obstacles, and runs a simulation to find out what's the optimal velocity for each agent so they avoid colliding with each other, as well as avoiding obstacles in their way.

NEED VISUAL

As the name says, it's about avoiding collision, so there is no physics involved in the simulation, and it's not a pathfinding solution either.
While it can be used without pathfinding, the prefered velocity of an agent still needs to point toward a goal.


Features

N:ORCA is currently in development, and while the repo is available to use and download, there is no documentation yet. It supports moving agents, static agents (dynamic, circle-shaped obstacles), as well as polygonal obstacles. Simulation is implemented using Unity's Job System & Burst, meaning it's relatively fast. The simulation occurs on a planar coordinate system (by default XY), though it can be used for 3D projects (XZ) as well.

Notable features :

  • Multithreaded
  • 2D & 3D friendly (XY or XZ simulation planes)
  • Include & exclude collision using a layer system
  • Height & vertical sorting/exclusion (XY:Z or XZ:Y)
  • Dynamic & Static obstacles
  • Raycasting

High level concept

The basic principles are similar to classic physics approach, where entities are registered to a simulation as either static (obstacles) or dynamic (agents). The simulation is updated each frame with a specified timestep, and dynamic agents are updated accordingly.

Be aware this is not a pathfinding solution on its own, and will yield best results when combined with either A* Pathfinding or Vector Fields.

Clone this wiki locally