So I experimented with pathfinding

A spot for all things TestTube
Post Reply
User avatar
wtg62
Posts: 174
Joined: Mon Jan 27, 2014 11:30 pm
Location: Texas, United States

So I experimented with pathfinding

Post by wtg62 »

And... I'm very happy with the results!
https://dl.dropboxusercontent.com/u/556 ... star2.html

Now I understand the A* algorithm!
This message has been brought to you by wtg62, duh!
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: So I experimented with pathfinding

Post by testtubegames »

Nice! That works great. I'm especially a fan of the 'go to mouse' setting. It's like I'm being chased by someone unrelenting.
User avatar
wtg62
Posts: 174
Joined: Mon Jan 27, 2014 11:30 pm
Location: Texas, United States

Re: So I experimented with pathfinding

Post by wtg62 »

Thanks!

I'm a fan of using Math.random() as a heuristic. :P
Not because it's efficient, but it looks cool.
This message has been brought to you by wtg62, duh!
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: So I experimented with pathfinding

Post by testtubegames »

Whoa - thanks for pointing me in the direction of Math.random(). I wasn't too familiar with pathfinding - and it sent me down the rabbit-hole of reading about heuristics. (For instance, at first I was expecting this to be a random walk, which clearly it wasn't... quite.)

Interesting stuff. And I like how your tool helps me investigate the differences really easily. aka: "Huh, would Manhattan vs. Actual Distance be all that different? Let me run it and find the distance each takes."
User avatar
wtg62
Posts: 174
Joined: Mon Jan 27, 2014 11:30 pm
Location: Texas, United States

Re: So I experimented with pathfinding

Post by wtg62 »

testtubegames wrote:Interesting stuff. And I like how your tool helps me investigate the differences really easily. aka: "Huh, would Manhattan vs. Actual Distance be all that different? Let me run it and find the distance each takes."
Yeah, and I learned that a whole lot of times, Manhattan and Actual are very similar in move cost!
Pretty cool, huh? :P
This message has been brought to you by wtg62, duh!
Post Reply