Path Finder - WASM module for path finding

Github repo with sources

It contains implementation of path finding algorithm on Python and on AssemblyScript. Algorithm is based on JavaScript addon for Three.JS Three Pathfinding All main ideas are the same, but there are some difference in details.


  1. Small size. Compiled WASM module is only 46 kb. As other WASM module, It also requires loader. Default AssemblyScript loader is 18 kb.
  2. Open source. For understanding algorithm it will be better to study Python implementation, because it’s more structural.


  1. Does not generate navigation mesh. This mesh should be prepared in any other external application. Module accept only polygonal description of the navigation mesh: vertex coordinates and vertex indexes of polygon corners.
  2. Works only with static navigation mesh. No dynamic obstacles, agent avoidance or something similar.

Short tutorial, which demonstrate, how to use the module is here

Example application is here


Hi @Shekn and welcome!

That looks super nice, and it performs quite well. Happy to see a Python to WebAssembly build running so good, many thanks for sharing.

Very useful! Thank you!

Ohh I’ve been looking for something like this for a while! thanks for sharing!!

I am trying to replicate the proyect with a simple 2 tris mesh and I just can’t make it :S
How do I get the right data structure for a custom mesh? I mean the .txt file.


EDIT: Oh wait I got it working! I wasn’t assigning the vertex index correctly in the polys array

Update of the module. Source files and descriptions are in the repository:
Also the repository contains builded wasm-file.

What’s new:

  1. Port RVO2 collision avoidance algorithm into AssemblyScript.
  2. Integrate this algorithm with old path finding algorithm in the navigation mesh. The result is complex PathFinder object, which can simulate agent movements to destination points in navigation mesh.
  3. Example application, which demonstrate some basic functionality of the module. This is the link to the project: PlayCanvas 3D HTML5 Game Engine