Mob status
#29
The more this is discussed, the more I start believing that we've gone the wrong path with pathfinding.

It might have been better to have each mob have an "AStarField" that has a cube of predefined size (mob sight) around the mob with calculated A* cells, and then be able to construct paths out of this field, with questions like "Get path to point B", "Get path to the point nearest to point B", "Get the point nearest to point B that is reachable" etc. It would be much easier to write the mob AI with these methods.
Also, updating the field would be necessary only when the mob moves out of its current block coords, which is very cheap for slow mobs, zero cost for mobs that are currently stationary and still cheap enough even for fast mobs. I don't have any mob speed data, but I'd guess the speed to be less than 4 blocks per second, which would make the maximum recalculation rate some 6 times per second (moving along a diagonal). Given that the field's size is rather small, it should be possible to just update the field in a single step, rather than dividing the work across multiple ticks.
My assumption is that the mob sight is rather limited, some 24 blocks, which means the field would be sized 48 * 48 * 48 blocks, with normal worlds being more on the 2D side of things, so something like N * 48 * 48 ~~ N * 2000 cells to be expanded per recalculation.
We could also have a lazy recalculation - when the first pathfinding request comes, put the field in a "to-update" list, out of which only constant amount of work is done in each tick; the pathfinder would simply return a "NotNow" response. The AI would retry the task on next tick, and only after the field is recalculated, it will receive a positive response and could act accordingly. This could make the server quite robust against entity CPU overload.
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: 9 Guest(s)