Aiming in a twin stick shooter

I am trying to implement a twin stick shooter game, sometimes referred to as dual stick shooter where the left stick controls movement, and the right stick aims a gun.

What I do now, is directly map the stick angle to the gun angle, if the deflection is large enough. In pseudo code:

// jx in [-1,1]
// jy in [-1,1]
if lenght (jx,jy) > 0.5 :
gun_angle = toangle( jx, jy )


This gives a very unsmoothed, twitchy signal for the aim.

The gun can flicker in any direction in a single frame.

In theory, the most responsive scheme, but on-screen looks far too twitchy.

So I wonder: should I sacrifice some responsiveness for a smoother signal?

Should I make the gun swivel around as I reverse the direction of the joystick, or just set it hard, like I do now?

I've been considering using the stick signal as input to a PID controller that does the actual gun rotation, but would like to know whether that's an appropriate solution for this application.

• I've played dual-stick shooters where the rotation is instant as you describe, and other dual-stick shooters where the character/barrel has a maximum turning rate. Both seem to be viable ways to make such a game. So the route you choose may just be up to your own player experience goals and design judgement. Which is more important to the specific game you're making - responsiveness or smoothness of animation? Or are you willing to sacrifice a little plausibility to get both, showing smooth rotation while changing the direction of shooting instantly? – DMGregory Sep 29 '18 at 11:55