PathFinder status
#1
Bug 
Last update: Friday, 25 December, 2015

Related thread: Mob status

This thread is an overview of the current status of the PathFinder and what I plan to improve. For specific development issues, see the PathFinder Github label. Note that this reflects the status of the Master branch.


PathFinder to-do list:
  • Done: Implement 3d A* that can calculate the shortest path between 2 points. For mob integration, see the Mob Status thread.
  • Done: Add flexible bounding boxes.
  • Done: Pick closest path when no destination to target.
  • Partially Done: Fence handling. Mobs will not pass fences, but they behave strangely if the player is standing near a fence.
  • Done: Deal with falls.
  • Done: Water handling.
  • Gates, doors and trapdoors handling. Currently, they are always considered closed.
  • Ladder Handling. currently, ladders are ignored.
  • Spider climbing.
  • Underwater PathFinding for squids and guardians.
  • Line-of-sight optimization. Mobs should ditch the pathfinder and walk in straight line when possible to avoid weird grid snapping.

PathFinder might-do list:
  • Custom solids. e.g. some mobs may want to avoid cobweb and some ghost might want to walk through dirt.
  • Flight.
  • Dijkstra.


Bugs:
  • When a cell's G value is updated, the priority queue will have a stale value and therefore a cell with a non-minimal G might be selected. Check if this has any practical significance.

Optimizations to-do list:
  • Done: Get rid of DoWithChunk.
  • Done: Vector3i wherever Vector3d will never be needed.
  • Can I get rid of sqrt?
  • Idle mobs optimization.

Some optimizations that *might* be implemented later
  • Jump point search
  • Use a "Reversed Dijkstra" to make things very efficient. This would basically create a "path force field" around each player, any mob in that field can travel to the player without any additional computation. So, the cost of calculating paths would become k*Players and not k*Mobs.

Old post:
[spoiler]
Related Github Issue: https://github.com/mc-server/MCServer/issues/1391

I can implement a function for A* pathfinding, which could be used for the AI.
My knowledge of the codebase is next to nill. So I have some questions:

Is any path-finding implemented?
Is such a function desired?
What are the general plans for AI?


***My general plan***

Despite my lack of knowledge in the code base, I can implement a "game-agnostic" function which can find the path, here is rough declaration of such a function:

point * point_array find_path(x_from,y_from,z_from,x_to,y_to,z_to,max_jump,character_width,character_length,character_height)

max_jump determines the character's ability to traverse vertically.
0 means the character will never change its Z position, e.g. a silverfish.
1 is typical for most mobs.
A spider can scale walls, therefore this can have a larger value, such as 50.

The way the path is returned can vary, my initial thought was an array of points.

character_width,character_length,character_height determine how big the character is. e.g. a zombie shouldn't path-find through a door with a height of 1.

The only code base knowledge I need in order for me to implement it is a function which returns whether or not a block is occupied, something like
bool is_solid(int x,int y,int z)

For debugging purposes, I'd also need to place some marker blocks, e.g. place_block(int x,int y,int z, blocktype)

After this thing works, I can convert it to a non-blocking function. (A function which is partially executed each tick to prevent a game freeze).

Trivial: Deciding whether x_from,y_from,z_from define the center point of a character or one of its edges.

Less trivial: Determining what happens if a calculated path is no longer valid. What does Vanilla do in such a case? The easy solution is just going along the path until encountering an obstacle, and then recalculating.

If there are minecraft creatures which can go down ledges but can't go up, max_jump can be split into max_up and max_down.

Tell me your thoughts of this!

Github issue: https://github.com/mc-server/MCServer/issues/1391

P.s. my github identity is " Wiseoldman95"
Feel free to confirm this by checking the "URL" in wiseoldman95's profile
https://github.com/wiseoldman95


Files that may be related to pathfinding:
https://github.com/mc-server/MCServer/bl...ingBox.cpp
[/spoiler]
Reply
Thanks given by:


