Jump to content

A* width edges


Rick
 Share

Recommended Posts

Has anyone done A* on a 2D grid where edges are considered being passable or not, not just entire nodes? Think original Sims where you build walls between nodes. If each node has 4 variables for edges that represent open/wall, when looking to consider if a neighbor node is walkable, would things still work if you check the current nodes 4 edges and if there is a wall there don't check that neighbor at all (this would assume the nodes share the edge value of wall).

 

Has anyone done something like this before or the people who are more experienced in A* does this sound like it could work? If so I'll give it a shot for a small test I want to do.

Link to comment
Share on other sites

If generating a navgraph one usually removes non-valid edges between nodes in a post step e.g. if a node is inside a entity aabb remove the node or if node A cant see node B ( blocked by a wall ) dont link these nodes ( north-west-south-east ). MG had something implemented for dynamic obstacles - i dont know how he solved that, however.

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

Hi Rick,

 

I actually made this for a school project. The way you describe it is perfectly fine for this. First you check the edge which is adjacent to the tile you are coming from. When there is no wall there, you can start looking for the other 3 (if you have square tiles) walls.

pseudo:

  1. Check the tile next to me is walkable (water, lava etc)
  2. Check the origin-tile edge with the adjacent-tile edge.

    1. There is a wall? Done
    2. There is no wall?
      1. Check if the adjacent tile has 3 other walls (excluded the one you allready checked).
        1. If it has 3 walls: done.
        2. If it doesn't have 3 walls: Continue search algo.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...