Jump to content
tipforeveryone

AI Pathfinding question

Recommended Posts

I use Entity:GotoPoint() on my AI character. It moves perfectly from point A to point B

If my player controller stands between A and B, this AI character will push it.

If I set my character mass greater than AI's , AI character will be stuck a bit and take time to "slowly" move around my cylinder physic shape.

 

How can I make my AI move around my player character properly when using GotoPoint ? I need him to avoid my player character's position.

 

I am sure that I can't use world:BuildNavMesh() every frame for this kind of pathfinding...

Share this post


Link to post

You can try getting vector between AI and player and then add a bit of force to the normal.

I think a small force will help him get around your collider quicker.

post-11962-0-09833700-1489153838.png

Share this post


Link to post

I thought we had avoidance with pathfinding before?

I don't know smile.png I did not see any post before, can you show me please?

You can try getting vector between AI and player and then add a bit of force to the normal.

I think a small force will help him get around your collider quicker.

Good idea, but I want this AI avoid me completely biggrin.png like this

post-16833-0-67391300-1489166946.jpg

Share this post


Link to post

I posted a status update asking about dynamic navmeshes to get Josh's attention. Check out the development videos there which would solve problems like this if implemented.

 

Edit: videos:

Share this post


Link to post

Josh mentions a delay in this video, it doesn't look like nav mesh could be changed every frame for every character.

Share this post


Link to post

Yeah, while that video seemed responsive enough, I suspect the issue may be that on large terrains, having dozens of vehicles/characters alter the navmesh at once would drop the framerate significantly. I wonder how GTA and other games/engines work around this.

Share this post


Link to post

The navmesh updating in those video is using small levels. For a Leadwerks terrain this is probably to heavy. However you can do patch updating which is possible in the C++ version. I will try to find an example from 2 years ago.

 

Ironically this exact same discussion was held 2.5 years ago: http://www.leadwerks.com/werkspace/topic/10911-pathfinding/page__st__20#entry79870

Share this post


Link to post

Can't find my old files on this unforntunately. Searching in the recast navigation API is the only remaining option for now.

Share this post


Link to post

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