AI Wandering Backwards/Other Questions

I’m working on some AI for an enemy ship class, and I’m planning on using a mix of FSM, panda3d.ai and a few custom methods.

Focusing on the wandering, I recently switched to using the wandering ai packaged with panda, and I found it odd that it’s making my enemy ships flying backwards.

Things I know:

  1. The model is a simple triangle, pointing forward in the y plane upon creation.
  2. Using a call like this moves it in the proper direction:
self.model.setY(self.model, self.currentSpeed * self.world.dt)
  1. using the wander ai makes the ship move beautifully in the opposite direction.

Another thing I’m wondering about is the wander Area of Effect - it says it’s the radius from the ‘starting point’. Is there any way to make that a specific point in space? My ships enter the screen from the edge, but I’d like them to wander around the center of the screen.

Last thing is I have a border set up on the edges of the screen. I have Into Planes set up there, and From collision spheres on the ship. Since it’s using the wander AI, how can I prevent it from going through the plane and instead bounce off or something and keep wandering?

Cheers! Time to hide from Hurricane Irene… =)

Alright well, sans any other approach I can think of, I remade the model… backwards. Seems to do the trick for when the model is moving due to the wander AI. I guess I’ll just have my other movement methods go in reverse, I guess.

I’m still trying to figure out how to get a handle to the movement information provided by the AI. I need to be able to have events, like hitting something, make the movement be altered and reflect.

Thoughts?

You could just turn the model node 180 degrees when it is wandering.