Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing data #49

Open
Baudin999 opened this issue Feb 9, 2024 · 5 comments
Open

Importing data #49

Baudin999 opened this issue Feb 9, 2024 · 5 comments

Comments

@Baudin999
Copy link

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?
@ikpil
Copy link
Owner

ikpil commented Feb 11, 2024

Hi @Baudin999

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

@Baudin999
Copy link
Author

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?

@ikpil
Copy link
Owner

ikpil commented Feb 13, 2024

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?

@Baudin999
Copy link
Author

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.

@ikpil
Copy link
Owner

ikpil commented Feb 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants