And... I'm very happy with the results!
https://dl.dropboxusercontent.com/u/556 ... star2.html
Now I understand the A* algorithm!
So I experimented with pathfinding
So I experimented with pathfinding
This message has been brought to you by wtg62, duh!
- testtubegames
- Site Admin
- Posts: 1148
- Joined: Mon Nov 19, 2012 7:54 pm
Re: So I experimented with pathfinding
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.
Re: So I experimented with pathfinding
Thanks!
I'm a fan of using Math.random() as a heuristic.
Not because it's efficient, but it looks cool.
I'm a fan of using Math.random() as a heuristic.
Not because it's efficient, but it looks cool.
This message has been brought to you by wtg62, duh!
- testtubegames
- Site Admin
- Posts: 1148
- Joined: Mon Nov 19, 2012 7:54 pm
Re: So I experimented with pathfinding
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."
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."
Re: So I experimented with pathfinding
Yeah, and I learned that a whole lot of times, Manhattan and Actual are very similar in move cost!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."
Pretty cool, huh?
This message has been brought to you by wtg62, duh!