Posts: 254
Threads: 16
Joined: Oct 2013
Thanks: 3
Given 20 thank(s) in 18 post(s)
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?
Posts: 681
Threads: 26
Joined: May 2014
Thanks: 112
Given 48 thank(s) in 37 post(s)
SamJBarney has his point. Your code is all in all very constant. But MCServer/Cuberite has the feature of being extremely flexible and customizable.
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
09-10-2014, 03:22 AM
(This post was last modified: 09-10-2014, 03:24 AM by LogicParrot.)
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.
Posts: 116
Threads: 3
Joined: Sep 2014
Thanks: 31
Given 15 thank(s) in 11 post(s)
It'd be nice to have ability to override path finding completely for particular mobs from lua (rideable dragons, for example).
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
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.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
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.
Posts: 721
Threads: 77
Joined: Apr 2014
Thanks: 113
Given 130 thank(s) in 91 post(s)
09-10-2014, 10:22 PM
(This post was last modified: 09-10-2014, 10:22 PM by LogicParrot.)
Thank you. I would like to know whether the current interface requires any changes.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
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?