Advertisement

Path-Finding for Simple People

Started by May 17, 2002 08:35 AM
7 comments, last by Woody FX 22 years, 6 months ago
Is there any really simple pathfinding methods.... that do not have linked lists, etc...
Search for WayPoints and Cone of Convergence algorithms
Advertisement
here''s my failunsafe method (for 2d space):

do
{
switch (loc_X)
{
case > my_X: my_X++;
break;
case < my_X: my_X--;
break;
default: done.x = true;
}

switch (loc_Y)
{
case > my_Y: my_Y++;
break;
case < my_Y: my_Y--;
break;
default: done.y = true;
}
} while (!(done.x && done.y))

or something like that. is it actually AI? nope. does it actually follow a path, nope. BUT: use waypoint and this baby will work fine--sortof.
Thats really ingenious Ionysus!!!

Do you mean that kind that solve a maze or find the fastest path of some sort?
Except that code isn''t really pathfinding, it''s more following a path. You still havn''t got the original poster anywhere near solving his problem...

Woody: Linked lists are easy to code. Code one, or use STL....

After careful deliberation, I have come to the conclusion that Nazrix is not cool. I am sorry for any inconvienience my previous mistake may have caused. We now return you to the original programming

Advertisement
Its kinda stupid to respond with this as it leads the original poster nowhere, but hopefully it sparks someone elses memory.

At university I remember learning a path-finding algorithm in which you made an array with one struct for each node on the whole map. And then the algorithm worked by changing things in the structs in the array until it fulfilled some criteria, which meant the path was found.

If I remember correctly, each struct (read: node) in that array had an ''amount so far'', and a ''parent'' (plus some other things).

If you remember or know of this algorithm - do mention it as it finds a path quite nicely and does not need linked lists.



regards,

GeniX

www.cryo-genix.net
regards,GeniXwww.cryo-genix.net
Sounds like Djikstra''s.
For a look at steering behaviours take a look at This GDC Doc

There's also an article of an even simpler system by Mike Mika and Chris Charla in "AI Game Programming Wisdom" There might be some links at the AI Wisdom Page. Something to do with whiskers and biases and attractions and repulsions.

ZoomBoy
Developing a iso-tile 2D RPG with skills, weapons, and adventure. See my old Hex-Tile RPG GAME, character editor, diary, 3D Art resources at Check out my web-site


[edited by - ZoomBoy on May 23, 2002 9:29:54 AM]

This topic is closed to new replies.

Advertisement