like it?! okay…well i thought it was funny but aanyway i have to ask some thing. if u know any racecar a.i. please check this out. http://www22.brinkster.com/iceduck/gokart.blend if anyone could improve the a.i. in it i would thank u. i have given an ampty an animation around the track and the kart track to it so it will slide around corners and stuff but thats not the greatest cause if u hit it, it will get stuck on the corners.
this is my back up entry. if MUTE EVER FINISHES TEXURIZING the first entry i could work on it some more.
In college at the mo so can’t check out the blend but I did a similar thing a while back. I managed to put empties (like waypoints) around the track and numbered them with properties and got the AI cars to track to the one with a certain number. When they got near to the empty they switched to track the next numbered one.
yup still need help. but the waypoint thing makes perfect sence. that would maybe work better. hey now that i think of it it would work better because with multiple racers u need different animations but with this all u do is just change the car settings! a bit more work but pays off in the long run! thanks. anymore help?
I cant find the blend i had with this in so my explanation here may be a bit wayward
Anyway heres what i think i did:
create an empty, call it whatever, and give it a property called ‘waypoint’.
copy it and put one at each corner, or basically around the track, making sure they have a clear line-of-sight to the next,
for each AI car give them an integer property called ‘nextwaypoint’ or something
add a near sensor linked to a property actuator, the near sensor should only look for objects with the waypoint property and the actuator should add one to the nextwaypoint property
sleep for a bit, the next bits a pain
the car will need a property sensor linked to a track to actuator for each waypoint around the track
change the property sensor so it only fires when nextwaypoint has the value of that particular waypoint, and add the name of that waypoint in the trackto actuator (so it tracks to the 3rd waypoint when nextwaypoint is 3)
also need another property sensor and actuator to reset nextwaypoint once it reaches the last waypoint, to make it start tracking the first one again
It is a bit complex, you end up with quite a few logic bricks for each AI car, but the results are pretty cool. This allows cars to slide realistically around the corners and stuff.
Hope the above makes sense, if not just shout and i’ll try and recreate the blend, i know it works (no, really!)
But it looks like your getting some good help anyway:)
The gist of what I tried to do, is I had a sensor on the left and a sensor on the right. The left sensor would tell the car to turn RIGHT if it got to close to the wall on that side, the right sensor would tell the car to turn LEFT if it got to close to the wall on that side. I made the two sides (left wall and right wall) have different properties so the car would know when it was going the wrong direction. Unfortunately, this check had to be used often, because the car would alway be turning around wrong:):)
I also had checks in there for it to adjust its speed and stuff, but none of it worked very well.
saint_pill i’m fine with tedous logic bricks (heck thats all i do just make little games try to stump myself then figure it out) so i can manage that and saluk i think your’s probably would work better on a round corner track instead of a strait corner bacause in a round corner it would be in the middle all the time and a strait corner the distance from the walls would be different then once it got close to the end of the corner it would get mest up right? is that why it always kept turning around? i’m not sure just thought it would do that so am i right in that the strait corners would mess it up?..or is it that when it got close to a wall it would oversteer veer to the other wall even harder then before then just escalate oversteering too much? well thanks both of u i might just try both.
my car strech limo /—__ __/---------------_
-0----0—] [–0----------------00–
Well, I got it to where it would make it around my track once, but when it neared the finish line it would get totally screwed up and turned around. It was also a bit easy to get past it, cause it didn’t turn good:) I think by the time I called it quites, I had 3 sensors on each side, 1 pointing straight out, one pointing up and out, and one almost pointing straigt forward. It was a good idea, but, oh well:)