DotRecast icon indicating copy to clipboard operation
DotRecast copied to clipboard

Importing data

Open Baudin999 opened this issue 1 year ago • 6 comments

Hi, I want to use DotRecast in a test project I am building, but purely on my (dotnet, C#) server. I am using Unity as my GameEngine and now I was wondering if there is an example project to export the data from Unity and import it into DotRecast.

What I have:

  • I can export the vertices and indices from my Unity NavMesh (serialize to JSON)
  • I can import that data on the server (deserialize the JSON)

What I need help with:

  • How do I initialize DotRecast with this data so that I can: Sample Height and get a path?

Baudin999 avatar Feb 09 '24 09:02 Baudin999

Hi @Baudin999

Please refer to UniRecast. Feel free to ask if you have any questions. https://github.com/ikpil/UniRecast

ikpil avatar Feb 11 '24 05:02 ikpil

Hi @ikpil

Thank you so much for replying. I just have a question about getting started. I am not afraid to get my hands dirty, but I do not know where to start. Is there a piece of documentation, or a youtube video I could watch to get me up and running?

Baudin999 avatar Feb 13 '24 10:02 Baudin999

The user guide for Unity isn't available right now, but I'll try to create a brief one over the weekend. Is there anything specific you're interested in?

ikpil avatar Feb 13 '24 14:02 ikpil

Thank you! I would like to start small, so sculpting a terrain in Unity and generating a navmesh. I would love to be able to export this from unity in a simple file format, maybe JSON, does not have to be super fast or efficient, then I will import this navmesh on the server and run spatial queries on it like:

  • GetHeight (for a given x and z give the correct y)
  • GetPath (get a set of points (x,y,z) between two points)

My use-case is the following, I am building an open world mmo rpg and I want an authorative server, this means that the server should be able, simply based on speed and target-position, be able to calculate where the game object is. This problem is harder than it looks because of the verticality of the terrain. If I can get the heights correct and the path correct, this calculation becomes a lot easier.

The second use-case is enemy AI, generating a path from the enemy to the player. If the position calculations of the first use-case are correct, the second becomes easier, especially the calculations to check the range of abilities.

Baudin999 avatar Feb 13 '24 14:02 Baudin999

I reviewed the code over the weekend and intended to create a guide, but I was too busy to do so. I will create it by the end of this month and mention you.

ikpil avatar Feb 18 '24 15:02 ikpil

I'd also be interested in a guide / example for basic use cases such as finding the path between 2 points. Thank you.

berkersonmez avatar Jun 09 '24 20:06 berkersonmez