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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I use Navmesh data in Server Side?

How can I use Navmesh data in Server Side? We are making Mobile RPG with Unreal Engine 4. So, server need Navmesh data for Monster AI Pathfinding. When I use Unity they have plugin for RecastNavigation. I saw in the Quick Start Guide "Create a NavMeshBoundsVolume" about generating Navmesh. Is there no way to export navmesh data created by NavMeshBoundsVolume?

Product Version: UE 4.7
more ▼

asked May 12 '15 at 05:46 AM in Using UE4

avatar image

6 1 2 2

avatar image wellbye Jul 19 '16 at 03:20 AM


avatar image zhangjuni Sep 06 '17 at 11:39 AM

可以将你插件打包发份给我吗 我现在kbe卡 UE4导航网格这 不知道怎么弄了 邮箱 469419752@qq.com

avatar image sanghaha Aug 02 '16 at 11:10 AM


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

1 answer: sort voted first

Tricky but quite obvious if you think about it.

Your server is responsible for doing all actual actions. The client may try to guess what's happening but will always obey the server.

This means the map itself needs to be on the server itself. In other words. The nav mesh is on the server. And it only matters how / where you access the navigation calculations.

If you use (for example) "SimpleMoveTo" on an event that's server only, it will be executed on the server and will use the navmesh the server already has.

more ▼

answered Aug 02 '16 at 11:21 AM

avatar image

5.9k 291 86 293

avatar image sejeon Aug 03 '16 at 12:03 AM

I think you got a wrong point. I mean was i need to exported navmesh data created by "NavMeshBoundsVolume" in editor

avatar image Erasio Aug 03 '16 at 12:07 AM

The whole map should be on the server. Including information from the "NavMeshBoundsVolume".

A listen server obviously uses exactly the same map as a client. And a dedicated server simply has no render-pipeline and a few other optimizations.

But map data, especially for physics and navigation, is stored on the server by default.

What exactly do you want to export? It's generated once and stored together with the map. Alternatively you can force generation of the nav mesh during runtime in the Project settings as well.

avatar image sejeon Aug 03 '16 at 01:44 AM

We are not using dedicated server. We made a custom server use c# with socket. So, exactly i need navmesh data for the c# recast module. Anyway i just want to know way to export navmesh data if possible. Actually i don't know about that dedicated server how they work. But As you said dedicated server already have all information related map included nav mesh. Maybe i can use that server only for the navigation calculation.

avatar image Erasio Aug 03 '16 at 02:48 AM

Alright your question got me confused.

You are writing a custom server 100% unrelated to Unreal Engine right?

In that case that's not supported. You'll have to dive into the engine source code and fetch the recast data yourself.

avatar image wellbye Aug 06 '16 at 01:29 PM

i have writen an editor plugin which can export the dtNavMesh's data to file, but seems UE4 doesn't use the dtTileCache for tile and temp obstacle manage. so even my server loads the dtNavMesh's data, it still can't dynamicly add/remove obstacle, i don't know why UE4 do that on its own, it's impossible seperated for server usage.

avatar image Erasio Aug 06 '16 at 03:03 PM

Is that plugin public?

If so could you post a link? A lot of people seem to look for this topic.

It'd certainly be better than nothing at all!

avatar image wellbye Aug 06 '16 at 04:28 PM

the plugin is easy, you can search "Extend the editor" for full example source, i only add a toolbar button for export operation. the key code is getting the dtNavMesh instance from UE4, then you can save any data within it(but no tilecache):

class ARecastNavMeshTrick : public ARecastNavMesh { public: const FPImplRecastNavMesh* GetRecastNavMeshImplTrick() const { return GetRecastNavMeshImpl(); } };

void ExportNavMeshData() { UWorld* World = GEditor->GetEditorWorldContext().World();

 const ANavigationData* NavData = World->GetNavigationSystem()->GetMainNavData(FNavigationSystem::DontCreate);
 const ARecastNavMeshTrick* NavMeshData = Cast<const ARecastNavMeshTrick>(NavData);
 const FPImplRecastNavMesh* RecastMesh = NavMeshData->GetRecastNavMeshImplTrick();
 dtNavMesh* DetourNavMesh = RecastMesh->DetourNavMesh;

 FString TempFilename = FPaths::GameSavedDir() + World->GetMapName() + ".navmesh";
 FTCHARToUTF8 Filename(*TempFilename);

 bool b = hztool::navmesh::save_navmesh(Filename.Get(), DetourNavMesh);
 if (b)
     FPlatformMisc::MessageBoxExt(EAppMsgType::Ok, TEXT("export navmesh ok!!!"), TEXT("TestCommand"));


avatar image minitoy99 Nov 23 '16 at 08:04 AM

hi. thanks your code, but I don't understand this code line.

bool b = hztool::navmesh::save_navmesh(Filename.Get(), DetourNavMesh);

where is funtion in project .. plz help me

avatar image wellbye Nov 23 '16 at 01:45 PM

that's your own save function, you can save a dtNavMesh to your custom file for server-side loading.

avatar image LINIMAS Jan 26 '18 at 09:12 AM

Hello I have the same problem. so I think I need your help, I save a dtNavMesh to my custom file. but recastNavMesh cannot understand it correctly. so May I see your code about How to save dtNavMesh to custom file

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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