Mob status
#42
My thinking is that an AI could want to query multiple paths, and even some path-related questions, before it decides what to do next. For example, if a mob sees multiple players, it might want to decide which one to hunt (multiple path queries). Or a skeleton needs to find a place that's close enough to shoot (path-related, but not pathfinding). Or when passive mobs escape, they should pick a random destination that is reachable yet furthest away from the source of the attack. These all led me to the belief that a per-mob field would be useful.

I still think it could be viable. It won't be like storing 800 KiB per mob. Even if we used a simple byte array, it would be ~110 KiB per mob (48 * 48 * 48 bytes, where each byte would represent direction to the "previous" cell; coords would be implicit by the position in the array). This should still be acceptable, as normally you'd have only a few hundreds of mobs on the server, meaning tens of MiB of this data. Passive mobs could even use much smaller sight, so again, savings.
If we used an array of {coords, direction} that were populated only for the reachable cells, it should be possible to pack the data even tighter. The assumption is that out of the 3D space, only a 2D-like subset of cells is reachable (there are no flying mobs that have true pathfinding in minecraft). This could be further enforced by limiting not only the sight, but also the path length. In such a case, a maximum of 48 * 48 * 2 records (2D plane, plus jumps), or 18 KiB per mob, would be required. The array should be sorted by the coords, so that searching it by-coords is an O(log N) operation.
Reply
Thanks given by:


Messages In This Thread
Mob status - by LogicParrot - 05-01-2015, 04:54 PM
RE: AI Reborn - by tonibm19 - 05-01-2015, 07:30 PM
Breeding todo'ed - by LogicParrot - 05-01-2015, 07:32 PM
RE: AI Reborn - by Seadragon91 - 05-01-2015, 08:28 PM
RE: AI Reborn - by worktycho - 05-01-2015, 09:16 PM
Merged - by LogicParrot - 05-01-2015, 10:34 PM
RE: Mob status - by Jammet - 05-07-2015, 02:27 AM
RE: Mob status - by LogicParrot - 05-08-2015, 10:58 PM
RE: Mob status - by NiLSPACE - 05-07-2015, 05:52 AM
RE: Mob status - by Jammet - 05-08-2015, 11:03 PM
RE: Mob status - by sphinxc0re - 05-09-2015, 01:32 AM
RE: Mob status - by LogicParrot - 05-25-2015, 03:08 AM
RE: Mob status - by Jammet - 05-25-2015, 06:42 PM
RE: Mob status - by Jammet - 05-27-2015, 03:44 AM
RE: Mob status - by LogicParrot - 05-27-2015, 05:33 PM
RE: Mob status - by Jammet - 05-27-2015, 08:11 PM
Reproduce? - by LogicParrot - 05-27-2015, 11:47 PM
RE: Mob status - by Jammet - 05-27-2015, 11:50 PM
RE: Mob status - by LogicParrot - 05-27-2015, 11:55 PM
RE: Mob status - by Jammet - 05-27-2015, 11:57 PM
RE: Mob status - by LogicParrot - 05-28-2015, 12:42 AM
RE: Mob status - by Jammet - 05-28-2015, 01:37 AM
RE: Mob status - by LogicParrot - 05-28-2015, 04:58 PM
RE: Mob status - by Jammet - 05-28-2015, 05:25 PM
RE: Mob status - by LogicParrot - 05-28-2015, 05:53 PM
RE: Mob status - by bearbin - 05-28-2015, 05:59 PM
RE: Mob status - by LogicParrot - 05-28-2015, 06:00 PM
Skeleton diagnosis - by LogicParrot - 05-28-2015, 10:51 PM
RE: Mob status - by xoft - 05-29-2015, 12:58 AM
RE: Mob status - by worktycho - 05-29-2015, 01:37 AM
RE: Mob status - by LogicParrot - 05-29-2015, 02:03 AM
RE: Mob status - by worktycho - 05-29-2015, 02:26 AM
RE: Mob status - by LogicParrot - 05-29-2015, 02:28 AM
RE: Mob status - by LogicParrot - 05-29-2015, 02:47 AM
RE: Mob status - by worktycho - 05-29-2015, 03:00 AM
RE: Mob status - by jan64 - 05-29-2015, 04:53 AM
RE: Mob status - by LogicParrot - 05-29-2015, 05:21 AM
RE: Mob status - by Jammet - 05-29-2015, 05:35 AM
RE: Mob status - by LogicParrot - 05-29-2015, 05:43 AM
RE: Mob status - by xoft - 05-29-2015, 06:18 AM
RE: Mob status - by LogicParrot - 05-29-2015, 07:26 AM
RE: Mob status - by xoft - 05-29-2015, 04:34 PM
Dijkstra considerations - by LogicParrot - 05-29-2015, 06:37 PM
RE: Mob status - by LogicParrot - 05-29-2015, 06:49 PM
RE: Mob status - by xoft - 05-29-2015, 07:42 PM
RE: Mob status - by LogicParrot - 05-29-2015, 07:51 PM
RE: Mob status - by Jammet - 05-29-2015, 07:52 PM
RE: Mob status - by LogicParrot - 05-29-2015, 08:03 PM
RE: Mob status - by ReonBalisty - 05-30-2015, 05:27 AM
RE: Mob status - by LogicParrot - 05-30-2015, 08:17 AM
RE: Mob status - by LogicParrot - 05-30-2015, 08:44 PM
RE: Mob status - by Jammet - 05-30-2015, 08:58 PM
RE: Mob status - by warmist - 06-16-2015, 03:13 AM
Breeding implemented - by LogicParrot - 11-30-2015, 05:05 PM
RE: Mob status - by Jammet - 12-07-2015, 10:36 PM
RE: Mob status - by LogicParrot - 01-12-2016, 07:11 PM
RE: Mob status - by LogicParrot - 01-12-2016, 10:49 PM
Spawn distance - by LogicParrot - 01-13-2016, 12:55 AM
RE: Mob status - by Jammet - 01-13-2016, 01:49 AM
RE: Mob status - by xoft - 01-13-2016, 03:02 AM
Ball of Mud - by LogicParrot - 01-15-2016, 11:44 PM
RE: Mob status - by xoft - 01-16-2016, 12:13 AM
RE: Mob status - by LogicParrot - 01-16-2016, 03:37 AM
RE: Mob status - by xoft - 01-16-2016, 06:59 AM
RE: Mob status - by LogicParrot - 01-17-2016, 12:14 AM
Smart dogs and spiders - by LogicParrot - 01-23-2016, 05:31 AM
RE: Mob status - by Jammet - 01-23-2016, 11:02 AM
RE: Mob status - by warmist - 03-04-2016, 07:24 PM
RE: Mob status - by LogicParrot - 03-28-2016, 10:29 PM
RE: Mob status - by Jammet - 03-28-2016, 10:30 PM
RE: Mob status - by LogicParrot - 03-28-2016, 10:31 PM
RE: Mob status - by LogicParrot - 04-15-2016, 04:25 AM
RE: Mob status - by hangyas - 09-11-2016, 07:25 AM
RE: Mob status - by LogicParrot - 09-11-2016, 05:56 PM
RE: Mob status - by LogicParrot - 08-05-2017, 10:00 PM



Users browsing this thread: 2 Guest(s)