How to path around blocked tiles with jumper?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How to path around blocked tiles with jumper?
I'm using jumper for pathfinding and was wondering how to get the algorithm to take into account tiles blocked by enemies and other objects when finding a path.
Re: How to path around blocked tiles with jumper?
I figured out this problem by myself but I have another another question. How do I write a walkable tile function for jumper?
Re: How to path around blocked tiles with jumper?
Are you referring to Yonaba's Jumper? https://github.com/Yonaba/Jumper
Stating which library you are using would be helpful.
You need to create and provide a callback function that will return simple 0 (wall)/1 (path) based on walkability, e.g.:
then follow example as shown on Github:
Stating which library you are using would be helpful.
You need to create and provide a callback function that will return simple 0 (wall)/1 (path) based on walkability, e.g.:
Code: Select all
function isWalkable(sector)
if sector=='path' then
return true
else
return false
end
end
Code: Select all
grid_object = Grid(your_grid, true)
finder = Pathfinder(grid_object, 'JPS', isWalkable)
path = finder:setMode('ORTHOGONAL'):getPath(start_y, start_x, end_y, end_x)
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: How to path around blocked tiles with jumper?
Hey, Brah, check this out: https://ambience.sk/simple-pathfinding- ... -lua-love/
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: How to path around blocked tiles with jumper?
I think I have an older version of jumper because I don't have THETASTAR and my getPath coordinates are X,Y...
Do you have any stuff on weighted grids and movement costs?
Do you have any stuff on weighted grids and movement costs?
Re: How to path around blocked tiles with jumper?
Check this:
https://github.com/Yonaba/Jumper/tree/m ... per/search
and maybe update your code to this version.
https://github.com/Yonaba/Jumper/tree/m ... per/search
and maybe update your code to this version.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: How to path around blocked tiles with jumper?
I tried using that version of Jumper and it causes my games to crash.dusoft wrote: ↑Wed Jan 03, 2024 9:54 am Check this:
https://github.com/Yonaba/Jumper/tree/m ... per/search
and maybe update your code to this version.
Whatever works I just need some psuedo code or an example
Re: How to path around blocked tiles with jumper?
Not sure if it was really Dijkstra, maybe something like that.Brah wrote: ↑Wed Jan 03, 2024 10:24 amI tried using that version of Jumper and it causes my games to crash.dusoft wrote: ↑Wed Jan 03, 2024 9:54 am Check this:
https://github.com/Yonaba/Jumper/tree/m ... per/search
and maybe update your code to this version.
Whatever works I just need some psuedo code or an example
viewtopic.php?t=91167
Who is online
Users browsing this forum: Bing [Bot] and 10 guests