Pathfinding from Isometric Book ported to Flash5

Started by
1 comment, last by sermad 22 years, 12 months ago
yo guys! I bought Ernest''s excellent book yesterday and saw that the pathfinding code would port to Flash 5 very easily. As I''m a Flash programmer by job nature I doth my cap and am proud to say it ported with about 1 line of code needing changing! so check out - http://www.pointsinspace.com/pathfinding/ I would really love to change 2 things - Firstly if you have 2 points in say a vertical line, the path to them may not be a perfect straight line as the code picks from 3 tiles at random. Would it be possible to weight this randomness to pick the tile in the direct path over the other 2. Just this zig zagging is very noticeable in a 2d overhead view (dont ask why its not isometric!) secondly. Flash is very very slow compared to C++ or java so could anyone help optimise the getpath()function just that little bit more to squeeze some more speed out of it! again congrats ernest to the book. without it i would be very stuck. sermad www.scooterdeath.com
www.scooterdeath.com
Advertisement
hey, i''m glad you found a use for the pathfinding code outside of the scope of the book.

Just keep in mind that my pathfinding code was rather... primitive. It''ll do the job, sure, but the path isn''t guaranteed to be smooth.

i remember seeing an article in Game Developer a few months back that had tips on how to smooth out A* pathfinding. You might want to look at it. I can''t remember which issue.

-ESPazera

Get off my lawn!

It''s the April issue with a picture of Alice in wonderland on the cover

This topic is closed to new replies.

Advertisement