Jump to content
Aily

Fake navmesh style A* pathfinding

Recommended Posts

Working with pathfinding a little i found some sad things

 

1. walking by waypoints as "by rails"

2. navmesh code is hard to implement (recast\detour)

3. all i saw last time is realy hard to use

 

Target:

1. game have big open field

2. on this field many objects that charachters must drive over

3. i need speed and simplify

4. this must be easy attached to diferent projects

 

At last my pathfinding is:

each "unwalkable" area have aabb nav-body, that uses waypoints links as "can't walk here"

each "unwalkable" area have waypoints in it corners, to find path around unwalkable areas

 

base function give start (for example NPC) point as X,Y floats

and end X,Y float point

and returns path linked list where calculated path points runs each other from start path to end

 

It's just first "zero" version of this idea, it works, but need some clean code, fixes and add more functionality (it's still 2D, but soon....).

 

Try it guys smile.png Who can say that is not navmesh? biggrin.png

 

BlitzMax source and EXE in archive.

 

Hold F1 to see waypoints

 

Next step is done it by bMax and port to Lua,C++ and ActionScript if i will have time and good mood for this.

post-260-0-38554800-1350230803_thumb.jpg

nav_grid_0001.rar

  • Upvote 2

Share this post


Link to post
Share on other sites

Cool! Any method that consistently gives valid paths is a valid method, the only concern then is the cost and it's ability to deal with realistic game geometry.

Share this post


Link to post
Share on other sites

the only concern then is the cost and it's ability to deal with realistic game geometry.

I was thinking about it, and will add another geometry types here (sphere,poly) and this can be used in little games, where just need to find path and send NPC by it.

 

Now i think it can helps to make little strategy, or simple shooter with field and unwalkable areas on it (houses, trees, stones...)

Share this post


Link to post
Share on other sites

Cool! Any method that consistently gives valid paths is a valid method, the only concern then is the cost and it's ability to deal with realistic game geometry.

Do you remember Diablo2? world is flat and maked by boxes, so Torchlight have same scene geometry. This little code can possible to make Diablo2 style game, if each wall represent to it AABBs.

Share this post


Link to post
Share on other sites

This is looking promising, the demo worked well. I'll be after some sort of path finding soon so I'd like to give this a crack. I'm not very happy with my implementation of A*.

 

c++ +1

 

Good work

Share this post


Link to post
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.

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.


×
×
  • Create New...