Java version of the A* pathfinding library

We are doing a RTS game with authorative server which will perform pathfinding for NPCs. I’m really interested in this package which show me an amazing result. And it’s working with Unity, that’s what we are working with right now. But I’m also wondering if this library has Java version since our authorative server is written in Java (SmartFox Server). I only tried the A* pathfinding free version. I also want to know that if the navigation mesh graph performance is good enough with almost 100 agents on iPad 2? (the navigation mesh example in free version only has one agent…, and our game also support off-line mode)
BTW: if there is no java version, can we have all of the source code after we buy the pro version? (we may consider about port it to java)

Hi

No, there is no java version. This package is mainly Unity oriented, but not strictly bound to it. So it is possible to run in on e.g a Photon server with some tweaking.
I have not run this on an iPad, but I know navigation meshes are really fast. It really depends a huge lot on how the graph looks and how often they repath, but I would say that you could probably get that running.

The pro version includes all source code.

PS: Just duplicate the agent in the example scenes and you get more agents! However the agents in the example scenes are meant to be for e.g a player character or for a few AIs, not for many units. Then you would need more optimized movement scripts.

PPS: Do not try to use Character Controllers, they are really slow.

About source code: actually it also contains some .net dlls (3rd party libraries) for which the source is not supplied. However if you need it, just send me an email. The source for them is actually hosted on GIT.

Our game is not purely 2D, the terrain has height information. If we cannot use character controller, what else do you suggest us to use? (update the transform directly?). Our process is different from the demo in free version. Server will compute character’s position by using A* path and send it to client, collison will be avoided too. Unity client will use Character Controller to move the character(Server only send x,z to client. the height will be controlled by Character Controller). Do you think that is ok?

Since you want to have 100 agents, in my experience, what works best is usually just transform set position and a raycast to get the height. This will not avoid collisions between units like the CharacterController does, so depending on the game this might be problem. But I guarantee you that it is a huge lot faster.

Thanks a lot for your reply.
There is another question: I saw that Pro version support recast navigation mesh. Is the recast library compiled in native C++ or C#?

It supports both C++ and a translated C# version. The C++ option only works for osx (and linux now I guess) however. It is also slightly buggy in some cases. The C# option works best and is more portable.

I bought the pro version and doing the porting to java now. I want to generate Recast graph in Unity and save it in binary format then loading in Java server and use it. Do you have any suggestion that what kind of features/classes/methods can be skipped when doing the porting?

Like the scanning method in AStarPath, is that necessary at runtime?. (I also wan to disable the multi-thread feature in path finding since the server needs to hold a big amount of online players at the same time)

I don’t really recommend porting the project to java. It is a huge project (16000+ lines), and it uses some C# stuff which is not easily implemented in java (structs, generics which are not broken etc.). If you want a java pathfinder, find a java pathfinder, don’t try to port a huge pathfinding system written in another language and also customized for a specific engine since that is going to take a very long time and you will probably not end up with the solution you wanted anyway. Other java pathfinders could load the navmesh generated by the A* Pathfinding Project since navmeshes can be exported to .obj (hm, not sure if that feature is in the latest release actually, but it will be in 3.2 in any case).

Hello. I’m new in this project, just recently bought that pro package and I’m wondering if someone already ported it to Java or can point me a direction of project which will be able to read Graphs generated by this solution.

Aron, can You send me the link to dll sources, I bet I’ll have to migrate them to java as well.