Archives for: July 2007, 02

2007-07-02

Permalink 03:43:12 pm, Categories: Pathfinding  

Pathfinder propclass!

Hello there,

I know I have not written for a while, but thats basically because I had nothing new to say =P.

CelGraph is finished and it appears to be working correctly, however there are still some tests to be made.
Now, when I was testing it in a graph application I noticed how hard it was to create a path, call the graph, then call
pcsteer to follow that path and... you get the point.

So i created PcPathfinder, this class has similar functions to pcsteer (in fact it behaves very similar):

Seek
Pursue
Wander
FollowCyclicPath(iCelPath*)
FollowOneWayPath(iCelPath*)
FollowTwoWayPath(iCelPath*)

Seek will seek a position in the world using the graph, this way entities will be smarter to use certain paths instead of crashing against walls.

Pursue will do the same except that it will continue running A* in case the target has modified its position (as you can see this costs a lot)

Wander will use a function call RandomPath(int distance) in CelGraph which will create a random path of deepness distance ie: a random path with distance nodes.

Follow Cyclic Path will follow the indicated path and it will start over again once it reaches the end.

Follow One way Path will follow the indicated path and it will stop at the end.

Follow Two Way Path will follow the indicated path and it will follow it backwards once it reaches the end.

I thought these three functions may be useful for developers in case they want to set certain paths for there entities (guards for example may use this).

Finally I am thinging of adding a multiplier (float) property to edges.

Why?

Well, for the moment the cost between two edges is always the euclidean distance between them. But this will cause serious problems in games where you move slower in the mud or grass, etc. So, I will add this property, it will be 1.0 by default and it could be changed by the user with a SetMultiplier function.

Well, this is all for now, pcPathFinder still have bugs so Ill be working in this during the next week or so =)

July 2007
Mon Tue Wed Thu Fri Sat Sun
 << < Current> >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Search

Archives

Misc

XML Feeds

What is this?

powered by
b2evolution