Jump to content
  • Advertisement


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


car turning/speed ratio

This topic is 6379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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
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
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.


Share this post

Link to post
Share on other sites
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);

if (sprite[i].speed!=0.0f)

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.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!