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

Differing paths for different directions #2

Closed
bjrnt opened this issue Nov 17, 2022 · 2 comments
Closed

Differing paths for different directions #2

bjrnt opened this issue Nov 17, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@bjrnt
Copy link

bjrnt commented Nov 17, 2022

Hello!

I'm very new to Rust and game development and this crate seemed like a good way to get started. I am however running into issues as the paths generated by the library are different when going in different directions.

As an example:

Computing path from Point { x: 14, y: 10 } to Point { x: 14, y: 25 }
Found Some(461v0) at Point { x: 14, y: 11 }
Found Some(462v0) at Point { x: 14, y: 12 }
Found Some(463v0) at Point { x: 14, y: 13 }
Found Some(464v0) at Point { x: 14, y: 14 }
Found Some(465v0) at Point { x: 14, y: 15 }
Found Some(498v0) at Point { x: 15, y: 16 }
Found Some(499v0) at Point { x: 15, y: 17 }
Found Some(500v0) at Point { x: 15, y: 18 }
Found Some(501v0) at Point { x: 15, y: 19 }
Found Some(502v0) at Point { x: 15, y: 20 }
Found Some(503v0) at Point { x: 15, y: 21 }
Found Some(504v0) at Point { x: 15, y: 22 }
Found Some(505v0) at Point { x: 15, y: 23 }
Found Some(506v0) at Point { x: 15, y: 24 }
Computing path from Point { x: 14, y: 25 } to Point { x: 14, y: 10 }
Found Some(506v0) at Point { x: 15, y: 24 }
Found Some(505v0) at Point { x: 15, y: 23 }
Found Some(504v0) at Point { x: 15, y: 22 }
Found Some(503v0) at Point { x: 15, y: 21 }
Found Some(502v0) at Point { x: 15, y: 20 }
Found Some(501v0) at Point { x: 15, y: 19 }
Found Some(500v0) at Point { x: 15, y: 18 }
Found Some(467v0) at Point { x: 14, y: 17 }
Found Some(434v0) at Point { x: 13, y: 16 }
Found Some(433v0) at Point { x: 13, y: 15 }
Found Some(432v0) at Point { x: 13, y: 14 }
Found Some(431v0) at Point { x: 13, y: 13 }
Found Some(398v0) at Point { x: 12, y: 12 }
Found Some(397v0) at Point { x: 12, y: 11 }
Found Some(396v0) at Point { x: 12, y: 10 }
Found Some(427v0) at Point { x: 13, y: 9 }

Here are two images displaying the different paths. As you can see, one of them is pretty strange. Just thought I'd let you know.

Thanks!

Screen Shot 2022-11-16 at 5 34 38 PM

Screen Shot 2022-11-16 at 5 34 45 PM

@tbvanderwoude
Copy link
Owner

Thank you for bringing this to attention, would you mind sharing code using which this can be reproduced (via email perhaps)? Then I can get to the bottom of why it's generating suboptimal paths

@tbvanderwoude tbvanderwoude added the bug Something isn't working label Apr 12, 2024
@tbvanderwoude
Copy link
Owner

This turned out to be related to the problem fixed in commit 16c47b0. Improved pruning was generating nodes without adding the base cost of the pruned node. The fix will be included in version v0.2.0 as well as v0.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants