Archived

This topic is now archived and is closed to further replies.

redmonkey

car turning/speed ratio

Recommended Posts

redmonkey    122
ive just added gears, and proper truning to my game, but i havent added any proper turning ratio''s, ie: i still turn whilst at 0 speed rather than use very-realistic speeds, i want a more action based turning, as its a very fast action game, and its a top-down style game i decided the best course is a larger turning circle at high/full speed, and a small turning circle when accelerating quickly. the problem with a simple formula is that moving at a very very small speed (or stopped) turning would be fast... the current used variables include, my steering angle, the velocity, and revs for the car, (whcih affect the velocity by gears etc) can anyone explain a good method? or suggest something? __________________ graham "red" reeves. red@deadpenguin.org www.deadpenguin.org

Share this post


Link to post
Share on other sites
sinful    122
Don't solely rely on the speed factor to determine your turns.
I can make the same kind of turn in a car regardless of what speed I'm going, it just matters when and how I turn the wheel.

But then again, you can't press a "left turn" or "right turn" key down harder to simulate how hard you'd like to turn

So assuming your programming for a keyboard and not a wheel-joystick, this is what my guesses are..

Have the speed of your turn be determined by the speed your car, using whatever which formula you create, and have the arc of your turn be determined by the distance your car is travelling in a second. In other words, clock the distance you travel between every second, if you've moved considerably far, have the turn of your car be larger, if the distance is smaller, have the immediate turn be larger.

So if your speed is 0 then your car would not turn at all, because the car is not moving. If your car is at 0 mph, and you turn your steering wheel, your car's wheels will turn, not the car, until the car is moving.

In the same respect, if your car goes 10 mph, it would turn slowly but in a smaller radius.

If I made any sense I hope it helped :/

Edited by - sinful on January 29, 2001 6:10:18 PM

Share this post


Link to post
Share on other sites
Nekosion    122
You can try to simulate the amount of turn using a keyboard.

The longer the user holds the key down the more "turn" he/she can do... until he gets to full lock of the steering wheel.

Share this post


Link to post
Share on other sites
3dModelMan    204
Hello Graham,

Fix the turning circle with respect to steering input, this is the correct thing to do. A lot of games limit the ammount of steering lock that is available at high-speed, this helps make the car a bit more stable, but not too helpful for a rally-driving sim, or in extreme condiditons when a player might need to apply full opposite lock during a 150mph slide!

All the best.

Matt



Share this post


Link to post
Share on other sites
redmonkey    122
i already ahve the steering lock code in place (thanks matt :])

but i have a kind of mix between my old code, and good code; my car has an angle (for render, future movement) a steering lock (bad name, its the "value" of my steering wheel pos) the revs.

my speed/velocity has already been calculated by the revs etc, but my angle needs work (this will be the final angle, after the world tick)

current code:

if (sprite.speed!=0.0f)
sprite[i].angle-=sprite[i].steeringlock/(28/sprite[i].speed);
// sprite[i].angle-=sprite[i].steeringlock/(28/sprite[i].speed);


//sprite[i].speed=newspeed;
if (sprite[i].speed!=0.0f)
{
sprite[i].x+=float(cosx[(byte)sprite[i].angle]*(sprite[i].speed/10));
sprite[i].y+=float(sinx[(byte)sprite[i].angle]*(sprite[i].speed/10));
}


thats kinda the main bit of code there (thats relative) if anyoene wants to help me further, ill happily upload/send new code (its kidna open source until i get a funding/publishing deal :D)


__________________
graham "red" reeves.

red@deadpenguin.org
www.deadpenguin.org

Share this post


Link to post
Share on other sites