Jump to content

Fake navmesh style A* pathfinding


Aily
 Share

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

"Better" is big enemy of "good"

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

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
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...)

"Better" is big enemy of "good"

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

"Better" is big enemy of "good"

Link to comment
Share on other sites

  • 1 year later...

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...