Pathfinder

Posted By: mr_x

Pathfinder - 10/03/09 12:51

Another A* pathfinder, to use it, you should place "waypoints" in WED around obstacles.
DOWNLOAD

Posted By: Saturnus

Re: Pathfinder - 10/03/09 14:10

Thank you for your contribution, mr_x!
This pathfinder is actually very easy to use and leightweight. : )

Perhaps you might want to add this to the wiki.
Posted By: mr_x

Re: Pathfinder - 10/03/09 14:39

Thanks Kombucha, it is leightweight, only because I don't know how to implement various bit arrays, binary heaps, and other datastructures, like you did in your system laugh So I used only linked lists.
Posted By: Germanunkol

Re: Pathfinder - 10/06/09 17:08

if it works, linked lists are enough...^^
Thanks for contributing! Pathfinding's always useful.
Posted By: VeT

Re: Pathfinder - 10/06/09 23:37

Em... there was another version of A-star... well, i think, this one is more efficient laugh
Posted By: msl_manni

Re: Pathfinder - 10/12/09 04:20

The link is broken. Please give a new link.
Posted By: mr_x

Re: Pathfinder - 10/14/09 17:52

http://www.filedropper.com/pathfinder
Posted By: Espér

Re: Pathfinder - 10/14/09 23:01

Is it possible to add nodes during runtime???
Posted By: mr_x

Re: Pathfinder - 10/15/09 14:02

Yes, it should work, you just need to add new node to the NodeList, and pathfinder will consider this node during path finding.
Posted By: the_mehmaster

Re: Pathfinder - 10/19/09 05:47

This is quite useful, and will assist me greatly in my project.. Thankyou!

I would like to know how I would get this to work with many different entities, at the same time. An RTS-type pathfinding object. Any ideas?
Posted By: mr_x

Re: Pathfinder - 10/19/09 09:44

I'm glad, that it useful. When you call asFindasPath(start, dest)(terrible name for the function :)), founded path is stored in the asPath list, and when you next time call asFindasPath, asPath list erased, so when you want to find path for one of many entities, you should then record founded path somewhere else, in the another list for example or in the array. It would be something like this:
Code:
asList EntityPath;

asPath.itr = asPath.head;
while(asPath.itr != NULL)
{
  asPrepend(EntityPath, asPath.itr);
  asForth(asPath);
}


Posted By: the_mehmaster

Re: Pathfinder - 10/23/09 07:35

Ok.. sounds simple enough. Thanks smile
Posted By: Espér

Re: Pathfinder - 10/23/09 21:08

ok..
i think i´m blind..
so i ask..

Any way to count the nodes, that will be passed to get to the target. if the count is greater than a var.. it cuts the way to the farest node possible with the var?
Posted By: mr_x

Re: Pathfinder - 10/24/09 03:54

List has a "count" variable. "asPath.count" will return number of nodes, that path has. About farest node, if you need farest node from all nodes in the level, you should loop through the asNodeList, if you need farest node from the path list you should loop through asPath list.

Code:
if(asPath.count > var)
{
  asNode* FarestNode;
  var dist;

  asPath.itr = asPath.head;
  dist = vec_dist(start, asPath.itr.pos);
  FarestNode = asPath.itr;
  while(asPath.itr != NULL)
  {
    if(vec_dist(start, asPath.itr.pos) > dist)
    {
      dist = vec_dist(start, asPath.itr.pos);
      FarestNode = asPath.itr;
    }
   asForth(asPath);
  }
}


Posted By: penut

Re: Pathfinder - 10/24/09 06:13

Thank you so much! wink
Posted By: Hummel

Re: Pathfinder - 10/30/09 17:55

I always just get the home: http://www.filedropper.com/ even when I pass the full link in the browser (IE, FF)-perhaps the file isn´t anymore up?
Would be coul if you could give us another link wink
Posted By: mr_x

Re: Pathfinder - 10/30/09 21:58

Here you are:
http://www.zshare.net/download/67719878b58d4621/
Posted By: Hummel

Re: Pathfinder - 10/30/09 22:59

now it works wink
cnacubo xP
Posted By: Espér

Re: Pathfinder - 10/30/09 23:55

i think i´ll use this, when i´m able to get my Dungeon Keeper Code to work ^^
Posted By: Tai

Re: Pathfinder - 12/11/09 02:38

Any advice for implementing string-pulling?
Posted By: mr_x

Re: Pathfinder - 12/11/09 20:57

Sorry, I don't know how algorithm for this technique looks like. Only thing I have in mind, not pathfinding related is: when entity reaches one waypoint, you can turn it slowly to the next waypoint, while entity will keep moving forward. It will smooth movement a little bit.
Posted By: splashmaker

Re: Pathfinder - 12/11/09 22:32

