Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Path Finding Method??


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Benjamin   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 April 2000 - 10:42 PM

Is there any simple method to do Path Finding? Thanks.

Sponsor:

#2 Big Al   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 April 2000 - 11:02 PM

Any Pathfinding is complex, however it varies in complexity from doing a simple 2d game, where we just move the computer''s pixel toward the player''s pixel. However when we get to more complex scenarios it can often come down to very very complex coding.

Much of my work in my game that I''ve been writing, involves a tree structure that is made up of all the possible routes, then I run another function and it get''s rid of all the inefficient paths, then another one sees how many units are moving to the location and breaks them up so as to move without having units clog up paths. This presents a problem however if the user wants them to stay together.

So all in all, there is no simple method, however if you post more details on what you would like your path-finding to do, I''m sure someone will give you some example code or at least explain the method.

My PathFinding algorithm takes about 2500 lines of code, but it is extremely complex, but slightly sluggish.

BTW: mine is being developed for a RTS where there are terrain blockages, trees and other obstacles to avoid.

I wish you luck.
-Alan

#3 ZoomBoy   Members   -  Reputation: 162

Like
Likes
Like

Posted 16 April 2000 - 12:35 AM

The simplest method is object search-around(I think there''s a better name than that - maybe edge-searching). You''ve generated a path( a series of lines or points) and you''ve figured out there''s a collision(you need a collision detection routine done up before anything). Figure out what object it is and keep that handy. Find the next point on your list that is not in collision and what you''re going to do is insert a few points that aren''t in collision with the blocking object. Place a point outside of the blocking object and then test the path again for collisions.
This method is a reasonable approximation if you''ve got wide open spaces with solitary objects hanging about and No thin walls.

Earlier there was
a long discussion on the GameDev of a more complex method that is preferred for more complex situations- A-Star path-finding. It has some links to path-finding discussions.

It really depends on what space you have and what you''re trying to do.

ZoomBoy
A 2D RPG with skills, weapons, and adventure.
See my character editor, Tile editor and diary at
Check out my web-site


#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 16 April 2000 - 01:17 AM

A*.

-goltrpoat



#5 ZoomBoy   Members   -  Reputation: 162

Like
Likes
Like

Posted 16 April 2000 - 07:41 AM

A* or whatever

ZoomBoy
A 2D RPG with skills, weapons, and adventure.
See my character editor, Tile editor and diary at
Check out my web-site





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS