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

Is it possible to avoid getting too close to a non walkable cell ? #47

Open
awddawawd opened this issue Aug 19, 2023 · 2 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@awddawawd
Copy link

awddawawd commented Aug 19, 2023

Hi,
I'm trying to create a path finding method for the game brawlstars and I was wondering if it could be possible to find a path that does take a little longer route but avoid touch a neighbor cell that is non walkable. This would be helpful for my project since in brawlstars, there's some kind of "auto adjustment" when you go straight to a wall that makes the player move a little in order to avoid getting hit, but this feature is quite annoying for a bot and can make it loose the track of the player.

For example this :

large_path

instead of the current that is :

narrow_path

@awddawawd awddawawd changed the title Is it possible to avoid getting to close to a non walkable cell ? Is it possible to avoid getting to close too a non walkable cell ? Aug 19, 2023
@awddawawd awddawawd changed the title Is it possible to avoid getting to close too a non walkable cell ? Is it possible to avoid getting too close to a non walkable cell ? Aug 19, 2023
@brean
Copy link
Owner

brean commented Aug 20, 2023

Yes, you can use the already implemented weighted-grid feature of python-patfinding.
You just need to change your map to get higher cost values around your obstacles with increasing proximity.
I don't have an example for this, also there is no implementation of it yet, but you could probably copy the concept of costmaps from ROS: http://wiki.ros.org/costmap_2d/hydro/inflation
I could help you with an implementation if you have problems but I encourage you to try yourself first.
Feel free to provide a PR, ideally with a bigger map for testing, a costmap generation algorithm, unit-tests and documentation in markdown for python-pathfinding.

@brean
Copy link
Owner

brean commented Aug 20, 2023

Also extending python-pathfinding with a Theta*-implementation would be awesome, I think that would best work for you as well.
(see https://news.movel.ai/theta-star and #3 )

@brean brean added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
Status: No status
Development

No branches or pull requests

2 participants