Cuberite Forum
New AI for Mobs - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: New AI for Mobs (/thread-820.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


RE: New AI for Mobs - tigerw - 12-17-2013

How's stuff going? Cannot wait for AI!


RE: New AI for Mobs - SamJBarney - 12-17-2013

Its going good. I haven't pushed anything recently just because I am busy with work, but look for a good chunk of code coming up in the next two weeks.


RE: New AI for Mobs - SamJBarney - 12-18-2013

So I've worked out how I think the restructuring of the mob classes should work:
[Image: Screen%20Shot%202013-12-17%20at%202.24.43%20PM.png]

I'm using cUndead and cBaby as mixins to alter how the mobs act. cUndead will handle daylight burning and seeking shade during the day. cBaby will handle the logic for growing up and following the closest adult of that type.


RE: New AI for Mobs - NiLSPACE - 12-18-2013

Baby zombies don't grow up as far as I know. I could be wrong though.


RE: New AI for Mobs - SamJBarney - 12-18-2013

True, but that is why they do not inherit from cBaby


RE: New AI for Mobs - xoft - 12-18-2013

Is it wise to have separate classes for grownups and babies? When a baby grows up, does it need to be destroyed and recreated as a different class? Wouldn't a flag in the class be enough? (Mojang does that - they have a cAgeable, from which the respective classes inherit.

Also, why have different classes for the different horses, when all they differ in is the color flag? You don't have a cBlueSheep eitherTongue


RE: New AI for Mobs - SamJBarney - 12-19-2013

Xombie and Skeleton horses have to burn. Wink That's the only difference. And yeah, the baby code could probably be moved into the main class...


RE: New AI for Mobs - xoft - 12-19-2013

Loading will be tough for separate horse classes.


RE: New AI for Mobs - SamJBarney - 12-19-2013

Loading?


RE: New AI for Mobs - xoft - 12-19-2013

In the MCA files, you will get a "horse" tag, but you'll have to decide which class to use, then have at least 2 separate functions for loading horses - the normal ones and the undead ones - because they won't have a common horse ancestor. It's not impossible, just... impractical.

Do the undead horses even burn in vanilla? I've never seen one, as far as I know, they aren't obtainable without editors.

I've watched a few videos, the horses don't burn. No point in making them a separate class, then.