Recast + Colyseus + Babylon.JS - agent position update problem

107 views
Skip to first unread message

mengu gulmen

unread,
Jan 31, 2023, 8:46:14 AM1/31/23
to recastnavigation
Hi everyone,

I'm trying to create a multiplayer point & click game using recast, colyseus and babylon.js and running into a problem:

Navmesh works fine in single player, the player moves and avoids obstacles. 
When a new player arrives, everything works fine before the other player moves.
But after the new player moves, its position on the navmesh is not updated in the remote client, and the other player avoids not the actual player mesh, but the position where the mesh was when it was instantiated.

I probably have to update the navmesh when the player's position changes, but couldn't find a way to do so.

Any pointers?

Cheers
Mengü

Graham Pentheny

unread,
Mar 15, 2023, 10:32:24 PM3/15/23
to recastnavigation
Hi,
  Firstly this seems like an issue with multiplayer state replication in your game, not anything related to Recast.  Secondly it sounds like you're implementing player to player avoidance by creating nav mesh obstacles.  This will work but is quite expensive and finicky.  You should use navmesh navigation for high-level pathfinding and then either use Detour or bespoke systems for moving the character and avoiding other characters and temporary obstacles.

Hope that helps,
Graham

Reply all
Reply to author
Forward
0 new messages