View Full Version : Need help with pathfinding script

03-22-2007, 07:31 PM
Hi, I need help creating a pathfinding script in JavaScript for an online game which currently uses keyboard for moving. General concepts for this script should be:

- pathfinding levels (smoother or sharper),
- passable/impassable tiles

If anyone can help I will provide you with the URL of the game. Thanks and waiting for an answer.

03-24-2007, 08:45 AM
So no one knows how to build a pathfinding script? I remember I once found one but I don't remember where. The game is Dawn (http://dawn.butterflymedia.ro), and I need this script to make navigation easier.

03-24-2007, 10:55 AM
I know many people in this forum *could* create a path finding algorithm, but you are asking them to do a big job with little detail and little reward.

Why don't you start it off - write what object you want, where they have to go to, what size blocks to use etc. maybe, just maybe someone would be willing to help (People like to help people who help themselves).

03-24-2007, 11:32 AM
I recommend PHP for this...

03-25-2007, 10:34 AM
Well, actually PHP is not an option as this game does not have PHP server support. It is still a hobby and I know this can be done with JavaScript and DHTML. The game is located at http://dawn.butterflymedia.ro. The block size/tile size in my game is 30px/30px. What other details should I provide?

Thanks in advance.

03-25-2007, 01:18 PM
I recommend PHP for this...
Why would you recommend PHP for this? A server-side language like this cannot do things on the fly (without changing the page).

03-25-2007, 08:08 PM
Check out my attempts. See my signature link for the code.

What do you think? If you want I can tailor it to your needs.

03-26-2007, 12:09 PM
Well, we could work together on this. Remember, it's a hobby project so there's no money in it :)

Let me know what you need, the source, the specifications. And if you agree to work with me on this game, I will put your name on the credits section.

Thanks for your interest.

03-26-2007, 06:32 PM
Right, my original script was crap as it was home made.

I started to implement an algoritm called A* (A Star), but I found a javascript A* algorithm on the web.

Here http://www.devpro.it/javascript_id_137.html

It is probably the one you saw all that time ago. It should be easy enough to implement in the game. You'll just have to give credit to him (Andrea).


03-26-2007, 06:45 PM
Well, thanks for the link. There seems to be only one problem. I might need a "liitle" help implementing it in my page. I have to code the movement for my character along the generated path. Some help would be appreciated. Source code will be provided.

03-26-2007, 10:24 PM
Give me an email or link to the source, tell me what you need and I'll tell you what I can easily do. I am sorry, but I can give limited help as time is sparse. Exams and all that.

From what you ask above it should be quite easy.


03-29-2007, 09:14 AM
Well, the game is written in JavaScript, so there is really easy to "View Source..." of the files, as for the entire source, you can contact me at cip_sb@yahoo.com or Yahoo Messenger.