SA-MP Forums The "Real" vehicle speed thread
 User Name Remember Me? Password
 New Account Members List Search Today's Posts Mark Forums Read

 Thread Tools Display Modes
 29/07/2012, 05:54 PM #1 Sinner Gangsta     Join Date: Aug 2010 Location: On This Mortal Coil Posts: 771 Reputation: 292 The "Real" vehicle speed thread There's been a lot of discussion about what the actual max. speed should be when it comes to SA-MP vehicles. This thread discusses this. I think, though, I have found the most accurate max. speed possible. As we know, the max. speed of any vehicle can be calculated using the following formula (KM/H): pawn Code: `// vX = X velocity of the vehicle// vY = Y velocity of the vehicle// vZ = Z velocity of the vehicleSTEP1 = vX² + vY² + vZ² (Law of Pythagoras)STEP2 = SQUARE ROOT of STEP 1STEP3 = STEP2 * magic number` "the magic number" Is the number everyone has been looking for. Some people have proven that around 180.0 should give a fairly accurate result (which makes the max. speed of the Infernus, the fastest vehicle in the game, around 223 KM/H). We will now try to prove this correct. Fact: Most of the cars in SA-MP are derived from real life vehicles. The Turismo is clearly a Ferrari F40 so we will use this as the base for our calculations. Ferrari F40: Turismo: The max. speed of a Ferrari F40 is equal to 324 KM/H. (Source: http://en.wikipedia.org/wiki/Ferrari_F40) Running the following code in a very fast loop, we can determine what the highest possible velocity is when a Turismo in SA-MP reaches his max. speed. This was done on a straight road and without nitrous. pawn Code: `// vid = current vehicle we are in// Model 451 = Turismoif(GetVehicleModel(vid) == 451) {    new         Float:speed_x,        Float:speed_y,        Float:speed_z    ;    GetVehicleVelocity(vid,speed_x,speed_y,speed_z);    printf("[Velocity] X=%f, Y=%f, Z=%f", speed_x, speed_y, speed_z);}` We get the following result (these will vary ofcourse, but the calculations will always have the same result): pawn Code: `X = 1.072348Y = 0.008095Z = 0.000000` We can than calculate the magic number when the final speed equals 324: pawn Code: `X² = 1.072348 * 1.072348 = 1.149930233104Y² = 0.008095 * 0.008095 = 0.000065529025Z² = 0.000000 * 0.000000 = 0.000000000000SQUARE ROOT (1.149930233104 + 0.000065529025 + 0.000000000000) = 1.0723785535569983324 = 1.0723785535569983 * mNmN = [B]302.13[/B]` So the "magic number" is equal to 302.13 (see test above), this though makes the top speed of the other vehicles out of proportion... A bus suddenly goes over 250KM/H!! I guess this issue is unsolvable and we need to search for an acceptable number somewhere in the middle. __________________ Please use the search feature before asking a question.
 29/07/2012, 08:13 PM #2 Arca Big Clucker     Join Date: Jul 2012 Location: Plano, Texas, United States Posts: 171 Reputation: 33 Re: The "Real" vehicle speed thread Well I use 250.666667 for kmph and 199,4166672 for mph as the magic number but there are even more calculation needed to get the most of the accuracy. My formula is the same as yours and for everyone else. From where did you get this number 180.0? __________________ Code:
30/07/2012, 07:31 AM   #3
Sinner
Gangsta

Join Date: Aug 2010
Location: On This Mortal Coil
Posts: 771
Reputation: 292
Re: The "Real" vehicle speed thread

Quote:
 Originally Posted by Arca Well I use 250.666667 for kmph and 199,4166672 for mph as the magic number but there are even more calculation needed to get the most of the accuracy. My formula is the same as yours and for everyone else. From where did you get this number 180.0?
Top speeds seemed to make sense somehow when I used 180.0
__________________
Please use the search feature before asking a question.

 30/07/2012, 09:34 AM #4 Mauzen Banned   Join Date: Jun 2007 Location: Western Germany Posts: 4,897 Reputation: 1597 Re: The "Real" vehicle speed thread The unit of the coordinates is known as meters, so for the best matching GTA properties you can just compare the travelled distance to the velocity. Most accurate on a straight and plane are.
 30/07/2012, 12:06 PM #5 Vince Spam Machine     Join Date: Sep 2007 Location: Belgium Posts: 10,092 Reputation: 2655 Re: The "Real" vehicle speed thread The max speed of every vehicle is listed in the handling.cfg data file. The Infernus is listed as the fastest vehicle with a top speed of 240 Km/h. To achieve this, I multiply with 195.12. It doesn't work for every vehicle though. There must be another factor involved. Some roads seem to affect speed as well. Try getting to top speed on The Strip; it just doesn't work. Code: ```; > UNITS < ; --------- ; vehicle identifier 14 characters max ; dimensions in metres ; mass in Kg ; velocity in Km/h ; acceleration/deceleration in ms-2 ; multipliers x1.0 is default ; angles in degrees ; Levels :- (L)ow, (M)edium, (H)igh ; buoyancy = percent submerged (> 100% vehicle sinks) ; engine type :- (P)etrol, (D)iesel, (E)lectric ; engine drive :- (F)ront, (R)ear, (4)-wheel drive``` __________________ [Tutorial] Database normalization: Vehicle components - Weapon data - GeoIP and rangebans - Association tables Useful: How NOT to store passwords
 06/08/2012, 06:23 PM #6 playbox12 High-roller     Join Date: Feb 2010 Location: Netherlands Posts: 1,319 Reputation: 216 Re: The "Real" vehicle speed thread Bikes are extremely unrealistic in this game. I wouldn't worry about them to much, also most vehicles have unrealistic speeds, this is probably done to keep the game fun. I wouldn't want to drive in a realistic bus, or fly in a fighter jet that reaches mach 2.
 06/08/2012, 08:03 PM #7 Joe Staff High-roller     Join Date: Aug 2007 Posts: 2,567 Reputation: 377 Re: The "Real" vehicle speed thread I determined my magic number by simply forcing the velocity of a vehicle to X: 1, Y: 0, Z: 0. Then I measured the speed through distance over time. I don't remember the number I came up with. I think it was on average 192 __________________ Big bottom girls make this rockin' world go 'round.
 06/08/2012, 09:14 PM #8 Vince Spam Machine     Join Date: Sep 2007 Location: Belgium Posts: 10,092 Reputation: 2655 Re: The "Real" vehicle speed thread Which is pretty much consistent with the 195.12 I came up with. __________________ [Tutorial] Database normalization: Vehicle components - Weapon data - GeoIP and rangebans - Association tables Useful: How NOT to store passwords
 12/08/2012, 09:07 AM #9 zugg48 Little Clucker   Join Date: Feb 2011 Posts: 22 Reputation: 3 Respuesta: The "Real" vehicle speed thread
14/08/2012, 11:56 PM   #10
Mauzen
Banned

Join Date: Jun 2007
Location: Western Germany
Posts: 4,897
Reputation: 1597
Re: Respuesta: The "Real" vehicle speed thread

Quote:
 Originally Posted by zugg48
I like the acceleration part, i was trying to measure it itself, but this is more precise. This might become handy for RNPC vehicles.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Deal-or-die Scripting Help 6 01/05/2012 12:08 PM Donya Help Archive 4 11/06/2011 09:20 PM Rubennnnn Help Archive 1 02/12/2009 06:08 PM ssflsnoob General 2 23/11/2008 06:06 PM

All times are GMT. The time now is 12:16 PM.

 -- (EN) English -- (RU) Русски SA-MP - Archive - Top