Friday, November 11, 2022
HomeGame Developmentpath discovering - Connecting nodes for A* algorithm

path discovering – Connecting nodes for A* algorithm


I’m presently engaged on implementing a pathfinding module for my 2D sport engine that I’m writing in Python utilizing Pygame.

At present there are objects reminiscent of bushes or buildings which may be positioned within the sport world which the sport character ought to pathfind round. I’m including nodes to the corners of those objects as a result of it is actually the corners which can be of curiosity. If there’s a clear path to the aim then no pathfinding is required.

Nevertheless I’m not positive methods to join all my nodes. Utilizing a grid it is easy to outline a nodes neighbors however with nodes unfold out with various distances a node can simply have 10 or much more neighbors. I’m frightened of efficiency points if I merely add each single node in “line of sight” of one another as neighbors.

Anybody obtained some concepts?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments