Skip to main content
GUIDEMMORPG Automation 9,431 views

Building a Sub-Millisecond A* Navmesh Pipeline with Recast & Detour for MMOs

Most beginner pathing bots get stuck on micro-ledges or jitter at tile boundaries because they rely on static waypoint recordings. Switching to Recast & Detour dynamic meshes eliminates stuck loops completely.

Architecture Overview

  • Extract terrain heightfields and static collision hulls per map tile.
  • Bake dtNavMesh tiles with tuned walkableClimb and agentRadius.
  • Smooth corridors using string-pulling (findStraightPath) with randomized lateral jitter.
cpp
dtStatus status = navQuery->findPath(
    startRef, endRef, startPos, endPos, &filter,
    polys, &polyCount, MAX_POLYS
);
if (dtStatusSucceed(status) && polyCount > 0) {
    navQuery->findStraightPath(startPos, endPos, polys, polyCount,
        straightPath, straightFlags, straightPolys, &straightCount, MAX_POLYS);
}

Always decouple path recalculation onto a background worker thread so your main tick loop stays deterministic at 60 Hz.

2 replies

Great tip on string-pulling jitter. Also worth noting: cache tile queries per sector to avoid hammering dtNavMeshQuery when 50 entities path simultaneously.

Switched our MMORPG farming loop to Recast last month — zero stuck incidents across 400 hours of runtime.

Log in to reply or react to threads.