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:
- The model is a simple triangle, pointing forward in the y plane upon creation.
- Using a call like this moves it in the proper direction:
self.model.setY(self.model, self.currentSpeed * self.world.dt)
- 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… =)