A* Pathfinder Routine
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 24
- Joined: Tue Jun 23, 2009 9:38 am
A* Pathfinder Routine
anyone ever had a go at it in this language? I've got a pretty good handle on what's got to happen in it. I'm just mustering up the strength to actually code it. It's going to take a sustained period of concentration if you know what I mean.
Anyone done it already and want to share their take?
Heyyy. Merry xmas from Australia. Just turned 12am
El Stupido
Anyone done it already and want to share their take?
Heyyy. Merry xmas from Australia. Just turned 12am
El Stupido
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
Re: A* Pathfinder Routine
I have done 3 versions up to now. Why do you want to make one?
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
-
- Posts: 24
- Joined: Tue Jun 23, 2009 9:38 am
Re: A* Pathfinder Routine
To get to the other side.BvG wrote:Why do you want to make one?
ha ha.
I have a 12 by 12 grid and I want NPCs and PCs to be able to move thru the maze.
making a hobby game.
-
- Posts: 24
- Joined: Tue Jun 23, 2009 9:38 am
Re: A* Pathfinder Routine
oh come on now, don't be shy, tell me more about these '3' versions you've done up to now.BvG wrote:I have done 3 versions up to now. Why do you want to make one?
even better: share one
Re: A* Pathfinder Routine
Oh... come on, don't be shy, tell us why you want one
Probably, if you tell us why, BvG can decide better which version to share with you.
Mark
Probably, if you tell us why, BvG can decide better which version to share with you.
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 24
- Joined: Tue Jun 23, 2009 9:38 am
Re: A* Pathfinder Routine
hello mark, happy new year. Hey I thought I had said why I wanted one when I said I'm making a hobby game with a 12 by 12 grid and I want NPCs to move thru the maze.
as to the why I was hoping someone would share. I just want to learn how to do one. As I said, I am mustering up the courage to take it on. For my level of programming skill and experience, getting A* work is essentially my K2 (the mountain).
So the why I guess is me reaching out going "say, anyone got any tips? and or code they've done."
I am writing the hobby game for my little brother and I. game has an audience of one.
I'm intrigued by how someone else has done three of them, as I find the task of making one daunting
as to the why I was hoping someone would share. I just want to learn how to do one. As I said, I am mustering up the courage to take it on. For my level of programming skill and experience, getting A* work is essentially my K2 (the mountain).
So the why I guess is me reaching out going "say, anyone got any tips? and or code they've done."
I am writing the hobby game for my little brother and I. game has an audience of one.
I'm intrigued by how someone else has done three of them, as I find the task of making one daunting
Re: A* Pathfinder Routine
After a while of putting it off i tried it. im using a 5px grid. I DEFINITELY need to optimize. click on run it and wait.. and wait.. and wait.,
http://www.elfpro3d.com/livecode/MazeRunner.zip
http://www.elfpro3d.com/livecode/MazeRunner.zip
-
- VIP Livecode Opensource Backer
- Posts: 9833
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: A* Pathfinder Routine
Da_Elf, I was hoping I might try my hand at optimizing that, but it's a standalone. Are you in a position to share the source?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: A* Pathfinder Routine
mine is currently using a grid of rectangles that are built and each graphic is used in the calculations. i need to change it to use pixel locations as nodes in the openSet and closedSet
Re: A* Pathfinder Routine
Here is my original code. Really sucky. Im going to try to give this another go but rather than setting up a predone grid i want to get pixel points on the fly. i used to use a program called Adventure game studio. You would create am image which would be called the "walkable area" it wouldnt show up in the final but it would be used to calculate the walkable and non-walkable area for pathfinding. If i used a black and white image as my walkable image and i was testing pixels to see if its black or white i could do the same as the grid but quicker since i would only be testing the neighbouring pixels on the fly as needed as opposed to at the start with a full grid of everything
dont know if any of that made sense,
dont know if any of that made sense,
- Attachments
-
- A Star Test2.zip
- (14.26 KiB) Downloaded 181 times
Re: A* Pathfinder Routine
my latest version rather than build a grid for an entire place to see whats walkable and whats not im going to just build nodes as i work my way through.