걸을 수 있는 타일 위에 있는 장애물 사이의 길 찾기 (Pathfinding between obstacles that sit on top of walkable tiles)


문제 설명

걸을 수 있는 타일 위에 있는 장애물 사이의 길 찾기 (Pathfinding between obstacles that sit on top of walkable tiles)

아래 사진을 예로 들어 보겠습니다. 다음을 고려하십시오. ‑

  • 파란색 사각형은 플레이어입니다.
  • 주황색 사각형은 첫 번째 대상입니다.
  • 분홍색 사각형은 두 번째 대상입니다.
  • 녹색 사각형은 걸을 수 있는 타일입니다.
  • 검은색 사각형은 걸을 수 있는 타일 위에 있는 벽/장애물입니다.
  • 각 타일은 4x4입니다.

 여기에 이미지 설명 입력

여기서 의도한 동작은 다음과 같습니다. ‑

  1. 주황색 사각형으로 걸어가면 직선 아래로 직선이 나타납니다.
  2. (파란색 사각형에서) 분홍색 사각형으로 걸어가면 가까운 거리에 있는 검은색 사각형 주위를 걷습니다.

현재 구현에서는 타일 그리드를 가져와서 일반적인 A* 알고리즘에 전달합니다. 각 사각형에 대한 최단 경로. 그러나 타일에 벽이 있다고 해서 걸을 수 없다는 의미는 아닙니다. 생성된 경로가 개체를 통해 잘리지 않는다는 것을 의미해야 합니다.

즉, 현재 구현 결과는 다음과 같습니다. 4x4 타일 그리드에 고정하는 것 외에는 선택의 여지가 없으며 전체 타일을 걸을 수 없는 것으로 표시하지 않으면 개체를 통해 잘립니다. 빨간색 타일은 걸을 수 없습니다.






<hr>




<h2>참조 솔루션</h2>

<h4>방법 1:</h4> <p>Idea for a solution:</p><p>The first solution obviously would be to increase A* accuracy by having each tile of 1x1.</p><p>Another idea is to don't use a simple int grid (or similar) when checking if a tile is walkable. 
Use instead a function or a more complex data structure that use starting and ending tile to know if that route is available. In such a scenario each 4x4 tile has four possible route (east, north, west, south) and for each one you must know if it is walkable. If you allowed diagonal movements than you would to store/compute 8 routes for tile.</p><p>I can't give you more detailed answers since you didn't showed anything of your implementation.</p><p>I hope I was helpful</p><p>(by <a href=kyleFederico Rossi)

참조 문서

  1. Pathfinding between obstacles that sit on top of walkable tiles (CC BY‑SA 2.5/3.0/4.0)

#path-finding #shortest-path #javascript #a-star #game-development






관련 질문

그리드 셀을 다시 방문하지 않고 그리드에서 가장 긴 경로 (Longest path on a grid, without revisiting grid cells)

Java 경로 지정 foreach 루프 (Java pathing foreach loop)

A* Admissible Heuristic for die rolling on grid (A* Admissible Heuristic for die rolling on grid)

2차원 배열의 타일 연결 알고리즘 (Algorithm for tile connection in a two-dimensional array)

무방향 그래프에서 노드에 대한 최단 경로 찾기 (Finding the shortest path to a node in an undirected graph)

논리적으로 최단 경로 결정 (Logically determine shortest path)

NavMesh로 더 가까운 플레이어 찾기 (Finding the closer player with NavMesh)

최단 경로 알고리즘: 다중 소스, 가장 가까운 목적지 (Shortest-path algorithm: multiple source, closest destination)

절차적으로 생성된 던전에서 AI의 길 찾기를 수정하는 방법은 무엇입니까? (How to fix pathfinding for AI in a procedural generated dungeon?)

NavMeshAgent는 Unity의 대상 지점과 같은 방향을 향합니다. (NavMeshAgent face same direction as destination point in Unity)

여러 차량에 대한 Unity 경로 찾기 (Unity Path Finding for Multiple Vehicles)

걸을 수 있는 타일 위에 있는 장애물 사이의 길 찾기 (Pathfinding between obstacles that sit on top of walkable tiles)







코멘트