The "Real" vehicle speed thread
#41

Why did you put such an effort in calculating while there are already formulas and also top speed values documented 8 years ago: http://gtaforums.com/topic/216347-gt.../#entry3209126
All you need additionally are the float values to get the magic number.

It's really annoying that there isn't almost any source that mentions the correct top speed values of the vehicles in San Andreas. Even so called "GTA wikis" have all the wrong speed values as too many people think that the N column in the handling.cfg is the real top speed although it is only a "artificial" limit that with normal acceleration mode will never be reached as long as other values like drag or egine acceleration are not changed. Also I wonder that servers have anti cheats but dont uses these top speed values to detect speed hackers. Oo
Reply
#42

That is a very good link, I think that really put the baby to bed Cypog I was getting pretty much all the same values.
Reply
#43

Well I've just read 1st page and the last page, so please don't complain too much for this post.

Well I was working on the speed system for my server and wanted to make the most reaslistic speed. With realistic I mean speed that are compared with the car performance in game. So to do this I basically used GetVehicleVelocity to see the highest number I could get on a car. Then I went into "handling.cfg" on GTA file to see the top speed of that car. I used infernus for this.

So all I had to do was take the speed from getvehiclespeed (had to do ofcourse the square root of the sum of the squares of x y and z speed) *240 (in files top speed of infernus) / 1.229576 (the top speed I could get with getvehicle speed for infernus).

The values are pretty accurate in my opinion. I tested with Coach which reached a top speed of 170 km/h, though in files it only reaches 160. So I think I failed to reach top speed with infernus in game, so if you're going to use this make your own calculations with another slower vehicle, that way you'll have more accurate results.

Thanks for reading, sorry for bumping and sorry for not reading the whole thread but I was lazy for it and wanted to share this. kthxbai
Reply
#44

The "handling.cfg" file has no relevance until you apply the correct formulas I guess you didn't read this page.

http://gtaforums.com/topic/216347-gt.../#entry3209126
Reply
#45

The value you described (180.0) as magic number would be accurate for kph.

I found a value of 179.0 using a real test with checkpoints on my own home-hosted server.

For mph, divide that number by 1.6 and you get 111.875.

I've done a few tests myself:
http://forum.sa-mp.com/showpost.php?...postcount=4231
The entire explanation is in there.
Reply
#46

It's not going to make much of a difference and will never be accurate 100 percent but 179 should be pretty good.
Reply
#47

Alright guys, I think the magic number is ~196.72 (for KM/H), let me explain you how I found it:

- I assumed that the coordinates system in GTA is equal to 1 meter
- I calculated the distance (in GTA coords) travelled in 1 second by an Infernus, which resulted in ~67 coords/s = ~240 km/h (the same in handling.cfg ??)
- Now I compared the speed traveled to the vector that the GetVehicleVelocity gave me (On a single axis) and was about 1.22

Ta da! Now just make a proportion: 1,22 : 240 = 1 : x

x = 196.72

Prove it yourself if you want, the vehicles seems pretty much to respect their top speeds declared in handling.cfg file.

EDIT: Ok this value gives an accurate result only for few high speed vehicles, but I think this is the value that "feels" better the speed.

Vehicles that work perfectly with this value:
- Infernus
- Hydra
- All the bikes/motorcycles
- All the boats

Note: other vehicles seems to have -20 or +20 km/h difference to their handling.cfg top speed
Reply
#48

Quote:
Originally Posted by Anzipane
View Post
Alright guys, I think the magic number is ~196.72 (for KM/H), let me explain you how I found it:

- I assumed that the coordinates system in GTA is equal to 1 meter
- I calculated the distance (in GTA coords) travelled in 1 second by an Infernus, which resulted in ~67 coords/s = ~240 km/h (the same in handling.cfg ??)
- Now I compared the speed traveled to the vector that the GetVehicleVelocity gave me (On a single axis) and was about 1.22

Ta da! Now just make a proportion: 1,22 : 240 = 1 : x

x = 196.72

Prove it yourself if you want, the vehicles seems pretty much to respect their top speeds declared in handling.cfg file.

EDIT: Ok this value gives an accurate result only for few high speed vehicles, but I think this is the value that "feels" better the speed.

