Posts: 484
Threads: 10
Joined: Jul 2012
Reputation:
0
the result will not be the same to add those floats, you're summing the x, y and z velocity and the result will not be the real velocity. To get the real velocity you need to use the pitagora's or whatever formula.
example:
Let's use a real life example. Supose you're seeing the ground from the top and imagine X and Y coordinates there, the car is moving on a straight line diagonally (not 45є but not 90є o 0є from the X line) for 100 KM and the speedo counts constantly 100 KM/H. In total he had taken 1 Hour. So in X let's suppose he went 70KMs, so in Y he went : 100*100 = 70*70 + y*y <=> y = sqrt(5100) <=> y ~=71 KMs.
Therefor he went at a speed of 70Km/h in the X and 71 Km/h in the y. 70+71 = 141. 141 is not 100. There you get it. So now you can do the other way around to get the first value: speed = sqrt(70*70+71*71) ~= 99 Km/h (I just used int and not float to show you, with floats it will give a more exact value).
Hope you understood. If you didn't, pm me, and I'll explain it to you in portuguese.
Posts: 4,049
Threads: 85
Joined: Mar 2013
Reputation:
0
30.12.2014, 18:44
(
Последний раз редактировалось n0minal; 30.12.2014 в 22:15.
)
Well i did a mistake, misunderstood... Yeah i need to use pythagoras to do it because:
sqroot((3*3 = 9) + (4*4 = 16)) = log(25, 2) = 5;
and without pythagoras i get 3 + 4 = 7... Sorry.
I did a confusion cause when i was sleeping i remind of cancelling powers inside roots xD
I can only cancel one square power per square root, like:
floatsqroot(3*3) = log(9, 2) = 3...
Posts: 3,324
Threads: 96
Joined: Sep 2013
03.09.2016, 12:13
(
Последний раз редактировалось Crayder; 03.09.2016 в 16:53.
)
Just gotta bump right here for a sec...
In GTA, it seems every vehicle returns a different velocity even when actually going the same speed as other vehicles. This shouldn't be like this, it might even be a bug. This is why you are all wrong.
Like, suppose we lined up an Infernus, a Rhino, a Sanchez, an Elegy, and a Slam Van. Now suppose could push (disregarding the vehicles' acceleration) each of these vehicles the same distance in the same amount of time, each of those vehicles return different values even though they are all going the same speed (distance over time).
So every vehicle has it's own magic number depending on it's handling data. I'm going to try to work out a table of information and try to find the formula for every vehicle's magic number.
EDIT: Well I got the data sorted and got the values I need IG, but there isn't much of a correlation in the values. There's also like no relation from vehicle to vehicle in the data, as expected, so it's a bit tough unless we can correlate the handling data with the GetVehicleVelocity data.
EDIT2: Perhaps I should just make an AHK script to get the velocity vector size of each vehicle at top speed on a series of object 19552.
EDIT3: Whoever finds the correlation between the number "1.23" (Infernus top velocity on model 19552) and 30, 1.5, and 240 (limiting, not the actual top speed, it only limits the top speed with drag) wins.
Posts: 319
Threads: 7
Joined: Jul 2012
Reputation:
0
This is just based on assumptions.
Can you be absolutely sure that Rockstar implemented the exact same speeds as their real-life counterparts?
Even with a value of 180.0 (which can be proven nicely), the mower has a speed of over 40 kph while their real-life counterparts have a speed of about 13 kph (at least mine does).
So with your value, it would reach speed of nearly 80 kph, which doesn't seem real to me.
I too tried to find tha magic number and found 180.0 to be the most realistic.
I just created 2 checkpoints at the highway around Las Venturas.
They were both on the vertical part of that highway at the right-most part of Las Venturas and they were exactly 1000 units apart (1000 units = 1000 meters).
I drove the Elegy at top speed and drove through those checkpoints in a straight line and I measured the time between entering both checkpoints.
So I knew the distance and time required to cross that distance and I could therefore calculate the speed of the Elegy.
From that speed and the velocity value used by samp, I calculated the magic number and found 180.0 to be very accurate.
When I used the magic number of 180.0, my speedometer displayed the calculated speed I found earlier using the distance and time between both checkpoints.
Your value was found based on assumptions (where you assumed Rockstar used the real Ferrari F40's speed and implemented it without changes), my value was based on real measurements ingame.
If you used the mower's real speed (13kph), you would have found the magic number to be around 60.0 or something like that.
So using assumptions isn't going to give any accurate value.