Topic:   [SC] Pathfinding Algorithm   (Read 10007 times)


0 Members and 1 Guest are viewing this topic.

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: [SC] Pathfinding Algorithm
« Reply #15 on: April 10, 2011, 08:59:32 AM »
i really want to understand this but im haveing a hard time, could you make a quick screencast explaining the key things i need to know like what values do i need to keep track of

how and where is the flood path stored??

i cant condomplate how it processes every path as it branches
« Last Edit: April 10, 2011, 11:16:20 AM by EqwanoX »

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: [SC] Pathfinding Algorithm
« Reply #16 on: April 10, 2011, 11:35:46 AM »
Quote
condomplate
uh...

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: [SC] Pathfinding Algorithm
« Reply #17 on: April 10, 2011, 12:19:53 PM »
Fruedian typo! ;D
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: [SC] Pathfinding Algorithm
« Reply #18 on: April 11, 2011, 10:41:13 AM »
i finally figured it out, this was so hard, i almost went insane. i was able to cut down the coding some, its mostly in one method
updated v2.2: http://cl.ly/0D053o1b0Y1C3q2h1K0D

thanks to warhampster for doing this, i dont know how he did this from scratch!
« Last Edit: April 12, 2011, 08:52:29 AM by EqwanoX »

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: [SC] Pathfinding Algorithm
« Reply #19 on: April 11, 2011, 01:18:49 PM »
Hey sorry I didn't help you out with that, yesterday was my birthday and I haven't been online all weekend. Really really good job on the rewrite, my code was a huge mess and relied on ancient pieces of my tile engine.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: [SC] Pathfinding Algorithm
« Reply #20 on: April 11, 2011, 04:53:26 PM »
It's still a little buggy, try going to that one place in the bottom right side as close to the middle as possible. Then, try going to over to the left. The guy just goes one space back, and stops. But that's still an amazing program.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: [SC] Pathfinding Algorithm
« Reply #21 on: April 12, 2011, 08:52:11 AM »
whoops, fixed. the FOR loop for step goes from 1 to 30 and the path is 33 steps, i changed it to 40, but i should just make it 100 sinse it exits the loop anyway, just a note in case someone uses a larger map, they may have to increase that later
« Last Edit: April 12, 2011, 08:54:17 AM by EqwanoX »

x


  • GMG-er

  • **


  • Posts: 247
Re: [SC] Pathfinding Algorithm
« Reply #22 on: April 12, 2011, 06:42:10 PM »
What order of complexity is this algorithm. Is it viable for big maps?
« Last Edit: April 12, 2011, 06:46:08 PM by x »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: [SC] Pathfinding Algorithm
« Reply #23 on: April 12, 2011, 07:23:22 PM »
:O This is fantastic! There's no lag of any kind, super fast. Whatever you did, it's amazing!

Edit: Even though it's very fast, I found a few bugs.
Here's the buggy source:
Sc Pathfinding Source with Buggy Map
Video of Bugs in Action!
« Last Edit: April 12, 2011, 07:55:31 PM by Gandolf »

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: [SC] Pathfinding Algorithm
« Reply #24 on: April 12, 2011, 09:12:54 PM »
thats the same bug, just change the step FOR loop to 100 instead of 33, its line 19 in the findpath method, it wont make it any slower sinse it exits the FOR loop when it reaches the destination

FOR step=1 to 100

Quote
the FOR loop for step goes from 1 to 30 and the path is 33 steps, i changed it to 40, but i should just make it 100 sinse it exits the loop anyway, just a note in case someone uses a larger map, they may have to increase that later



those building destruction videos are so amusing
« Last Edit: April 12, 2011, 09:16:02 PM by EqwanoX »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: [SC] Pathfinding Algorithm
« Reply #25 on: April 12, 2011, 09:24:26 PM »
That fixed it!  :D Man this is some great stuff. I'm gonna have to use this sometime for something.

Quote
those building destruction videos are so amusing
Why thank yee! I think I'll make a post about them.