Mobs refactoring
#6
Quote:When does a zombie decide that breaking a door is a better idea than walking around looking for villagers to maul?
As far as I can remember, vanilla zombies try to break the door until they die or break the door...

But still, let's do "chance" trick:
Each mob has it's "state". From every state every tick every mod has a chance to change it's state to another one, depending on random.
I used such logics in my LudumDare game, and it worked well enough (yes, I was doing minecraft clone within 48 hours).
Quote:Just getting the block array is quite a big deal - each such array is 32^3 blocks copied from the chunks' data
then let's grab whole chunks!
And let's take only those of them, which are close to players. You know, you simulate mobs only if someone can see them. Then you have like 9x9 chunks to copy per player (if they're spreaded across the map), and you're not forced to copy them every tick. Just when player changes environment and when it leaves 3x3 zone with a center in chunk, that was considered 9x9 zone center when we copied chunks previous time.
Reply
Thanks given by:


Messages In This Thread
Mobs refactoring - by xoft - 05-31-2012, 09:22 PM
RE: Mobs refactoring - by Taugeshtu - 05-31-2012, 09:29 PM
RE: Mobs refactoring - by xoft - 05-31-2012, 09:32 PM
RE: Mobs refactoring - by Taugeshtu - 05-31-2012, 09:38 PM
RE: Mobs refactoring - by xoft - 05-31-2012, 09:43 PM
RE: Mobs refactoring - by Taugeshtu - 05-31-2012, 09:51 PM
RE: Mobs refactoring - by NiLSPACE - 05-31-2012, 11:21 PM
RE: Mobs refactoring - by xoft - 05-31-2012, 11:23 PM
RE: Mobs refactoring - by Taugeshtu - 06-01-2012, 12:08 AM
RE: Mobs refactoring - by NiLSPACE - 06-01-2012, 12:40 AM
RE: Mobs refactoring - by xoft - 06-01-2012, 02:33 AM
RE: Mobs refactoring - by NiLSPACE - 06-01-2012, 02:35 AM



Users browsing this thread: 2 Guest(s)