It is currently Thu May 23, 2013 7:44 pm

All times are UTC - 8 hours




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Diagonal movement through walls in A* Grid Pathfinding
PostPosted: Wed Jan 11, 2012 3:17 pm 
Site Admin
User avatar

Joined: Wed Jan 11, 2012 1:57 pm
Posts: 12
Location: Los Angeles, CA
This was originally mentioned on the Cocos2d forum here:
http://www.cocos2d-iphone.org/forum/topic/28114/page/2

The grid pathfinding recipes allows for movement diagonally from one grid square to another even if there are grid walls there to block the movement. This problem is rooted in the fact that the gird is a little misleading.

The pathfinding algorithm is merely a bunch of nodes and links. The "grid" is kind of a simplification of that, but, admittedly it can lead to confusion. In that recipe each grid node is linked to all 8 other nodes around it. If you change this to link the nodes non-diagonally only (4 links per node) then this solves the problem but removes diagonal movement.

I will post updated recipe code here sometime in the next few days.


Offline
 Profile  
 
 Post subject: Re: Diagonal movement through walls in A* Grid Pathfinding
PostPosted: Fri Feb 17, 2012 4:23 am 

Joined: Fri Feb 17, 2012 4:20 am
Posts: 1
Wonderful thread. keep up the good work man. had a nice experience browsing here.!! Thanks

best iphone games


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron