Recast AI - Devlog #3

Hi guys,

I was little busy with finals that by the way, still haven’t ended. :cry: The project for now has the solid base if I may say so.

For now all classes have been translated into Java, and structure of jNavigation looks like this:

  1. com.jme3.ai.navigation.recast - Recast module with functions for building navigation meshes
  2. com.jme3.ai.navigation.detour - Detour module with functions for final part of building NavMeshes and manipulation of it
  3. com.jme3.ai.navigation.tilecache - I don't understand what exactly it does, but I understand it is some kind of optimization
  4. com.jme3.ai.navigation.crowd - Crowd module for moving behaviours of agent group
  5. com.jme3.ai.navigation.utils - Some converters that have been made for the easier use, It is not recommended to use any of it on your own

All classes that are used in Recast Navigation have been made, and proper interfaces to C++ code (thanks SWIG :smiley: ). Recast has javadoc. Recast should be mainly operational.

  1. There are some functions that I just don’t get like rcMarkWalkableTriangles that has output of array with length grater than number of vertices. Nowhere in documentation says how much, so I don’t know length of that array.
  2. There is problem of looking into the structures. Structures are built correctly, but if you can’t see their data correctly, they are useless. So I need to correct those structures for debug mode.
  3. There are functions like rcCalcGridSize that have two outputs int width and int height, so I needed to refactor them into two functions calculateGridHeight and calculateGridWidth.

So my job is now testing, debugging and refactoring.

If anybody want to test code in its building phase, it can be found on: jNavigation and its C++ code jNavigation Native. jNavigation Native is C++ library and it is needed to be built first with C++ compiler (and you must include jni header for proper built). In jNavigation there is class in com.jme3.ai.navigation.utils RecastJNI where you need to change URL in System.load() to where you built jNavigation Native on your system.

My predictions for now is that Recast module and Detour module will be made by the end of GSoC as promised. SWIG translator has been great assistance in helping me doing the bindings. Because of it is possible to finish Crowd module, but I don’t promise anything yet. I would like more to make some functions, like to make adequate NavMesh if only Mesh is given etc.

This week, I’ll be studying for my finals, so there probably won’t be anything new done. Now, it begins the coding functions that you will be using for your games, I hope you will give me some advice how to make this project easier to use etc.

2 Likes

Congrats! This is the GSoC project that excites me the most (let’s face it, the current implementation of pathfinding and navmesh baking sucks) + it’s good to see some progress!

Hi cool,

about 3. You could do a Dimension object or a Vector2f instead? Alternativly let you pass a Holder object, with the variables, if you want to stay mostly identicall to the native one.

Btw, the finals are more important, so don’t worry to much for now :slight_smile:

@Empire Phoenix said: Hi cook,

about 3. You could do a Dimension object or a Vector2f instead? Alternativly let you pass a Holder object, with the variables, if you want to stay mostly identicall to the native one.


It can be easily added to API to have that function too. :smiley: That is not the problem. For now code is very similar to native one, as how you should use it, but I think there is no reason to stay like that if we can change it to something more programmer-friendly.

I’ve added arrays for searching through structures. It seems to be working (there isn’t any exception on used example, but I am not completely sure if it is working properly, as the output doesn’t “speak to me”).

I will be working on meaningful example as soon as the finals are over…