I would use wall tracing depending on which way the path turns and lerp (linear interpolate) that with the distance to the node. From far away the entity would travel straight for the node, as it approaches the node it would get closer to the wall, and right next to the node the entity would hug the wall. Then reverse this for going away and midway to the next node do it again. You can do wall tracing by c_tracing 90 or -90 degrees relative to the motion of the entity, if you have a lot of entities you will want to only trace a few frames per second and record the value because c_trace is slow.

edit: Multiply the amount the entity goes towards the wall by the sin of the angle of the turn capped to 90 degrees. And thank you for this contribution!
Posted By: mr_x

Re: Pathfinder - 12/12/09 10:00

Interesting solution. I will try it when I will deal with pathfinding again, thanks.
Posted By: Frederick_Lim

Re: Pathfinder - 12/13/09 13:02

Originally Posted By: mr_x

Great! Thanks for the contribution.
Would you write a tutorial how it works?
Posted By: mr_x

Re: Pathfinder - 12/13/09 19:18

Actually it is a little bit difficult for me to write big texts in english =), so you'd better ask what you want here, and i tried to comment code as much as possible. I have used this tutorial to make this system: http://www.policyalmanac.org/games/aStarTutorial.htm
Posted By: Toon

Re: Pathfinder - 12/14/09 10:37

Very usefull contribution, you should send this to acknex unlimited (resources@acknex.net) ! smile
Posted By: NeoNeper

Re: Pathfinder - 04/15/10 13:02

How I make to pass position of another entity in the map for the pathFind? Without being the position one of the mouse.
Posted By: NeoNeper

Re: Pathfinder - 04/19/10 19:14

HI. I obtained to solve my first one doubts previously post.
Now I have another doubt.

I am trying to make pathFind to function in other entities at the same time. " would like to create a style; followPath" allies to follow them my to player using pathFind. Somebody could give a light to me?
Posted By: Landixus

Re: Pathfinder - 04/21/10 10:06

Work this in all directions?

x y z
Posted By: NeoNeper

Re: Pathfinder - 04/23/10 15:31

helloooo .. somebodyyy..
Posted By: PrenceOfDarkness

Re: Pathfinder - 04/25/10 15:23

Is this thing still downloadable anywhere?? Does it work with the newest update?
Posted By: Rasch

Re: Pathfinder - 04/26/10 22:24

how can i manage it that my entity patrouls around in a random way to a random waypoint? laugh
Posted By: 3run

Re: Pathfinder - 04/28/10 00:39

Hi every one. Need some help, I'm noob grin and I can't get the little car find path to the player entitie. How should it be done? Please really need help here laugh bratan pomogi po bratskiy! Ja ne osobo ponimaju na angliyskom. Ne smog razobratsa... I eshe kak sdelat tak chtobi on iskal puti proizvolno, i hodil po nim? I kak sdelat tak chtobi on sledoval k nodu kotoriy v protivopolognoi storone i daleko ot igroka? Kak budto on ubegaet ot igroka tipa, zaranne blagadaren! :-)
Posted By: 3run

Re: Pathfinder - 04/28/10 17:31

* EMPTY *
Posted By: Liamissimo

Re: Pathfinder - 04/28/10 18:04

Try Intense X for pathfinding wink Best solution i know
Posted By: 3run

Re: Pathfinder - 04/28/10 20:16

* EMPTY *
Posted By: 3run

Re: Pathfinder - 04/30/10 18:16

* EMPTY *
Posted By: 3run

Re: Pathfinder - 05/01/10 17:27

* EMPTY *
Posted By: YellowAfterlife

Re: Pathfinder - 05/01/10 19:54

3run,
Code:
asFindasPath(CarPos, target_pos);

and make sure that target_pos is current player's position.
If you don't have enough exprience, check the numerous lite-C examples. They help.
Posted By: 3run

Re: Pathfinder - 05/01/10 20:32

I can do that by vec_set, but how to make car move to some other directions?
Posted By: YellowAfterlife

Re: Pathfinder - 05/01/10 20:51

Originally Posted By: 3run
I can do that by vec_set, but how to make car move to some other directions?

Please define other directions.
Posted By: 3run

Re: Pathfinder - 05/02/10 10:04

* EMPTY *
Posted By: 3run

Re: Pathfinder - 05/02/10 19:32

* EMPTY *
Posted By: 3run

Re: Pathfinder - 05/02/10 22:23

* EMPTY *
Posted By: 3run

Re: Pathfinder - 05/03/10 11:01

* EMPTY *
Posted By: snake67

Re: Pathfinder - 11/21/10 13:40

Hi Mr X

I am using your A* pathfinding routine and i am happy with it, thanks for the contribution!

Is it free to use? Do you want credit? If yes, what should i diplay?
Posted By: romin2011

Re: Pathfinder - 01/07/11 15:27

I downloaded from this link pathfinding but when i open it in wed it gives error
"damaged at line -1
does any body has a working level please upload it.
Thank You
© 2024 lite-C Forums