About Store Forum Documentation Contact



Post Reply 
Pathfinding Question.
Author Message
Xhizors Offline
Member

Post: #1
Pathfinding Question.
Is there any way to disable or make the path's in the path finding method smaller? At this time, the character just don't go smooth to the position I click on, because it wants to go to the path's in order to move forward, that will result a "hacky" movement.

I hope you understand what I mean.

I do not want path finding in the mouse movement method ( actionMoveTo ).

Thanks a lot.
08-27-2009 01:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
Re: Pathfinding Question.
you can always program pathfinding manually by using actionMoveDir
08-27-2009 01:36 PM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #3
Re: Pathfinding Question.
Esenthel Wrote:you can always program pathfinding manually by using actionMoveDir

Can't you just make a option in actionMoveTo( ..., bool pathFinding )? Or any chance you can make the movement smoother when run from A to B using this pathfinding? Right now its not smooth at all.

Or maybe give an example on how to do it with actionMoveDir?

Help me out please.

Thanks.
08-27-2009 01:58 PM
Find all posts by this user Quote this message in a reply
Xhizors Offline
Member

Post: #4
Re: Pathfinding Question.
Esenthel Wrote:you can always program pathfinding manually by using actionMoveDir

So can you show me how to calc the move dir to a position using actionMoveDir?

Thanks.
08-27-2009 05:05 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
Re: Pathfinding Question.
actionMoveDir(target_pos - current_pos);
08-27-2009 05:45 PM
Find all posts by this user Quote this message in a reply
Xerios Offline
Member

Post: #6
Re: Pathfinding Question.
Well if your world has a fixed size ( one that doesn't change ) it's pretty easy to replace the map integrated pathfinding with the one from the 2D example ( PathFind class )


[Image: eb7u34.jpg]

As for movement you can program your own then later smooth it out using splines

Since we are talking about pathfinding , Esenthel your pathfinding class is great but could you add one more thing
to it? It should be pretty easy to do .
Right now, you only have 0 - 1 blocks, 0 for impassable and 1 for passable, but I think it would be better if you
could have up to 255, each block having a cost, this will enable people to do much more, not only for RTS games
but also for other games

Imagine this scenario :

[Image: 4k9nwm.png]

A monster which CAN swim wants to reach you, using your method it'll obviously swim through instead of going
around, but what if, what if swimming is 3 times slower than walking ? You see ? grin
Applying cost 0 to land and 10 to water can easily fix that problem, 255 should probably be used for impassable
areas since it's the highest cost.

Will you be able to add that feature ?
08-27-2009 07:11 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
Re: Pathfinding Question.
I could add this to the PathFind class (2d based), but the one in the actual game integrated with the world manager uses slightly different approach, and is optimized for performance of finding paths, and not making them the most accurate.
09-08-2009 09:16 PM
Find all posts by this user Quote this message in a reply
Post Reply