Cars aligned with track

Blitz3D Forums/Blitz3D Programming/Cars aligned with track

Ash_UK(Posted 2005) [#1]
I am trying to get my cars to stay on the track and look as if they are actually aligned properly.
For example i have some tracks with elevations and twists but my cars seem to lose their positions and float off.
I need a way to get the cars to stay on the track no matter what, just like in f-zero X.

Thanks


IPete2(Posted 2005) [#2]
Goldwing,

Perhaps you could use a bank to store data in as you drive around the track yourself, recording the x,y,z,pitch,yaw,roll every few milliesecs. Then store this off and load and play it back. The 'ghost' car will drive your exact path as it reloads and keeps up with your recorded data.

Do this a few times for different lanes, lane 1, lane 2, lane 3 etc. and you will have the necessary data to be able to have cars switch positions from lane to lane as the race around your tracks, as long as they dont collide with another car on the same track (i.e. keep them apart by using an index and keep two cars index so many apart from each other).

IPete2.


Ash_UK(Posted 2005) [#3]
Ahh, i shall see if i can put that to use :D
Thankyou so much IPete2!
:)

Thanks again


Stevie G(Posted 2005) [#4]
I think IPete has replied to the wrong thread there ;-)

Do a linepick straight down and use aligntovector with the pickednx, ny, nz on the y axis.

Stevie


Ash_UK(Posted 2005) [#5]
What would could i do if the player car crashes into one of the opponents cars?

Thanks


Ash_UK(Posted 2005) [#6]
Hmmm, thanks stevie :D, sorry but i didn't quite understand how you meant when you said "Do a linepick straight down and use aligntovector with the pickednx, ny, nz on the y axis."
I am so sorry, it's just that i haven't really used these sort of commands before :) Could you break it down into simpler steps for me please?

Thankyou so much :D


IPete2(Posted 2005) [#7]
I think what Stevie means is use the linepick to find out what polygon is below you and what angle it is on, then use aligntovector for the orientation of the car based on the poly's angle below you.

If the slope is up then the car can follow the angle you get from the aligntovector...er I think.

But what Im saying is once you have that, you can drive one car around a few times and get the other cars to follow the data you record, and have multiple lanes on the track.

IPete2.


Ash_UK(Posted 2005) [#8]
Cheers IPete2 :D You have been a great help here. Hopefully, i can get AI cars driving driving round properly by using your data recording technique.

Cheers man :)


ryan scott(Posted 2005) [#9]
goldwing
the recorded data should probably be what the cars strive to achieve. but if you bump them they would go off recorded data. but they'd still follow it, and try to get back on it.

so you'd have your recorded information, you move your actual location a little closer to the recorded information.

at least that's the basic gist, but you obviously need to write specific code to do that!