I stumbled across the cause of this today. The problem is not the joystick, in fact my tank started drifting left after turning left, traveling at 0.2 kph, and I do not have a joystick installed.
The game engine uses in-line assembly and bit shifts to multiply and divide. Using this type of math, you can have an error as high as 0.5. The error is rounded down. When the value is positive it is not a problem since 0 can be reached. If the value is negative, you can end up with -1 being the closest you can get to 0.
Original code
// tankMovingDir=rrCoordMul( tankMovingDir , tankRadiusMod );
// tankMovingDir=rrCoordMul( tankMovingDir , rrToCoord(systemSpeed) );
New code
tankMovingDir=(rrCoord)((((tankMovingDir * tankRadiusMod)/65536.0)*(systemSpeed*65536.0))/65536.0);
I have added this fix to the hull direction in latest test code for the terrain following physics. If someone has this problem and can replicate the problem using PE-x or PP2-x, I would appreciate confirmation if the drifting left after turning left is cured.
http://home.comcast.net/~ab707/pex/beta/test14.zip
If it is fixed, I need to do the same for:
maxTurmStep=rrCoordMul( userInterfaceAngelPerSec, rrToCoord(systemSpeed) );
and
maxKannonStep=rrCoordMul( userInterfaceAngelPerSec, rrToCoord(systemSpeed) );
On a separate subject, I just finished reading US Army FM_17-12_Tank_Gunnery_1943.pdf. If you have not read it you should.
Edit: If you have the problem using PESE, try lowering your in game FPS.
Last edited by Brit44 'Aldo'; 01/23/15 12:53 AM. Reason: fix for PESE 1.2