Mob AI.
#5
I think the current AI is very crude and is split across way too many places. So it could use some polishing. And perhaps some helper functions like WalkToBlock(x, y, z) that would schedule the walk onto that block, if possible. Then it'd be really easy to modify AI behavior using plugins, too.

I'm already working on the very first step needed for a better AI, and that is "surrounding block scanning" - the mobs need to be able to query their nearest surroundings (4 blocks away, 16 blocks away etc) and see if they like something in there or for path-finding. For that they need the cBlockArea object that I'm writing right now, so that they don't spam the cWorld:GetBlock() function, which is very low-throughput (it needs to lock the chunk storage, find the correct chunk and only then query the block type). Using the cBlockArea they can make a snapshot of the surroundings and query that snapshot without locking or chunk-traversal. I think it'd be best if path-finding would get a rewrite to use this object, too.
Btw. mobs walk away when you hit them, but if they walk into a tree in that direction, they just stop and stand there, and the server console is spammed with warningsTongue
Reply
Thanks given by:


Messages In This Thread
Mob AI. - by rs2k - 11-10-2011, 10:14 AM
RE: Mob AI. - by ThuGie - 11-10-2011, 04:48 PM
RE: Mob AI. - by NiLSPACE - 07-01-2012, 07:53 PM
RE: Mob AI. - by NiLSPACE - 07-02-2012, 12:30 AM
RE: Mob AI. - by xoft - 07-02-2012, 12:52 AM
RE: Mob AI. - by NiLSPACE - 07-02-2012, 12:56 AM



Users browsing this thread: 1 Guest(s)