Hardest parts in my project was synchronization between client -> socket server -> AI server :).
I trying with pathfinding, but perfomance was too bad to use it in game :).
Hardest parts in my project was synchronization between client -> socket server -> AI server :).
I trying with pathfinding, but perfomance was too bad to use it in game :).
I am using PathFinding and it is working fine for me. Have you checked this library GitHub - wanadev/babylon-navigation-mesh: A library to move on navigation mesh with BABYLON.js ? I could help setting it up if needed.
Do you know if that library is based on recast-detour? That seems to be the prevailing navmesh library, with a JS fork called recastjs.
I experimented a lot with navmeshes and eventually gave up because of the lack of a good tool for managing the navmeshes. I used blender to make attempts, but it was really frustrating trying to get the meshes perfect. A secondary gripe being that I had to regenerate the navmesh every time I “loaded a zone”, whereas I’d like to just be able to dump the generated mesh data and load the pre-computed data quickly.
Oh, and lastly – it wasn’t even working for large crowds of entities.
For your viewing pleasure, you can see some of the issues I was having:
I don’t have any big scene in my game, so it works correct with navmesh and also i don’t use Y position. Every character have position Y = 0. I experienced a lot of troubles with crowds and avoid collisions by them. This was fight without end…
So i just leave pathfinding to keep very simple character movement based on moveWithCollision, but maybe this topic created by me help You: Constant speed on path3d
The library I posted is not based on Recast. It uses an astar algorithm for pathfinding and the stupid simple funnel algorithm for string pulling. It is fully javascript based so not a port of anything. You still need to build the navmesh with blender. It is not easy to get it right but I can give you my setup for building it. It works quite fine for me. Not perfect but fine. I have had multiple NPC’s following me and I have had no real issues with it. They all get the same path which is the right one.
EDIT : it does not offer any functionality for crowds. Just so you are aware of it.
Interesting you bring that up because (as the video illustrates) the recastjs library does give me the proper requested path but fails to move agents along the path correctly. One of my last attempts to get it working was to stop using the built-in agent move functions and just compute travel distance * delta and move the agent along the path myself. This brings up a tricky problem worth calling out for anyone else who might be wanting to move agents along a path manually, as doing it improperly will affect the agents speed.
The problem is when there is a series of path nodes in close proximity. Say your entity is moving at a speed of 100, and your time delta is 0.03 (30fps), this means your entity can move 3 units in that frame. What if the next node in the path is 0.5 units away? Originally, I just detected that the next node was “within reach”, placed the entity there, faced it toward the next node, then moved on to the next entity that needed to have it’s movement computed that frame. What happened to the rest of the 2.5 units the entity was allowed to move that frame? Overlooking that led to corners and bends being a large slowdown for moving entities. Ultimately it was solved (just keep moving the entity along its path until its consumable distance is zero), but sadly since I scrapped the navmesh approach it was a bit of wasted effort.
It’s really tempting to revisit navmeshes, but I’ve already put a lot of work into a node-creation system and GUI tools for it.
I’m trying to think of any serious drawbacks to node vs navmesh… I would say dynamic obstacles, but it appears that’s not supported yet in babylon-navigation-mesh.
Dynamic Obstacles are not supported indeed. You would have to code them yourself, I have tried to code it myself but I don’t think it is an easy task. If someone has a suggestion on how it would work let me know, I would gladly have another go and add the functionality.
If you make your game open source I’ll be the first to fund you $100 and I’ll contribute monthly to development and also contribute code. I was thinking of making something similar and I’d MUCH rather help contribute to something that exists.
I think he has already open sourced it. Money would help him to get designs though from what I have understood. This sounds like a nice offer
Well I’ll definitely help finance it.
My game is open source. I decided to do that some time ago. I think money is one problem. We can work together without any dotation, but we need graphics and animators many or one :). Of course I only worked in free time on that project. If You have any, we can make team :).
2 days ago I recievie signal from my slavs heart to visit my game on slavsgame.com… I decided to record my 5 minutes demo from gameplay: YouTube
Maybe return to this project is possible… who knows
Would be so great !!!
This is a beauty.