x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Fixing navigation of multiple StaticMesh-based characters

Hi,

Since I am currently stuck in the development of my RTS game, due to the navigation issues, I decided to create this thread even though I bothered many people with my other questions closely related to the heading matter :) I think that perhaps this post might become handy for others as the other threads I created are slightly disordered and confusing. I would also be glad to receive a final feedback whether this problem can be resolved using UE4 or it is just so incompatible that I should let go with the idea. Hopefully, the former is true, because I have put a lot of effort in some of the algorithms in the game (like actor combination) and naturally would not like it to go to waste. These are the links to threads outlining the problem origins (chronologically):

1. Find Path to Location Synchronously creating weird paths (when I did not yet use the `Character` class for navigation)

2. NavMesh does not update fast enough

3. Enabling Detour Crowds

At present I am using the @Justin.Dooley setup of the characters, but it does not support the addition of new StaticMeshComponents to the characters, because the collision is based strictly on the root's capsule component. Then there is the idea from @MieszkoZ which defines the characters as navigation obstacles. I will briefly describe the setup I implemented for this concept and its outcomes (a copy-paste from one of the comments):

1) In the Navigation tab of my StaticMesh asset (used in the character blueprint) I add a cylinder collision mask.

2) I set the AreaClass for this collision mask to a blueprint NavAreaForPaths I have created.

3) I set the radius of the cylindrical mesh to 15 (50 is the length and width of the StaticMesh)

4) In the NavAreaForPaths blueprint I set the default cost value to 5 and the entry cost to 2.

5) In the StaticMeshComponent of my character' blueprint I change the CanEverAffectNavigation Property to true, so that the character is affecting the NavMesh increasing the path cost around itself.

And all of this sometimes works and sometimes does not. The characters clearly want to avoid one another. Nevertheless, they often follow a path which leads through the expensive NavArea, thus when a character reaches a path point located in such Area and consequently the NavAreaForPaths of one character starts to overlap with NavAreaForPaths of the other character, the character that is being navigated becomes enclosed in the expensive NavArea. Therefore, it no longer cares if the path leads through the costly area or not. It then wants to shorten its movement distance, which frequently results in a collision of the characters. I have also tried multiple setting of the path costs in NavAreaForPaths blueprint, but setting the default cost to a too high value (which completely prevents the path points to be generated in the highly expensive NavArea) results in shaking and irregular rotation of the characters (as they are located in the very expensive area all the time, because they generate it and thus start to do weird things). However, any lower value than that, makes the path points sometimes be created too near the character resulting in the above-mentioned overlap problem.

I am really desperate to find the solution to this problem, so that I could continue the work. It does not have to be a very efficient one, because there won't be enormous numbers characters in the scene during runtime (about 50 maximally).

I am really thankful for the help I have received so far, but need slightly more advice to close the case once and for all :)

Product Version: Not Selected
Tags:
more ▼

asked Jan 27 '15 at 12:57 PM in Blueprint Scripting

avatar image

DarkLiquidus
51 16 21 25

avatar image DarkLiquidus Jan 28 '15 at 05:08 PM

Sorry for the long post, but I wanted to clarify everything as thoroughly as possible :)

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question