Customizable Path Maker
In this project, I delved into the intricate mechanics of pathfinding for non-playable characters (NPCs) using positional navigation techniques. The core of this system lies in its flexibility and adaptability, allowing for a wide range of path shapes and durations. NPCs can be programmed to follow paths of varying geometries, such as linear, circular, or more complex patterns, and the time it takes for an NPC to complete a path can be precisely controlled in seconds.


One of the key aspects of this project is the dynamic nature of path configuration. Path points are initially defined in a JSON file, providing a structured and easily modifiable format. The intention is to eventually integrate this system with an API, allowing for real-time path adjustments. This functionality means that the shape and trajectory of an NPC’s path can be altered on the fly, directly from the backend, offering a high degree of control and customization.
To illustrate, consider an example of a JSON configuration for a triangular path:
In this example, the pathType key denotes the shape of the path, in this case, a triangle. The points array defines the vertices of the triangle with x and y coordinates, and duration specifies the time in seconds for the NPC to complete the path. This format provides a clear and intuitive way to design and implement NPC movement patterns, greatly enhancing the dynamism and interactivity of the game environment.

