Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deterministic? #30

Closed
piller187 opened this issue Jan 14, 2020 · 2 comments
Closed

Deterministic? #30

piller187 opened this issue Jan 14, 2020 · 2 comments

Comments

@piller187
Copy link

Is this pathfinding library deterministic? I'm making a multiplayer game and I run this both on the client (for instant response feel) and server (to validate). My plan is to pass the starting row/col and the path that the client instance of this pathfinding found to the server and have the server use the same starting row/col and the map itself (which should be the exact same on both client/server) and run to get the path and compare it against the path the client send to make sure it 100% matches, but just curious given the map is setup and same starting row/col will I get the exact same path on the server that the client code came up with?

I don't just use the client path because I have to check for cheating (this is really the only reason for doing this check on the server) and the exact path is important as things along the path can cause harm.

@bradzoob
Copy link

Yep, I use the weighted search for rivers/roads in a procedural world that has to be deterministic. As long as your inputs are deterministic the outputs should be. At least I haven't noticed it deviating over the years I've been using it.

@roy-t
Copy link
Owner

roy-t commented Jan 15, 2020

Hey piller187, as @bradzoob said the A* algorithm (and this library) are completely deterministic. No randoms involved :)

@roy-t roy-t closed this as completed Jan 15, 2020
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

No branches or pull requests

3 participants