Spline path system (how does it work)?


(Mean Mr. Mustard) #1

Ok. I’m struggling try to get a truck to follow terrain (without either floating in space or ploughing into the ground). Just trying to get it to follow a simple ramp (0 degrees terrain, to 30 deg slope down, back to 0 degrees) seems nearly impossible.

So, I have a few questions. (the truck’s origin is at the back of the model)

  1. Does the origin follow the spline path visualized by bobtoolz in radiant? (my guess is yes)

  2. How is the angle of the vehicle determined? (it seems to be some combination/average of angles of the spline points it’s between)

  3. Say you have 3 spline points. Starting at 1, the vehicle travels to 2. At some point, the 'front of the truck goes passed point 2. Now, is the angle of the vehicle dependent on all 3 spline points?

I imagine you need to use control points for the above ramp example. Could someone post a diagram of of how to place the spline main and control points to do the ramp example?

I’ve been :banghead: for days now and am still quite confused…


(hummer) #2

Heh… I assume this has to do with the truck scripting from my map.

I gotta admit, I pretty much gave up on getting the truck to look “good” while going over hills and whatnot. I easily spent two weekends going at it. Mean Mr. Mustard was nice enough to volunteer his time to give it a shot.

Anyway, why was the origin of the truck placed at the rear of the model (under the bumper), and not at the center or even the rear tires?

Also, it seems like the front end of the truck raises or lowers depending on the placement of splines a few splines in front… So, at spline 1, the angle isn’t based on spline 2, but spline 3 and maybe 4… that’s what is seems like anyway.

Blargh.


(Mean Mr. Mustard) #3

Lol! Yeah, I’ve spent 2 days getting the truck to go up a hill then level off. Then I spent another day getting it to come down. 3 days on like 4 or 5 spline points… it’s just frustrating. It seems like it’s just trial and error, move this point, move that point…

I think I have something that looks ‘decent’ - not good, yet

So, it would be nice to have a little ‘theory’ behind the spline path system - this way I might be able make some educated guesses at placing the spline points

How about if we give you dancing bananas in exchange for some info?

:banana: :banana: :banana:


(ausman) #4

if it took you 3 days to do to splines at a couple of different angles i’m gonna be in a big pickle. I have to get a train to move up a slope with about 6 different gradients while moving through 2 major turns, I hope thoughs bananas can give out some good answers :banana:


(Mean Mr. Mustard) #5

It all depends how steep the gradients are. If they aren’t too great, then it’s not a problem (so keep that in mind when you do the terrain…)

Curves are so much easier…


(sock) #6

Yes because the truck looked silly based in the middle of the model. Lining up the origin on the back axle is alot easier.

Yes, thats why djbob created the tool.

This is something that djbob can answer better, but basically use the editor spline path drawing tool. (It shows you exactly where it will go) Try not to use multiple control points as well, because they are CPU intense. (Its all calculated in real-time) If you need greater degree of turning then use more spline points.

Yes, that is why all of the tanks/trucks in the original maps are moved to initial spline points and then moved on by one point. The previous/next spline points do affect the current angle of an object.

If the brow of the hill is shorter than the total length of the vehicle then you will have problems. The vehicles do not have ingame suspension systems and do not bend and flex. They are basically a solid tree trunk following a spline path.

Sock
:moo:


(digibob) #7

But only while the vehicle is blending around the corners, once this is finished, only the 2 points are relavent again, until again you are blending around the next end.