Forum rules - please read before posting.

Navmesh accuracy

Hi, purchased Adventure Creator a few days ago and loving it.  I have come from AGS and use Unity daily in my day job (not scripting,), also have experience with Playmaker so all-in-all I am finding AC very easy to use and familiar.

I am having an issue with my NavMesh, my character keeps cutting corners, sometimes quite bad, almost always at the expense of it looking like I have set up my NavMesh wrong.  I have tried tweaking NavMesh search %, NavMesh search direction, Destination accuracy, NavMesh ray length, and activating/deactivating super-accurate mode.  Nothing seems to have much effect other than super accurate mode seems to make her move slow at times, particularly when she is walking through a wall outside the NavMesh.

This is a pixelart game and I have used the sprites as they load in so they are quite small compared to the demo scene.

Video of walking back and fourth while trying different settings is just uploading to youtube.

https://youtu.be/1snVhaa9oXo

Please help.  Im hoping there is a setting for number of points for NavMesh pathfinding, or maximum distance allowed to stray from the NavMesh line or NavMesh resolution or something. 

I look forward to the solution and most likely saying "Doh" at its simplicity.

Ill get back to my huge dialogue tree while I await an answer.  :)

Comments

  • Welcome to the community, @Rickious!

    In terms of Unity units, how does the size of your scene compare with that of the 2D Demo scene?  It looks to me (judging by the size of the camera in your video) that it may be too small for the pathfinding algorithm to be properly accurate.

    As each game's scale is different, the navigation system does indeed need to be able to scale too - which is what the Destination accuracy slider is for.  However, there are limits to it, and if your game's scale is too small then you will have to increase it.

    If it turns out that's the case, you can import the sprites at a larger size by reducing the Pixels Per Unit value in the Inspectors of the files themselves.
  • Hi Chris, glad to be here.

    I feared that was the case.  I was avoiding rescalling all the sprites in the scene unless I had to.

    My camera is currently set to...

    image

    So, what size would you recommend as a nice average that would allow me to fine tune wither way with the detail slider.  My sprites will all be small for this project, about the size of Brains foot  :)

    Although I didnt want to have to rescale everything, if it will solve the only issue I have had to date with AC, it is well worth the time.

  • Another example, Matilda, the player in the video, is 8x32 pixels,and I am at 100 Pixels per unit.  What would you suggest?
  • As a PPU?  It's hard to give an accurate value - just drag her into a new scene besides Brain, and adjust it until they're comparable.  She can be a bit smaller than Brain if your game in general uses small graphics, but I would say that the size of his foot is definitely too small.
  • 10 ppu instead of 100 ppu puts her at a comparative size to Brain and its a nice simple number.  Gonna convert all my sprites now.  Thanks for the help  :)
  • Gonna go with 14 ppu as that makes my game pretty much real scale in case i use any physics.  This means my character is over half the size of Brain when I just drag 2D Brain is at 100ppu.  I am presuming 1unit = 1m kind of scale should work a treat with pathfinding and NavMesh.
  • I believe 1 unit = 1m, yes - though it's generally only important if physics is involved, as you say.  If the scale is larger than the 2D Demo, you'll likely want a lower Destination accuarcy value, as it won't need to be so precise.  Maybe 0.5/6?  You can adjust it while the game is playing to find out what works best.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.