Page 1 of 1

A* Pathfinder Routine

Posted: Wed Dec 23, 2009 2:08 pm
by el_stupido
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 :P

El Stupido

Re: A* Pathfinder Routine

Posted: Wed Dec 23, 2009 11:15 pm
by BvG
I have done 3 versions up to now. Why do you want to make one?

Re: A* Pathfinder Routine

Posted: Tue Dec 29, 2009 10:00 am
by el_stupido
BvG wrote:Why do you want to make one?
To get to the other side.

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.

Re: A* Pathfinder Routine

Posted: Thu Dec 31, 2009 2:19 am
by el_stupido
BvG wrote:I have done 3 versions up to now. Why do you want to make one?
oh come on now, don't be shy, tell me more about these '3' versions you've done up to now.

even better: share one
:)

Re: A* Pathfinder Routine

Posted: Thu Dec 31, 2009 3:09 am
by Mark
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

Re: A* Pathfinder Routine

Posted: Fri Jan 01, 2010 12:49 pm
by el_stupido
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

:oops:

Re: A* Pathfinder Routine

Posted: Wed Jul 20, 2016 11:15 pm
by Da_Elf
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

Re: A* Pathfinder Routine

Posted: Thu Jul 21, 2016 1:03 am
by FourthWorld
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?

Re: A* Pathfinder Routine

Posted: Thu Jul 21, 2016 1:08 am
by Da_Elf
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

Posted: Fri Oct 13, 2017 1:20 am
by Da_Elf
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,

Re: A* Pathfinder Routine

Posted: Fri Oct 13, 2017 9:37 pm
by Da_Elf
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.