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"

Expanding NavMesh at runtime?


I'm trying to set my game in a city dynamically generated from a seed. Each city block would be considered a chunk, and chunks would be loaded and unloaded based off of something like their manhattan distance from the player.

However, I'm not sure how I'd handle AI moving between chunks. Since, in theory, I could make the city generation infinite, I'd also need to have what essentially boils down to an infinitely-sized NavMesh. I was thinking about handling the NavMesh on a chunk-by-chunk basis, but I'm not sure how well Unreal's AI handles "bridging" between two NavMeshes.

There were a few options I was thinking about trying, in order of preference:

  1. Each chunk is its own level and they are streamed them in as needed, using the tricks mentioned here to handle loading the same chunk twice. I'm slightly concerned about the performance hit that something like this would cause, but it would likely offer me the most control and flexibility and would also allow me to easily organize any chunk "prefabs," as it were. Each sublevel would have its own NavMeshBounds to handle AI within that sublevel, but I'm not sure how well moving AI between sublevels would work, if it works at all.

  2. Each chunk is a hierarchy of Actors that make up a chunk "prefab." There would be a NavMeshBounds in each chunk's hierarchy that would generate the navmesh after the chunk actor gets placed. This wouldn't have to deal with streaming in any levels, but I'd still have to work out how to "bridge" between the navmeshes on a chunk boundary.

  3. Have a NavMeshBounds centered on the player's current chunk and expand it out in all directions in the size of n chunks. If the player changes chunks, it would move to be centered on the new chunk -- the same sort of system that gets brought up in this question here. This dodges the problem of bridging navmeshes entirely, but I'm not sure what would happen to AI caught "outside" the navmesh when it's regnerated. Do they use the "old" navmesh data, or do they act as if they aren't on a navmesh at all?

  4. Simply changing the bounds of the NavMeshBounds. This seems like it might have a pretty major performance impact, however, since the size of the navmesh could grow fairly dramatically as the player wanders away from the origin of the NavMeshBounds. I'm also not even sure if changing bounds size at runtime is possible.

I haven't really even gotten beyond the planning phase of how to best handle the world generation system, so I'm also open to any other suggestions anyone has for how to best handle AI and procedural generation.


Product Version: Not Selected
more ▼

asked Mar 25 '15 at 08:18 AM in Using UE4

avatar image

188 4 14 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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