Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, VoroneTZ), 456 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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 | chip programmers | 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