Hello. I'm using JMEPhysics for some aspects of my game, but I'd like to remove some of the fudging and delegate more to physics. My game is arcade-style, though, so I'm a bit confused as to how to pull this off.
I currently have a spaceship. The player flies by applying forward thrust with gradual acceleration up to a speed of 5. Without this acceleration, the ship slowly glides to a stop. The player also steers left and right, but always faces in the direction of motion.
I'm currently accomplishing this by setting linear velocities directly, and with a controller that applies a constant deceleration to the ship when it is in motion. I'd like to move more to a force-based system, however, as I've been reading up on AI and see how various motivations can apply forces of differing strengths to produce realistic-looking behaviors. I'm just not sure how to replicate this system more closely in line with the physics engine.
Acceleration/deceleration seems mostly straight-forward. I can apply a force along the entity's direction of motion, then do a bit of fudging to cap the speed at 5. I'm still debating whether I should retain my original fudgy deceleration, or place the objects on a surface with friction. I want some of them to continue moving, though, so it may be easier to retain this model.
I'm not certain about turning, however. I've been reading AI for Game Developers, and its models seem to use port/starboard thrusters that simulate drag, so objects turn more slowly at higher speeds. This would be a nice addition, but I'm not sure how to implement it. I've thought about torque, but I've always thought of that as more for engines and joints. Can it model nose thrusters as well? Or should I instead apply perpendicular forces? This would modify the velocity, and my DirectionVelocitySyncer controller would point the nose along the direction of the velocity vector, but this wouldn't work for a stationary vehicle, so I'm thinking this isn't the way to go.
Thoughts? This probably isn't what the physics engine is intended for, but I do like and use enough of its features such that it would be more troublesome to scrap it.