Skip to content

Pathfinding and movement cleanup - #161

Open
ImAlko wants to merge 30 commits into
Open-Source-Free-Realms:mainfrom
ImAlko:movement-cleanup
Open

ImAlko wants to merge 30 commits into
Open-Source-Free-Realms:mainfrom
ImAlko:movement-cleanup

Conversation

@ImAlko

@ImAlko ImAlko commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

ABSOLUTELY DO NOT MERGE UNTIL THE ROUTINES PR HAS BEEN APPROVED

This PR cleans up pathfinding and path following. It includes:

  1. A new Pathfinder class used for pathfinding on navmeshes and checking valid points on the navmesh
  2. A new PathFollower class which follows a set of waypoints
  3. Makes use of the Routine structure to kick off movement routines that run on the tick thread. This includes a low-frequency pathfinding call and high-frequency path following call
  4. Hooks for the Npc and client path requests

Future work will ensure thread safety, scripted NPC behaviors and cleanup of entity classes.

…so tests can use it as a sort of mock and properly run

// TODO: This is a temporary "hacky" fix for marshalling logic to the tick thread. This needs to be changed
// to a proper marshalling system.
player.Routines.SetRoutine($"ClientPath{clientPathRequestPacket.Type}", () =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If two requests of the same type arrive within one tick, the second replaces the first, so the first Id never gets a reply. Do you know whether the client waits on that reply?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants