## Re: [tuxracer-devel] Course precisions

 Re: [tuxracer-devel] Course precisions From: Steve Baker - 2000-04-20 03:27:28 ```Jasmin Patry wrote: > > On Wed, 19 Apr 2000, Steve Baker wrote: > > > Jasmin Patry wrote: > > > > > I was thinking of doing a Tomb Raider-style camera update, using > > > quaternions, but your idea would also work. > > > > I've never played Tomb Raider. What does it do? > > The camera basically follows behind Lara (the main character), except > that when she turns, the camera smoothly "orbits" around her until it's > behind her again. Yep - that's exactly what happens in TuxKart. All you need to do is to store up the coordinates of the player in a 30 element (or so) FIFO - taking the coordinate that's 30 frames old and using that as the place to point the camera. When you are driving in a straight line, the camera is exactly behind Tux. When he turns right, you see him head towards the right hand edge of the screen and see him rotate - but only for a half second or so before the camera starts to turn too. So long as Tux turns, so he stays on the right side of the screen. Another thing I liked (but hadn't *planned* to happen) is that when you hit the accellerator button, Tux shoots away from the camera so you see him speed up - then a moment later the camera does the same thing. It gives you a much better feeling of speed. Also, when Tux is driving fast, the camera hangs back further than when he's going slowly and carefully. For something that was just experimental, it worked out really nicely. > I assume they use spherical linear interpolation of > the quaternions, and a formula similar to this: > > new_orientation = slerp( alpha, old_orientation, final_orientation ) > > where alpha is some constant between 0 and 1 (larger values result in > faster camera movements). > > I was thinking of doing this in camera mode two (where the camera is > behind Tux and looks in the direction he's moving). Yes - I think it would help. Sudden jerky camera moves are always rather unpleasant. > As an aside, I already use quaternions to smooth out Tux's orientation, > using that exact formula above -- it makes a *big* improvement. Yep. > > > I'm pretty sure that there are coins in MarioKart too -- you lose them > > > when you bang into other people, and you "die" (run out of gas?) when > > > you run out, I think. It's been a long time since I've played, though. > > > > Oliver (my son) says "No Way!" - and he's an expert. :-) > > Well, perhaps I'm hallucinating. But to be sure I'll pull out the old > SNES when I go visit my parents this weekend. :) Oh...that explains it! You are talking about the SNES version - that could very well be different from the N64 game - which is what we have. As for 'health'...oh...Oliver wants to type... O> Mario-cart has health in the battle game but not in the race. O> In the battle you both have 3 balloons tied on to your O> car and every time you crash or get hit by a missile or run into O> a bomb one of your baloons floats away. O> If you lose them all, you lose the battle. (Me again) Yep - I forgot - it has race levels AND a 'battle mode' where you just drive around shooting stuff at each other. I don't think that translates over to a downhill snowboarding kind of a game. -- Steve Baker http://web2.airmail.net/sjbaker1 sjbaker1@... (home) http://www.woodsoup.org/~sbaker sjbaker@... (work) ```