PathFinder status
#12

Edit: Fixed serious typos. Please re-read.
Edit 2: Clarified the example.
Analysis - O(K*Number Of Players)

Most path-finding techniques are dependent upon the number of mobs, the speed is about O(something*number_of_pathfinding_agents).

However, in some cases this can be greatly optimized. For example, if 1000 mobs are targeting a single player, we can make the needed calculation once! This is illustrated in the following image (ignore the red square)
http://www.gamedeveloperskills.com/wp-co...-stepN.jpg

One needs to calculate such a map for each player, then any mob can use that map to reach the player without further calculations. of course, the map has to be recalculated whenever the player moves, but with the old fashioned way, the map has to be recalculated for *each mob* whenever the player moves.

However, this sort of optimization has some requirements. In Minecraft's case, all mobs that are using the same map must have the same bounding boxes (A path calculated for a chicken can't possibly be the same path of an iron golem).

Which leads to my question/proposal: How about grouping mobs into groups of roughly the same sizes, and giving each group an equal approximated bounding box? For example: Zombies, Skeletons, and most "android" mobs, can all have an equal approximated size of 0.8m, allowing them all to use the same map. Of course, the old fashioned calculation must be done for mobs which are way off the approximation, such as spiders.

Note that this approximation is only for the path-finding, not for the rest of the game.

This would lead to a drastic performance increase.

Example case: 5 zombies, 2 skeletons, 3 spider,

Old method: 5+2+3=10 path calculations
Proposed method: 1 calculation per each mob group targeting the same player. A mob group is a collection of all mobs with the same bounding box (The 5 zombies and the 2 skeletons are one group, the 3 spiders are a second group).

So we have 2 groups.
Worst case: each single mob is targeting a single player (10 players), 10 path calculations

Best case: The 2 groups are targeting the same player: 2 calculations.

Note: If all similar mobs have identical bounding boxes, the approximation part is irrelevant. (Do they?)

(09-08-2014, 08:26 PM)STR_Warrior Wrote: No, Minecraft doesn't do that either.
Phew! Thank you.
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: 6 Guest(s)