Vehicles that work perfectly with this value:
- Infernus
- Hydra
- All the bikes/motorcycles
- All the boats

Note: other vehicles seems to have -20 or +20 km/h difference to their handling.cfg top speed
You don't know what your doing at all handling.cfg means nothing until you apply the correct calculations.
Reply
#49

This is mine.. Works perfectly for me.
Turismo: 204km/h, Infernus: 209km/h.
Bus: 120km/h etc..

Read NEXT COMMENT FOR CODE. CHANGED.
Reply
#50

pawn Code:
#define SpeedCheck(%0,%1,%2,%3,%4) floatround(floatsqroot(%4?(%0*%0+%1*%1+%2*%2):(%0*%0+%1*%1)) *%3*1.6)
I'm returning it in a stock.

pawn Code:
stock GetPlayerSpeed(playerid, get3d)
{
    new Float:x, Float:y, Float:z;
    if(IsPlayerInAnyVehicle(playerid))
        GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
    else
        GetPlayerVelocity(playerid, x, y, z);

    return SpeedCheck(x, y, z, 100.0, get3d);
}
Reply
#51

I made a quick test with human speed.
I run for one minute, with running animation, so constant speed that I assume it's 10kph (Normal human running speed). After finishing, the distance run was 19.85 in SAMP units.
We multiply for 60 to get the samp units per hour and we get that human speed in San Andreas Units is:
1191 per hour, let say 1200.
So 1200 uph = 10 kph, so 1km = 120 u

How to convert this to the 'magic' number to see if speeds are logical or not?
Reply
#52

Quote:
Originally Posted by Siralos
View Post
I made a quick test with human speed.
I run for one minute, with running animation, so constant speed that I assume it's 10kph (Normal human running speed). After finishing, the distance run was 19.85 in SAMP units.
We multiply for 60 to get the samp units per hour and we get that human speed in San Andreas Units is:
1191 per hour, let say 1200.
So 1200 uph = 10 kph, so 1km = 120 u

How to convert this to the 'magic' number to see if speeds are logical or not?
This doesn't make any sense. I ran the same tests and got 442 units. How the hell did you run 19.85 units in a MINUTE?
Reply
#53

Quote:
Originally Posted by [XST]O_x
View Post
This doesn't make any sense. I ran the same tests and got 442 units. How the hell did you run 19.85 units in a MINUTE?
From here: 2909.9324,-1202.3668,11.0500
To here: 2870.2466,-950.1831,10.8750

Ok, my bad... it's 255

Then 15300 in one hour, so, 1530 units per km
Reply
#54

So, Pottus, did you only test this on a highway?

Do you know what is a GTA:SA's highway limiter?
Reply
#55

Quote:
Originally Posted by Kar
Посмотреть сообщение
So, Pottus, did you only test this on a highway?

Do you know what is a GTA:SA's highway limiter?
I know going across that bridge in SF your speed gets limited not sure if this happens anywhere else.
Reply
#56

Yes it's on gant bridge.

It happens on the strip. It's supposed to be on almost all highways.

Hence 'Highway limiter'. I'm just curious, maybe redo your tests on an airport or something because if the highway limiter affected your tests then your results might be off.
Reply
#57

Quote:
Originally Posted by Kar
Посмотреть сообщение
Yes it's on gant bridge.

It happens on the strip. It's supposed to be on almost all highways.

Hence 'Highway limiter'. I'm just curious, maybe redo your tests on an airport or something because if the highway limiter affected your tests then your results might be off.
They're not lol.
Reply
#58

Ok, just trying to help because I know hardly anyone here realizes that their is an actual highway limiter.
Reply
#59

Know what, nvm. DELETE.
Reply
#60

Well i have one question, why does people use pythagoras formula add all velocity axis and square root it when result will be the same as if you only add all floats?

Why does people use powers and sqroot together?

speed = floatsqroot((vx * vx) + (vy * vy) + (vz * vz)) * "magic number";

If the result will be the same if you only add all floats eachother?

Speed = floatadd(floatadd(floatabs(vx), floatabs(vy)), floatabs(vz)) * magic number
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)