Currently I am working with a couple of ai cars, my goal of course is to get them to steer to wed path nodes correctly. I have been tweaking the steering parameters alot, and have not found a good solution.

Any suggestions would help, here is how I am trying to achieve smooth turning to nodes:
Code:

//ai helper functions
function TurnToNode() {
vec_to_angle(my.ang_pan,my.node_targ_x);
my._ang_dis = ang((my.pan%360) - (my.ang_pan%360));
if(int(my._ang_dis) > 0) {
p1carsteer.x = min(1.0,p1carsteer.x+0.2*time);
p1carsteer.y = min(1.0,p1carsteer.y+0.2*time);
p1carsteer.z = 0;
phcon_setmotor(frw_p1id,p1carsteer,nullvector,nullvector);
phcon_setmotor(flw_p1id,p1carsteer,nullvector,nullvector);
}
if(int(my._ang_dis) < 0) {
p1carsteer.x = max(-1.0,p1carsteer.x-0.2*time);
p1carsteer.y = max(-1.0,p1carsteer.y-0.2*time);
p1carsteer.z = 0;
phcon_setmotor(frw_p1id,p1carsteer,nullvector,nullvector);
phcon_setmotor(flw_p1id,p1carsteer,nullvector,nullvector);
}
}



The front tires steering distances are set as:
Code:

phcon_setparams2(flw_p1id,vector(-30,30,0),nullvector,vector(80000,200,0));


Thanks for your help.

-raiden


"It doesn't matter if we win or lose, it's how we make the game."
--------------------
Links: 3DGS for Dummies