AI Libraries for Panda3D

I imagine there’s nobody willing nor able to make some small improvments to the ai for 1.9?

My wishlist isn’t long, just a few changes to the API.

AIBehaviors.pathFindTo(target, type)
the target can be a node or a pos but the type can only be ‘addPath’ (a string).
This should be AIBehaviors.pathFindTo(target, addPath=False), True and False is all that is needed here.

There’s also one more problem with pathFindTo - if you pass a target that can’t be reached you will get a message in the console and that’s it. There’s no way to tell if this function failed to find a path, you can only ask about the ai status (but if the character was moving to another target all you can do is to check if the point where the character stoped is the point you wanted him to go to).
This function should return a list of nodes that lead to the target or an empty list if a path can’t be found.
This one change would solve 90% of the problems I have with the AI and allow to write custom movement code, evaluate movement cost, make turn based systems etc.

AIBehaviors.behaviorStatus() - this function takes a string and returns a string. It would be much better if there where some known constant ints not a set of hardcoded strings… as it is with any other p3d class.

AIWorld.update() - this would really be so much better if you could pass a delta time to scale the movement by current fps.

If I had any skills in C/C++, I’d make a patch myself, but I don’t have any :frowning: