03-08-2013, 02:17 AM
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.
New AI for Mobs
|
03-08-2013, 02:17 AM
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.
03-08-2013, 03:22 AM
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
03-08-2013, 12:53 PM
(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. 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.
03-09-2013, 04:57 AM
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.
03-09-2013, 05:13 AM
Bottom, just like the player
03-09-2013, 04:41 PM
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?
03-09-2013, 06:04 PM
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
Yeah. I saw that... maybe we should experiment to see what the correct values are...
03-25-2013, 01:43 PM
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.
08-13-2013, 01:02 AM
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
|
« Next Oldest | Next Newest »
|