Cuberite Forum
PathFinder status - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: PathFinder status (/thread-1571.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23


RE: Implementing Pathfinding - worktycho - 04-22-2015

As for caching, it would probably be faster to cache the state as it getting a block involves acquiring two locks.


RE: Implementing Pathfinding - LogicParrot - 04-23-2015

Caching reduced block querying by a bit more than 10xBig Grin
I am still not able to compile MCServer though, I'm doing all the tests externally in Irrlicht. I am considering switching to Jessie.


Caching - LogicParrot - 04-23-2015

Click for an image.
We never ask cWorld about the same block twice.
Thin yellow: cached air
Big yellow: cached solid
Thin red: closed list
Thin green: open list
Big green: final path


RE: Implementing Pathfinding - jan64 - 04-23-2015

Looks nice, however unfortunately vanilla does handle half-slabs during path finding - they can go through the small cavity between a half slab and a solid block above (and this is used in cave spider farms).


RE: Implementing Pathfinding - NiLSPACE - 04-23-2015

Yes, they can go through them, but do they also walk through them by themselves?


RE: Implementing Pathfinding - LogicParrot - 04-23-2015

(04-22-2015, 09:53 PM)Jammet Wrote:
(04-22-2015, 06:53 PM)NiLSPACE Wrote: Seriously, this is awesome Smile It's werid to say, but I can't wait until the first zombie is chasing me ^^

Me too!Big Grin
Me 3 Smile

Just realized there's a neat side effect to the current interface: The further away the mob is from the destination, the less often the path is calculated, because isCalculationFinished will be called more times till the path calculation is done.


RE: Implementing Pathfinding - LogicParrot - 04-23-2015

Tomorrow I'm planning to attempt to integrate the algorithm with MCServer, it should be a "plug n play" operation because the only thing I'll need to modify is the function which queries the world for blocks (Currently it queries Irrlicht, I should make it query cWorld). @xoft and others, any changes needed to the interface?

Regarding half-slabs: It doesn't matter much right now. I'd rather start simple, anything is better than the brainless zombies. Partial blocks are in the roadmap and I have an idea in mind, but I'd rather neglect them for now to get this thing faster into MCServer.


RE: Implementing Pathfinding - xoft - 04-23-2015

The interface looks good enough, maybe a few small tweaks such as returning a const reference to (an internal) cPath object, rather than a naked ptr to it; those can be done as we go.

I'm just afraid that if you write your code the way you wrote the interface, you're in for a hell lot of restyling to match MCS's code style and make it past the CheckBasicStyle.lua script. We use a_CamelCase for params, CamelCase for function names, m_CamelCase for member variables; there needs to be a space after each comma ("param1, param2"), on both sides of math operators ("a = b + c") and pointer and reference declarations ("cClass & a_Param"). We use tabs for indenting, and continuation lines should have one single level of indent more than the parent line (not vertical alignment). Closing braces should be on the same indent level as the opening braces, both standing on separate lines; if a closing parenthesis is on a separate line, it should be on the same level as the line it's closing. Comments need to have at least two spaces in front of them and one space after the double-slash, and should start with a capital letter.


Code cleaned - LogicParrot - 04-23-2015

I followed all the practices you just mentioned and I also made sure the lua script is not complaining. I also added Doxygen-compatible documentation to PathFinder.h

I finally have GCC 4.9, but I am having trouble integrating the class into MCServer, my main trouble is the Vector3d class, I'm not sure how to include MCServer's Vector3d in PathFinder.h, including the Vector3d.h header directly spawns some weird LUA errors.

I am trying to get the code to compile without errors.
The code is now at https://github.com/wiseoldman95/MCServer/tree/pathfindingReborn

Help regarding Vector3d is appreciated.


RE: Implementing Pathfinding - LogicParrot - 04-23-2015

It seems I confused between Vector3 and Vector3d, I'll keep you updated.