New AI for Mobs
#11
I think it'd be easier to have only the active behaviors in the list, so that each tick they get executed, and a higher-level AI controller assigns behaviors to entities based on the entity surroundings.
Reply
Thanks given by:
#12
Add a function GetPriority to each behaviour and make it return a float value based on that behaviour, the current state and the surrounding or whatever that behaviour thinks is important.
After you got all priorities, execute the behaviour with the highest priority
Reply
Thanks given by:
#13
(03-08-2013, 03:22 AM)FakeTruth Wrote: Add a function GetPriority to each behaviour and make it return a float value based on that behaviour, the current state and the surrounding or whatever that behaviour thinks is important.
After you got all priorities, execute the behaviour with the highest priority

Yeah, I can also make a priority queue and just grab the item.


So I've been looking at the code and I figured it out why the mobs were just jumping up and down. The HandlePhysics function wasn't getting called, so they were not changing positions. As a first step, I would like to streamline the moving process for the mobs, and create the helper functions that the behaviors will use. Also implement a path finding algorithm. I'll update this thread with the latest news.
Reply
Thanks given by:
#14
That might have been my fault, I was trying to streamline physics into every entity, so that each entity would call its virtual HandlePhysics() function, but I guess I messed it up for mobs. Maybe even for pickups.

Anyway, I guess one of the very first things on your ToDo list should be figuring out what part of the entity is the pivot point (entity position) really pointing to - is it the XZ center and Y bottom, or Y center as well? That affects quite a few things.
Reply
Thanks given by:
#15
Bottom, just like the player
Reply
Thanks given by:
#16
Yeah, It looks like there are some bugs in the physics functions. I'll have to fix those first before going for the AI.

I agree that the pivot point should be at the bottom.

I have a question. I was going over the protocol for entities and i found this one: "Entity Velocity (0x1C)". Do you guys know what is this packet for?
Reply
Thanks given by:
#17
It sends the current speed of the entity to the client, so that the client may animate the entity without the server flooding it with "position" packets.

There's an issue with that packet, though - it's not really known in what units the speed is measured, the protocol website says one thing, the vanilla MC sources say a different thing, and the actual data on wire say a third thing. Here's my findings summed up:
https://forum.cuberite.org/showthread.ph...97#pid6597
Reply
Thanks given by:
#18
Yeah. I saw that... maybe we should experiment to see what the correct values are...
Reply
Thanks given by:
#19
Now that we have the packets sort it out, Now I am going to make sure that mobs can move without animation errors, and implement the helper functions that the AI and behaviors will use.
Reply
Thanks given by:
#20
Hey keyboard, I was just wondering if you ever got any further working on this stuff? I'd be very interested in helping out on the AI stuff Smile
Reply
Thanks given by:




Users browsing this thread: 7 Guest(s)