anchor.diff:        gRenderAux.LineOnTerrain(T1, T2, $FFFF8000, $F0F0);
       end;
   
  -  //NavMesh vertice ids
  -  {if OVERLAY_NAVMESH then
  +  {//NavMesh vertice ids
  +  if OVERLAY_NAVMESH then
       for I := 0 to High(fVertices) do
  -      fRenderAux.Text(fVertices[I].X,fVertices[I].Y, IntToStr(I), $FF000000); //}
  -
  -  {//NavMesh polys ids
  +      gRenderAux.Text(fVertices[I].X,fVertices[I].Y, IntToStr(I), $FF000000); //}
  +
  +  //{//NavMesh polys ids
     if OVERLAY_NAVMESH then
       for I := 0 to fPolyCount - 1 do
       with fPolygons[I] do
       begin
         T1.X := (fNodes[Indices[0]].Loc.X + fNodes[Indices[1]].Loc.X + fNodes[Indices[2]].Loc.X) / 3;
         T1.Y := (fNodes[Indices[0]].Loc.Y + fNodes[Indices[1]].Loc.Y + fNodes[Indices[2]].Loc.Y) / 3;
  -      fRenderAux.Text(Round(T1.X), Round(T1.Y) + 1, IntToStr(I), $FF000000);
  +      gRenderAux.Text(Round(T1.X), Round(T1.Y) + 1, IntToStr(I), $FF000000);
       end;//}
   
     {//Simplified obstacle outlines
  
positive.code: 
    //Mapp all map tiles to its polygons
    TieUpTilesWithPolygons();
  end;
  
  
  procedure TKMNavMesh.GenerateTileOutline(out aTileOutlines: TKMShapesArray);
  var
    I, K: Integer;
    Tmp: TKMByte2Array;
  begin
    SetLength(Tmp, gTerrain.MapY-1, gTerrain.MapX-1);
  
    //Copy map to temp array as 0/1 (generator uses other byte values for its needs)
    //0 - no obstacle
    //1 - obstacle
    for I := 0 to gTerrain.MapY - 2 do
    for K := 0 to gTerrain.MapX - 2 do
      Tmp[I,K] := 1 - Byte(tpOwn in gTerrain.Land[I+1,K+1].Passability);
  
    GenerateOutline(Tmp, 12, aTileOutlines);
  
    //GenerateOutline is 0 based for versatility purposes, but Terrain in 1 based
    //because of legacy reasons. Do the conversion
    for I := 0 to aTileOutlines.Count - 1 do
    for K := 0 to aTileOutlines.Shape[I].Count - 1 do
    begin
      aTileOutlines.Shape[I].Nodes[K].X := aTileOutlines.Shape[I].Nodes[K].X + 1;
      aTileOutlines.Shape[I].Nodes[K].Y := aTileOutlines.Shape[I].Nodes[K].Y + 1;
    end;
  end;
  
  
  
negative.code:         fNodes[fPolygons[I].Indices[1]].Loc.X,
          fNodes[fPolygons[I].Indices[1]].Loc.Y,
          fNodes[fPolygons[I].Indices[2]].Loc.X,
          fNodes[fPolygons[I].Indices[2]].Loc.Y, $60FF0000);//}
  
    //NavMesh edges
    if OVERLAY_NAVMESH then
  