Author Topic: Want to create a racing script, but stuck.  (Read 2863 times)

Offline saljutin

  • Level 22
  • *
  • Posts: 260
  • Reputation: +6/-0
    • View Profile
Re: Want to create a racing script, but stuck.
« Reply #25 on: December 10, 2009, 04:57:54 AM »
when fictional end speed is bigger then your max speed V=110
and then you use this
V/a when you input 110 as V and you get 31.1s
MEANING that your car will need 31.1s to accelerate to speed V, then you need to find out how much Snew will he drive in that 31.1s, and then (S-Snew) would give you distance that car travels with max speed = 110

Offline cdoyle

  • Level 11
  • *
  • Posts: 67
  • Reputation: +1/-0
    • View Profile
Re: Want to create a racing script, but stuck.
« Reply #26 on: December 10, 2009, 06:17:13 PM »
when fictional end speed is bigger then your max speed V=110
and then you use this
V/a when you input 110 as V and you get 31.1s
MEANING that your car will need 31.1s to accelerate to speed V, then you need to find out how much Snew will he drive in that 31.1s, and then (S-Snew) would give you distance that car travels with max speed = 110

hopefully I'm getting close with this.

So if it takes 31.1 seconds to get to the max V of 110.
To get snew  it would be  snew = 1/2 * 3.5 * 967.21    (right?)
snew=1692

now if my total distance for the car going 110 is
S-Snew  == 2500-1692=808

am I right so far?  I'm not sure what to do next?

Offline saljutin

  • Level 22
  • *
  • Posts: 260
  • Reputation: +6/-0
    • View Profile
Re: Want to create a racing script, but stuck.
« Reply #27 on: December 11, 2009, 05:09:45 AM »
man you need to think more with that head u have :)

1. accelerate to max speed
-> if maxspeed is reached before course do 2. and 3.
2. calculate distance that car is traveling on max speed
3. calculate time that car needs for traveling along that section

so you have 1. and 2. calculated :) now you must calculate 3.
car travels at 110m/s for 808m ?
formula S=V*t => t=S/V

t for last section t=808/110=

Offline tellmore

  • Level 12
  • *
  • Posts: 85
  • Reputation: +3/-0
    • View Profile
Re: Want to create a racing script, but stuck.
« Reply #28 on: December 31, 2009, 08:30:42 AM »
You don't need help with the code.
You need help with math and physics.

http://en.wikipedia.org/wiki/Uniform_acceleration

thats what you need. scroll down for the formulas.
and to give a more specific answer, yess, top speed is limited, you can calculate distance a car can go while it accelerates from 0 to top speed (constant acceleration) , then the remaining of the section is managed with full speed. (unless the poor thing has to slow down for next corner, but you can calculate when the car should start to hit the brakes)

it takes a bit of time if you did not use what you gained in school.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal