Update on Bird AI

So I was trying to get the vultures to circle above the player and then swoop down and attack if his health is low. Most of the day this was met with an OutOfMemory error. So I went through and cleaned out the code and refactored a great deal. Now its as clean as a whistle. Haven't managed to get them to really "circle" yet but they clump at different altitudes.

One of the problems I have is that I technically set an acceleration by increasing motionY by a factor, as opposed to setting it to a fixed value in a direction. The theoretical advantage here is the entity will natural speed up/ slow down at changing in direction. The problem is that the speed can get so great that the entity moves past the bound and out of range before they slow down enough. Alas, heres a pic of the Vultures above clumping.




No comments:

Post a Comment