View Full Version: Lassie Pathfinding (at least it sort of works...)

lassie >>Discussions >>Lassie Pathfinding (at least it sort of works...)


<< Prev | Next >>

bigmac- 08-14-2007
Lassie Pathfinding (at least it sort of works...)
Well folks, I've been looking at the Lassie pathfinder algorithm recently as I've been cleaning it up for it's implementation within Shepherd... I wrote that program a little over three years ago based on a simple explanation of A* described in a web article titled "A Beginner's Guide to Pathfinding Algorithms" (and yes, a friend who'd seen me reading it thought I was nuts). Anyway, I've been going through the logic up and have found some ridiculous errors where I was comparing the wrong things while assessing paths. While some comparisons came out correctly by luck, there are others where the optimal path is thrown out in favor of a round-about route. So, for those of you who've observed their character walking all the way across the screen and back, this is almost certainly the reason... and my apologies for that! But in my own defense, the logic has done a pretty darn good job for us these past years considering I didn't fully understand what I was doing while writing it!

bigmac- 08-14-2007

And for those of you who have long been confused and frustrated over how Lassie walkable areas work... check back later tonight. I've finally got something that is going to make it all clear =)

SeanCyrusTowel- 08-14-2007
Re: Lassie Pathfinding (at least it sort of works...)
(and yes, a friend who'd seen me reading it thought I was nuts). that wasn't me was it? I remember seeing the article....but I don't remember if I thought you were nuts.... I remember not really wanting to read it myself though ;-)

bigmac- 08-15-2007

Nope, that would be good ol' Joe from Mexico (the normal one of that crowd). We sat together on our flight up to San Diego during which I read that article twice to understand it. He glanced over at the article title and gave me a wide-eyed stare to stop traffic.

bigmac- 08-15-2007

Folks: it is explained. "Walkable Areas for Dummies" has been posted on the Shepherd workshop site with a really cool interactive widget that will let you -*test*-('") paths across a box grid. Finally understand Lassie's walkable area model at: http://lassie.gmacwill.com/shepherd/pathfinder.htm So, the next time someone asks about walk boxes, point them to WAD. I give it two day until the question comes up again ;-)

Matt Kempke- 08-15-2007

Really Cool! Really great! But in my own defense, the logic has done a pretty darn good job for us these past years considering I didn't fully understand what I was doing while writing it! True! And now I know that especially one "mistake" was not my fault ... but it's happening so seldom that noone should have realized that it happens at all - i added a lot of walking points to prevent it ... Remember the pier in WMYT? Well, if you let Nathan go to the lighthouse side he might take a shortcut from the beach over the water directly to the far end of the pier. as you might imagine that was really giving me a headache :) PS: I have a lot of stuff to do right now. BUT there's a new project in my head (The first one gamewise since i finished WMYT... I feel like it's happening again!). BUT I'll just tell you in person in the middle of nowhere. It's TOP secret.... :D

ElDodo- 08-15-2007

Ugh, pathfinding is a pain the @$$. I once wrote an "adventure game" library for GameMaker and had a hard time implementing some rather clumsy A* methods (before these were natively included in GM). I really like the way pathfinding works in Lassie, you can really see what you're doing; in AGS room walkable areas are obscenely easy to setup, but I'm told these can be quite buggy in some situations.

bigmac- 08-15-2007

Remember the pier in WMYT? Well, if you let Nathan go to the lighthouse side he might take a shortcut from the beach over the water directly to the far end of the pier. as you might imagine that was really giving me a headache :) This is almost certainly a result of the "guesser" method that ties points into the walkable grid via the nearest grid point (when no box is available to reference). And that is not a bug. The pathfinder has always produced valid paths, they just aren't always been the shor-*test*-('") or most direct routes.

Matt Kempke- 08-17-2007

oh, ok :) by adding a couple of w-points i think i solved it. but did you ever realize that theres a point/bullet limit? (at least in director) ... after a certain number of interaction/walking bullets it will make one big bullet and and stop adding them ... of course there's a limit ... but i think i encountered that phenemonen 3 times. then you need to think about what you can leave out ... that's why adding the walking points was not that easy in that case. But i thing that's not a bug - more a director limitation.

bigmac- 08-17-2007

Erm, yeah, you noticed that did you? Another crappy feature of Director: you have limited stage channels. I think I was running with 150 channels in Lassie. That means 150 sprites on screen at once. The only problem in the walkable are editor is that is has to build your entire room, then add some misc. utility elements onto stage, draw out your boxes... then whatever is left of your 150 channels you had to work with for walkable elements... So, some rooms where you only have three sprites you'd have about 130 channels available for walkable area configuration. other rooms with 100 sprites would only have about 25 or 30. These are all reasons that I'm building Shepherd. That Lassie editor is absolute crap and I'll admit it!

Matt Kempke- 08-17-2007

That might be a little harsh, Greg :) For me it was great enough, believe me ... Of course I can't wait to use AS!

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.