Forum rules - please read before posting.

PathFinding Solution?

Hello Chris, long time no hear, well i have a serious question but i only need your oppinion and some tehnical knowledge of Adventure Creator.

First, i created a Characters and i created sphere collider 2d on them. it works good but not good enough, my characters are stamping ( overlaping) one another if collider is small ( ok i fix that and create a bigger collider , now they dont overlap but now i have situation where when characters are standing one beside another there is no enough space for them to walk, so my second character who is NPC follow he actually went from screen to go out of player collider and only THEN he start following ( there wasnt enough space for him in NavMesh).

My question is How would you approach this problem with your path finding script and if we create a script that will calculate distance between characters and on that will set radius of trigger smaller or greater ( which means if characters are nearby collider will be 1 , but when player start moving then theyr colliders are greater (max 3 radius size ) and player can easily navigate through scene and around npc)


here is the picture just to see what im talking about the space and nav mesh and characters collider.


Thank you very much


Comments

  • First off - in your NavigationMesh inspector, you have a Character evasion field that you should make sure is set to All Characters for best results.  You can also set a non-zero Pathfinding update time in the Settings Manager if you need characters to avoid NPCs who are moving at the same time.

    I would also recommend reducing the size of the Circle Colliders - though a standard C# script could change the radius dynamically as you suggest, and this wouldn't affect AC scripts nor be an AC-related issue.

    For performance reasons, AC approximates character colliders by creating a diamond shape around them when evading, so it's possible this is the source of overlapping.  You can see this diamond being created beginning line 465 in NavigationEngine_PolygonCollider.cs.  If you wish, you can edit this script to create more points around it (e.g. 8) to better approximate the circle.

    You could then create a new class from this script and integrate it as a new navigation engine, so as not to change AC's source code (see Section 12.4 of the Manual).
  • Im having version 1.45 is that included or is that a new stuff?
    I cant find Character Evasion field in my navigationMesh inspector.
  • In v1.45 you have an Attempt to move around characters when pathfinding? option, but it is not as optimal as it is now.  In v1.52a, I shall be adding further options to control the shape of the evasion collider.
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.