Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,253 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Any suggestions for ai steering??? #64680
02/20/06 05:08
02/20/06 05:08
Joined: Sep 2003
Posts: 281
Arkansas\USA
raiden Offline OP
Member
raiden  Offline OP
Member

Joined: Sep 2003
Posts: 281
Arkansas\USA
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
Re: Any suggestions for ai steering??? [Re: raiden] #64681
02/21/06 21:49
02/21/06 21:49
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
This looks like a good start. You should add differential steering since both wheels do not need to be turned at the same rate. Make sure you change the active node early to prevent cars from circling around a node when they get too close.


Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1