Messages In This Thread
PathFinder status - by LogicParrot - 09-08-2014, 02:20 AM
RE: Implementing Pathfinding - by xoft - 09-08-2014, 03:25 AM
RE: Implementing Pathfinding - by LogicParrot - 09-08-2014, 03:49 AM
RE: Implementing Pathfinding - by xoft - 09-08-2014, 04:09 AM
RE: Implementing Pathfinding - by LogicParrot - 09-08-2014, 04:37 AM
RE: Implementing Pathfinding - by LogicParrot - 09-08-2014, 05:52 AM
RE: Implementing Pathfinding - by sphinxc0re - 09-08-2014, 05:57 AM
RE: Implementing Pathfinding - by xoft - 09-08-2014, 06:21 AM
RE: Implementing Pathfinding - by LogicParrot - 09-08-2014, 06:28 AM
RE: Implementing Pathfinding - by LogicParrot - 09-08-2014, 08:14 PM
RE: Implementing Pathfinding - by NiLSPACE - 09-08-2014, 08:26 PM
RE: Implementing Pathfinding - by LogicParrot - 09-08-2014, 08:45 PM
RE: Implementing Pathfinding - by LogicParrot - 09-08-2014, 09:58 PM
RE: Implementing Pathfinding - by xoft - 09-08-2014, 10:55 PM
RE: Implementing Pathfinding - by worktycho - 09-09-2014, 12:10 AM
RE: Implementing Pathfinding - by jan64 - 09-09-2014, 02:09 AM
RE: Implementing Pathfinding - by LogicParrot - 09-09-2014, 05:16 AM
RE: Implementing Pathfinding - by NiLSPACE - 09-09-2014, 02:10 AM
RE: Implementing Pathfinding - by SamJBarney - 09-09-2014, 06:44 AM
RE: Implementing Pathfinding - by jan64 - 09-09-2014, 06:47 AM
RE: Implementing Pathfinding - by LogicParrot - 09-09-2014, 09:24 PM
RE: Implementing Pathfinding - by SamJBarney - 09-10-2014, 03:08 AM
RE: Implementing Pathfinding - by sphinxc0re - 09-10-2014, 03:18 AM
RE: Implementing Pathfinding - by LogicParrot - 09-10-2014, 03:22 AM
RE: Implementing Pathfinding - by jan64 - 09-10-2014, 03:56 AM
RE: Implementing Pathfinding - by LogicParrot - 09-10-2014, 04:02 AM
RE: Implementing Pathfinding - by LogicParrot - 09-10-2014, 03:58 PM
RE: Implementing Pathfinding - by archshift - 09-13-2014, 08:54 AM
RE: Implementing Pathfinding - by xoft - 09-10-2014, 04:32 PM
RE: Implementing Pathfinding - by LogicParrot - 09-10-2014, 10:22 PM
RE: Implementing Pathfinding - by xoft - 09-10-2014, 10:33 PM
RE: Implementing Pathfinding - by LogicParrot - 09-10-2014, 11:44 PM
RE: Implementing Pathfinding - by worktycho - 09-10-2014, 11:43 PM
RE: Implementing Pathfinding - by xoft - 09-11-2014, 12:37 AM
RE: Implementing Pathfinding - by LogicParrot - 09-11-2014, 01:12 AM
RE: Implementing Pathfinding - by LogicParrot - 09-11-2014, 03:47 AM
RE: Implementing Pathfinding - by LogicParrot - 09-11-2014, 08:27 PM
RE: Implementing Pathfinding - by xoft - 09-13-2014, 09:08 PM
RE: Implementing Pathfinding - by wudles - 01-31-2015, 03:02 AM
RE: Implementing Pathfinding - by LogicParrot - 02-16-2015, 04:45 AM
RE: Implementing Pathfinding - by NiLSPACE - 02-16-2015, 04:50 AM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 07:20 AM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 03:39 PM
RE: Implementing Pathfinding - by xoft - 04-22-2015, 03:59 PM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 04:01 PM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 04:28 PM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 06:21 PM
RE: Implementing Pathfinding - by NiLSPACE - 04-22-2015, 06:53 PM
RE: Implementing Pathfinding - by Jammet - 04-22-2015, 09:53 PM
RE: Implementing Pathfinding - by LogicParrot - 04-23-2015, 05:34 AM
RE: Implementing Pathfinding - by xoft - 04-22-2015, 08:22 PM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 09:04 PM
RE: Implementing Pathfinding - by xoft - 04-22-2015, 09:21 PM
RE: Implementing Pathfinding - by worktycho - 04-22-2015, 09:35 PM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 09:40 PM
RE: Implementing Pathfinding - by worktycho - 04-22-2015, 09:59 PM
Example updated - by LogicParrot - 04-22-2015, 10:10 PM
Compiling issue - by LogicParrot - 04-22-2015, 10:35 PM
RE: Implementing Pathfinding - by NiLSPACE - 04-22-2015, 10:45 PM
RE: Implementing Pathfinding - by worktycho - 04-22-2015, 10:46 PM
RE: Implementing Pathfinding - by LogicParrot - 04-22-2015, 10:53 PM
RE: Implementing Pathfinding - by worktycho - 04-22-2015, 10:54 PM
RE: Implementing Pathfinding - by LogicParrot - 04-23-2015, 03:49 AM
Caching - by LogicParrot - 04-23-2015, 04:13 AM
RE: Implementing Pathfinding - by jan64 - 04-23-2015, 04:56 AM
RE: Implementing Pathfinding - by NiLSPACE - 04-23-2015, 05:20 AM
RE: Implementing Pathfinding - by LogicParrot - 04-23-2015, 06:21 AM
RE: Implementing Pathfinding - by xoft - 04-23-2015, 08:50 AM
Code cleaned - by LogicParrot - 04-23-2015, 06:47 PM
RE: Implementing Pathfinding - by LogicParrot - 04-23-2015, 07:36 PM
RE: Implementing Pathfinding - by LogicParrot - 04-23-2015, 08:02 PM
RE: Implementing Pathfinding - by jan64 - 04-23-2015, 08:41 PM
RE: Implementing Pathfinding - by LogicParrot - 04-23-2015, 08:48 PM
RE: Implementing Pathfinding - by worktycho - 04-24-2015, 07:33 AM
RE: Implementing Pathfinding - by LogicParrot - 04-24-2015, 05:55 PM
RE: Implementing Pathfinding - by LogicParrot - 04-24-2015, 06:10 PM
RE: Implementing Pathfinding - by xoft - 04-24-2015, 06:19 PM
RE: Implementing Pathfinding - by LogicParrot - 04-24-2015, 06:24 PM
RE: Implementing Pathfinding - by worktycho - 04-24-2015, 06:47 PM
RE: Implementing Pathfinding - by xoft - 04-24-2015, 06:49 PM
RE: Implementing Pathfinding - by worktycho - 04-24-2015, 06:56 PM
RE: Implementing Pathfinding - by xoft - 04-24-2015, 08:34 PM
RE: Implementing Pathfinding - by LogicParrot - 04-24-2015, 10:35 PM
RE: Implementing Pathfinding - by worktycho - 04-24-2015, 09:32 PM
RE: Implementing Pathfinding - by LogicParrot - 04-25-2015, 06:11 AM
RE: Implementing Pathfinding - by xoft - 04-24-2015, 09:55 PM
RE: Implementing Pathfinding - by worktycho - 04-24-2015, 10:15 PM
RE: Implementing Pathfinding - by xoft - 04-24-2015, 10:29 PM
RE: Implementing Pathfinding - by LogicParrot - 04-25-2015, 05:52 AM
RE: Implementing Pathfinding - by worktycho - 04-24-2015, 10:34 PM
RE: Implementing Pathfinding - by LogicParrot - 04-24-2015, 11:46 PM
RE: Implementing Pathfinding - by worktycho - 04-25-2015, 12:01 AM
RE: Implementing Pathfinding - by LogicParrot - 04-25-2015, 05:41 AM
RE: Implementing Pathfinding - by LogicParrot - 04-25-2015, 06:34 AM
Codestyle fixed? - by LogicParrot - 04-25-2015, 06:53 AM
RE: Implementing Pathfinding - by sphinxc0re - 04-26-2015, 12:06 AM
RE: Implementing Pathfinding - by LogicParrot - 04-26-2015, 12:41 AM
RE: Implementing Pathfinding - by LogicParrot - 04-26-2015, 02:54 AM
RE: Implementing Pathfinding - by worktycho - 04-26-2015, 03:16 AM
RE: Implementing Pathfinding - by xoft - 04-26-2015, 03:26 AM
cPathFinder and cPath merged - by LogicParrot - 04-26-2015, 08:16 PM
RE: Implementing Pathfinding - by worktycho - 04-26-2015, 08:28 PM
CheckBasicStyle.lua wrapper - by LogicParrot - 04-26-2015, 11:50 PM
RE: Implementing Pathfinding - by xoft - 04-26-2015, 11:05 PM
RE: Implementing Pathfinding - by xoft - 04-27-2015, 12:36 AM
RE: Implementing Pathfinding - by LogicParrot - 04-27-2015, 07:15 AM
World.h - by LogicParrot - 04-28-2015, 06:00 AM
RE: Implementing Pathfinding - by worktycho - 04-28-2015, 06:14 AM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 07:22 AM
RE: Implementing Pathfinding - by NiLSPACE - 04-28-2015, 07:35 AM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 07:41 AM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 03:15 PM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 04:07 PM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 04:37 PM
Working PathFinder.cpp - by LogicParrot - 04-28-2015, 05:59 PM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 06:24 PM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 06:35 PM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 07:19 PM
RE: Implementing Pathfinding - by xoft - 04-28-2015, 08:17 PM
RE: Implementing Pathfinding - by NiLSPACE - 04-28-2015, 08:51 PM
RE: Implementing Pathfinding - by LogicParrot - 04-28-2015, 09:55 PM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 04:41 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 05:36 AM
RE: Implementing Pathfinding - by worktycho - 04-29-2015, 05:36 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 05:41 AM
RE: Implementing Pathfinding - by NiLSPACE - 04-29-2015, 05:50 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 05:55 AM
RE: Implementing Pathfinding - by NiLSPACE - 04-29-2015, 06:05 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 06:32 AM
RE: Implementing Pathfinding - by NiLSPACE - 04-29-2015, 06:36 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 07:12 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 07:28 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 07:43 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 08:09 AM
RE: Implementing Pathfinding - by jan64 - 04-29-2015, 08:17 AM
RE: Implementing Pathfinding - by LogicParrot - 04-29-2015, 06:30 PM
RE: Implementing Pathfinding - by xoft - 04-29-2015, 07:26 PM
RE: Implementing Pathfinding - by LogicParrot - 04-30-2015, 01:46 AM
RE: Implementing Pathfinding - by NiLSPACE - 04-30-2015, 04:05 AM
RE: Implementing Pathfinding - by LogicParrot - 04-30-2015, 05:07 AM
RE: Implementing Pathfinding - by LogicParrot - 04-30-2015, 06:22 PM
RE: Implementing Pathfinding - by LogicParrot - 04-30-2015, 06:36 PM
RE: Implementing Pathfinding - by LogicParrot - 04-30-2015, 06:49 PM
RE: Implementing Pathfinding - by NiLSPACE - 04-30-2015, 08:32 PM
RE: Implementing Pathfinding - by NiLSPACE - 05-01-2015, 12:31 AM
RE: Implementing Pathfinding - by LogicParrot - 05-01-2015, 01:50 AM
RE: Implementing Pathfinding - by LogicParrot - 05-01-2015, 02:36 AM
RE: Implementing Pathfinding - by NiLSPACE - 05-01-2015, 02:41 AM
RE: Implementing Pathfinding - by LogicParrot - 05-01-2015, 04:20 AM
RE: Implementing Pathfinding - by LogicParrot - 05-01-2015, 04:36 AM
RE: Implementing Pathfinding - by LogicParrot - 05-01-2015, 06:54 AM
RE: Implementing PathFinding - by jan64 - 05-01-2015, 08:06 PM
Merged! - by LogicParrot - 05-01-2015, 10:33 PM
DoWithChunk - by LogicParrot - 05-01-2015, 11:31 PM
RE: Implementing PathFinding - by worktycho - 05-02-2015, 12:32 AM
RE: Implementing PathFinding - by LogicParrot - 05-02-2015, 01:55 AM
RE: Implementing PathFinding - by xoft - 05-02-2015, 02:03 AM
RE: Implementing PathFinding - by LogicParrot - 05-02-2015, 02:12 AM
RE: Implementing PathFinding - by xoft - 05-02-2015, 02:48 AM
RE: Implementing PathFinding - by tonibm19 - 05-02-2015, 05:34 AM
RE: Implementing PathFinding - by LogicParrot - 05-02-2015, 05:47 AM
RE: Implementing PathFinding - by LogicParrot - 05-02-2015, 06:18 AM
RE: Implementing PathFinding - by LogicParrot - 05-02-2015, 04:20 PM
RE: Implementing PathFinding - by NiLSPACE - 05-03-2015, 03:26 AM
RE: Implementing PathFinding - by LogicParrot - 05-03-2015, 04:58 AM
RE: Implementing PathFinding - by Howaner - 05-03-2015, 08:42 AM
RE: Implementing PathFinding - by LogicParrot - 05-03-2015, 04:51 PM
RE: PathFinder status - by NiLSPACE - 05-05-2015, 06:32 AM
RE: PathFinder status - by xoft - 05-05-2015, 07:26 AM
RE: PathFinder status - by LogicParrot - 05-05-2015, 03:58 PM
RE: PathFinder status - by LogicParrot - 05-06-2015, 02:48 AM
RE: PathFinder status - by tigerw - 05-06-2015, 03:44 AM
RE: PathFinder status - by NiLSPACE - 05-07-2015, 06:04 AM
RE: PathFinder status - by NiLSPACE - 05-08-2015, 08:37 AM
RE: PathFinder status - by worktycho - 05-08-2015, 08:43 AM
RE: PathFinder status - by Jammet - 05-08-2015, 09:03 AM
RE: PathFinder status - by xoft - 05-08-2015, 05:00 PM
RE: PathFinder status - by LogicParrot - 05-08-2015, 05:07 PM
RE: PathFinder status - by Jammet - 05-08-2015, 09:45 PM
RE: PathFinder status - by LogicParrot - 05-08-2015, 10:18 PM
RE: PathFinder status - by LogicParrot - 05-08-2015, 10:32 PM
RE: PathFinder status - by xoft - 05-08-2015, 10:33 PM
RE: PathFinder status - by LogicParrot - 05-08-2015, 11:00 PM
RE: PathFinder status - by tigerw - 05-09-2015, 02:54 AM
RE: PathFinder status - by LogicParrot - 05-09-2015, 03:13 AM
RE: PathFinder status - by NiLSPACE - 05-09-2015, 11:14 PM
RE: PathFinder status - by worktycho - 05-09-2015, 11:33 PM
RE: PathFinder status - by Jammet - 05-11-2015, 10:37 AM
RE: PathFinder status - by LogicParrot - 05-24-2015, 01:35 AM
RE: PathFinder status - by Shadowraix - 05-24-2015, 02:41 AM
RE: PathFinder status - by tigerw - 05-24-2015, 04:00 AM
RE: PathFinder status - by LogicParrot - 05-24-2015, 04:12 AM
RE: PathFinder status - by Jammet - 05-24-2015, 06:43 PM
RE: PathFinder status - by ThuGie - 05-24-2015, 06:42 AM
RE: PathFinder status - by LogicParrot - 05-24-2015, 04:41 PM
RE: PathFinder status - by NiLSPACE - 06-01-2015, 03:14 AM
RE: PathFinder status - by LogicParrot - 06-01-2015, 03:41 PM
RE: PathFinder status - by NiLSPACE - 06-01-2015, 06:18 PM
RE: PathFinder status - by LogicParrot - 06-02-2015, 05:36 PM
RE: PathFinder status - by NiLSPACE - 06-02-2015, 06:03 PM
RE: PathFinder status - by jan64 - 06-03-2015, 01:03 AM
RE: PathFinder status - by LogicParrot - 06-05-2015, 05:34 PM
RE: PathFinder status - by LogicParrot - 08-06-2015, 04:21 AM
RE: PathFinder status - by DiamondToaster - 08-06-2015, 04:39 AM
RE: PathFinder status - by worktycho - 09-30-2015, 11:43 PM
D* is for static goals - by LogicParrot - 10-02-2015, 06:52 PM
RE: PathFinder status - by NiLSPACE - 10-02-2015, 07:28 PM
We have BFS - by LogicParrot - 10-02-2015, 08:03 PM
RE: PathFinder status - by NiLSPACE - 10-02-2015, 08:10 PM
RE: PathFinder status - by LogicParrot - 10-02-2015, 08:18 PM
RE: PathFinder status - by NiLSPACE - 10-02-2015, 08:19 PM
RE: PathFinder status - by LogicParrot - 10-02-2015, 08:24 PM
RE: PathFinder status - by LogicParrot - 10-02-2015, 09:05 PM
RE: PathFinder status - by xoft - 10-03-2015, 01:10 AM
Agree - by LogicParrot - 10-03-2015, 06:28 PM
RE: PathFinder status - by LogicParrot - 10-05-2015, 06:53 PM
RE: PathFinder status - by NiLSPACE - 10-08-2015, 05:29 AM
RE: PathFinder status - by LogicParrot - 10-22-2015, 03:54 PM
RE: PathFinder status - by LogicParrot - 12-13-2015, 05:19 PM
RE: PathFinder status - by LogicParrot - 12-23-2015, 08:24 AM
RE: PathFinder status - by Jammet - 12-23-2015, 09:07 AM
Update: Swimming done right - by LogicParrot - 12-26-2015, 12:36 AM
RE: PathFinder status - by tonibm19 - 12-26-2015, 12:42 AM
RE: PathFinder status - by LogicParrot - 12-26-2015, 01:03 AM
RE: PathFinder status - by LogicParrot - 01-12-2016, 07:20 PM



Users browsing this thread: 1 Guest(s)