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) |
RE: Implementing Pathfinding - LogicParrot - 09-09-2014 Thank you all for the valuable info. I would like to get some feedback regarding my initial header file before actually implementing anything. https://github.com/wiseoldman95/MCServer/blob/pathfinding/src/Mobs/Pathfinder.h RE: Implementing Pathfinding - SamJBarney - 09-10-2014 Hmmmm.... I think its a good start, but I don't think it will allow for a lot of configuration. For instance, what if we want to make Cobwebs considered passable or unpassable? Or have pathing allow movement underwater or over the top? What if someone in the future want to make a mob AI that avoid grass if possible, or can climb up vines? RE: Implementing Pathfinding - sphinxc0re - 09-10-2014 SamJBarney has his point. Your code is all in all very constant. But MCServer/Cuberite has the feature of being extremely flexible and customizable. RE: Implementing Pathfinding - LogicParrot - 09-10-2014 A blacklist parameter can be later added, that parameter can have any block type, such as water, grass, or cobweb. A "ladder-list" can also be added. I think that these things are trivial to add once the algorithm is in place. RE: Implementing Pathfinding - jan64 - 09-10-2014 It'd be nice to have ability to override path finding completely for particular mobs from lua (rideable dragons, for example). RE: Implementing Pathfinding - LogicParrot - 09-10-2014 (09-10-2014, 03:56 AM)jan64 Wrote: It'd be nice to have ability to override path finding completely for particular mobs from lua (rideable dragons, for example). As xoft put it, the pathfinder will a "dumb device" which receives two points and spits a path. AI's are free to use/ not use it. RE: Implementing Pathfinding - LogicParrot - 09-10-2014 Can I call functions using the game's chat? e.g. typing /hello 12 2915 calls foo(12,2915) I would like to use that for debugging. RE: Implementing Pathfinding - xoft - 09-10-2014 Not really. It could be done, but there's so much glue code you'd need to write that it wouldn't be worth it. Console commands could be a bit easier - the server implements a few built-in, so if you look at the cServer::ExecuteConsoleCommand() function, you should be able to get something done with it. RE: Implementing Pathfinding - LogicParrot - 09-10-2014 Thank you. I would like to know whether the current interface requires any changes. RE: Implementing Pathfinding - xoft - 09-10-2014 The interface has no idea where to do the pathfinding. You need to get a cChunk instance in it somehow so that it can query blocks. Note that you don't normally have access to a cChunk object unless you do a cWorld::DoWithChunk() - so your interface should get a cWorld instance, call DoWithChunk() on it internally and then do the actual pathfinding. See the cLineBlockTracer for a similar example (didn't I write this already?) Also the usage of the class is somewhat unintuitive now - if you want to do pathfinding, you first create an instance, feed a few params to it, and then call one of its methods, only to destroy the instance afterwards. Can't it all be wrapped into a static function that would create the instance internally with all the data it needs? |