By HSJaaa


2019-04-15 04:37:44 8 Comments

Recently encountered this path finding problem while doing a RPG game. I am using Godot engine and pathing with A* and small cells. I also searched some other algorithm or technique like flowfield or navmesh, but seems A* with small cells is a easier approach. In order avoid obstacle like teammates or enemy while going for specific target in a fight or else, I update A* point weight like every 0.5 seconds where a unit is standing or not, using raycast to detect obstacle and re-path, and still having problem below:

  1. narrow pass. if two units standing close and there is a narrow pass between, the A* would return the path going through the narrow place which is unpassable due to the collision.
  2. path finding with different agent size. but this may require changing the A* code. If can path finding by size the first problem could be solved. the workaround to 1st problem I am thinking could be detect those narrow pass at runtime and update the weight. don't know if that is a good practice.
  3. world Vector3 position to grid, sometimes if two unit's position is convert to same grid the path return by A* would get block especially in crowd situation, thinking smaller grid may solve this

Overall I feel my implementation is bugy and not good practice, checked some games pathing AI, seem they have some rules like when units is forming a formation turn off the collision, or push other unit to engage enemy, dont know if or how they deal with volume, and feel like if changing these rule like turn off collision, would need to change other code like how to avoid overlap. I am quite confusing now how to achieve a solid pathing AI, and not for a large group of people, that maybe overkill for an RPG game.

0 comments

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] Overlaying grid for pathfinding

  • 2013-11-18 10:50:44
  • Wakaka
  • 368 View
  • 2 Score
  • 1 Answer
  • Tags:   path-finding grid

3 Answered Questions

[SOLVED] RTS Unit AI: When to let the unit stop (due to local avoidence)

1 Answered Questions

[SOLVED] Potential Field Pathfinding in a non Axis Aligned World

  • 2018-06-10 17:55:01
  • Vindcara
  • 98 View
  • 1 Score
  • 1 Answer
  • Tags:   ai path-finding

2 Answered Questions

[SOLVED] RTS pathfinding

  • 2018-07-04 22:45:55
  • Maras
  • 759 View
  • 6 Score
  • 2 Answer
  • Tags:   path-finding rts

1 Answered Questions

[SOLVED] Implementing David Silver's Cooperative Pathfinding in Real-Time

2 Answered Questions

[SOLVED] RTS: Unit sight in fog of war

4 Answered Questions

[SOLVED] How is RTS Local Avoidance Done?

2 Answered Questions

[SOLVED] How to find all the possible places to go on a grid?

2 Answered Questions

[SOLVED] Influence Maps for Pathfinding?

  • 2012-11-16 18:24:34
  • james
  • 1038 View
  • 2 Score
  • 2 Answer
  • Tags:   path-finding

1 Answered Questions

[SOLVED] Techniques for (literally) cutting corners on square grid maps

  • 2011-08-15 03:22:22
  • Meh.
  • 2121 View
  • 7 Score
  • 1 Answer
  • Tags:   path-finding

Sponsored Content