Jump to content

GotoPoint() : shorter path ?


YouGroove
 Share

Recommended Posts

Hi,

 

Using GotoPoint(), i have a mob that makes big circles sometimes when the player is on the opposite side of some obstacle.

Does anyone have experienced that ? Is there a way to have a shorter path ?

 

Goto_Point.jpg

 

I know MonsterAI.lua checks if the player is visible directly and just no more uses navigation, but a simple forward move, but it is not possible to have a shorter navigation path ?

Stop toying and make games

Link to comment
Share on other sites

what i have implemented is 3D weighted grid..fast efficient and it doesnt care much what sort of geometry you throw at it..

We could implement that in LE3, launch a special game mode that would raycast from top to down on the level and store hit point height in some big array. The complex thing is to calculate the shortest path from a position to another.

 

 

Are you able to look at the nav mesh to see if it looks weird like mine did?

Navmesh generated is clean :

navmesh.jpg

 

If we could adjust navmesh generation to generate smaller cube regions navmesh would get more precise ?

 

I placed more objects on the map to generate a new navmesh with less open areas, it helps ot have shorter paths as navmesh will take closer vertex on the map to reach the player.

nav3.jpg

 

The solution is combining :

- adding obstacles on the map to not have too much open areas

- using simple forward movement when the player is visible on the line of sight

 

The best would be an option to tell the navemesh to generate smaller square patches.

 

 

 

 

Another test, and navigation was really going in circles, that's strange as there is navmesh vertex really closer to the player.

navigate.jpg

Stop toying and make games

Link to comment
Share on other sites

We could implement that in LE3, launch a special game mode that would raycast from top to down on the level and store hit point height in some big array. The complex thing is to calculate the shortest path from a position to another.

 

..that will not work well if you have tunnels or any form of layered geometry..creating instead, 3D volume grid in to which whole level will be 'sunk' and then simply dicard 'occupied cells' is way I did and its very fast and work over everything..size of search grid cell you could set simply by setting its parameter during creation..works easy, fast and over any kind of geometry..

  • Upvote 1

 

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