02-16-2015, 04:50 AM
We do have The ComponentRewrite branch but it's more then a 1000 commits behind.
PathFinder status
|
02-16-2015, 04:50 AM
We do have The ComponentRewrite branch but it's more then a 1000 commits behind.
04-22-2015, 07:20 AM
Oh, it's April already!
Well then, Here's a teaser I'll explain it all tomorrow. https://imgur.com/1sL3WeA Thanks given by: NiLSPACE
04-22-2015, 03:39 PM
Alright, yesterday I've decided to resume work on this. and it worked quite well! I have edited the original post, please check it out.
Thanks given by: NiLSPACE
04-22-2015, 03:59 PM
I'd say that the wiggling is a pretty serious issue, it signifies that something is actually wrong with the algorithm.
04-22-2015, 04:01 PM
(This post was last modified: 04-22-2015, 04:02 PM by LogicParrot.)
I am debugging that right now.
The algorithm seems fine, it takes the "general shortest path", but it wiggles along the way.
04-22-2015, 04:28 PM
(This post was last modified: 04-23-2015, 06:22 AM by LogicParrot.)
Still debugging. In the meanwhile, what do you think of this interface?
I recall you wanted a "dumb device" which receives coordinates are spits out a path. Ideally, this would have been a static class with a single function "getPath". But I had to make instances because:
I'd love to hear if you have a better proposal. cPathFinder( double a_boundingBoxWidth, // The character's boundingBox Width. (Currently preset to 1, parameter will be ignored) double a_boundingBoxHeight, // The character's boundingBox Height. (Currently preset to 2, parameter will be ignored) int a_maxUp, // What is the highest wall this character can climb / jump? (Currently preset to 1, parameter will be ignored) int a_maxDown // How far down is the character willing to fall? TODO more flexibility here. (Currently preset to 1, parameter will be ignored) ); ~cPathFinder(); void findPath(int a_maxSearch, const Vector3d &a_startingPoint, const Vector3d &a_endingPoint); bool isCalculationFinished(); cPath* getPath(); interface usage example: //When a zombie is born... m_pathFinder=pathFinder(1,2,1,1); //The parameters do nothing because they are not implemented yet ... //When a zombie wants to attack someone. pathFinder.findPath(100,myLocation,theirLocation); //Every tick... if (pathFinder.isCalculationFinished()) { myPath=pathFinder.getPath(); //now walk that path. }
04-22-2015, 06:53 PM
Seriously, this is awesome It's werid to say, but I can't wait until the first zombie is chasing me ^^
04-22-2015, 08:22 PM
I just keep thinking, do we even need the non-integral math? Can't we base this on full or empty voxels? How much would we lose? I think all monsters can attack you when they're closer than 1 block away from you, so it doesn't matter, if they pathfind to an integral coord. And the entity bounding boxes don't matter much for pathfinding, just round them up to the nearest whole block, good enough.
04-22-2015, 09:04 PM
(This post was last modified: 04-22-2015, 09:13 PM by LogicParrot.)
@xoft, what about half slabs, etc?
By the way, the current algorithm is exactly as you describe, I was planning to add non-int stuff when reaching the "Deal with partial blocks" step. |
« Next Oldest | Next Newest »
|