Game Development Community

AIWheeledVehicle

by Dubai Coder · in Torque Game Engine · 11/29/2006 (3:19 am) · 8 replies

Hi:

I'm using the following resource with TGE 1.5:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6222


Ofcourse, I didn't modify the source code itself since it seems that the required code is now included in TGE.

My problem is that the vehicle doesn't move along the assigned path, even though it appears at the first node and point forward along the y-axis.


I'm missing something?


Regards,
Hesham

#1
11/29/2006 (2:30 pm)
Ok. I got the AI to move using this script in the onLoadMission:

$Bot = CreateAIWheeledVehicle("MasterBlaster", "carpath");
$Bot.followPath("carpath",-1);
$Bot.setMoveTolerance("2");

The AI players moves fine, except that he doesn't really follow the set path?
#2
12/04/2006 (11:29 am)
Awesome!! It's Great! I may use lovely russian bus!!! LOL:)
#3
12/06/2006 (12:37 am)
I got the path thing to work by breaking down and instaling MS Express and using the following example:

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7079


However, it seems that the setMoveTolerance() method is not a valid method (or not recognized) in torque script for the aiplayer even though I see the method in aiplayer.cc, I have had to hardcode the tolerance value there.

Can anyone explain what I'm doing wrong?
#4
12/06/2006 (2:01 am)
AIWheeledVehicle and AIWheeledVehicle2 are both good resources, but both are very messed and do have unused/incomplete bits in them. The best advice is try to understand and adapt them yourself..
#5
12/07/2006 (1:11 am)
Since the car is moving from one point to another I'm good for now, but I will need to figure out why does the car swerves left to right until it reaches a amrker, why can't it just go to the marker in a straight (or close to straight) line?
#6
12/09/2006 (5:13 pm)
I worked on the steering code of AIWheeledVehicle once, found it had some bugs, and wound up posting a resource that might be helpful. I've been using this code ever since and provides great steering from node to node on a path. No I can't rmember specifically what the issues were but the resource talked about it a little. The resource is really about a viual aid to tune the steering constants.

Take a look and see if it is useful.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8883
#7
12/09/2006 (8:51 pm)
@Sam:

Thanks for the aiwheeledvehicle2 resource, that worked for me great.


@Tim:
Much apprecaited, just what I needed next.
#8
12/11/2006 (7:22 am)
I recall that there were some special case errors in the trigonometry of the original AIWheeledVehicle code that I fixed and that it had to do with cases when the vehicle was precisely on line with the target, causing NaN's and div/0 errors, etc that caused the car to go off heading briefly. So you might want to compare that part of the code carefully to my resource.