The "Real" vehicle speed thread
#31

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
depends on personal needs, MP wanted to have a bike go 25mph ma and the infernus at another speed. The difference was not linear so I needed to come up with a formula which approaches the wanted values and this arised.

a full discussion is here: https://sampforum.blast.hk/showthread.php?tid=446342

/\ Y - "Real World Speed"
>X - GTA Velocity



This graph shows how the function approches the wishes (and very clearly shows there is NO way to make a direct-linear formula to the values), I could even make a formula to take a hydra into account to make it go at max anything above infernus speed.

you could get a linear formula by calculating the F' of the function F, but meh, it works.

So basicly, all the formulas which are linear may, for example, be only correct for sports cars, or only bikes, or only planes, but this formula covers like, "all-in-one".

If you need adjusted speeds drop me a PM and I will give you values to use with the formula.
For the best approximation I need the following values:

MAX Real World Speed in KM/H or MP/H corresponding to the vehicle AND the vehicle's MAX GTA Velocity
Please use "f1.6%" precision for the GTA speed.

Like:

Vehicle NameMax World SpeedMax GTA speed
Bike250.025000
Infernus1750.090000
Hydra3000.120000
(code:[remove dot from [ ttable]])
Код:
[.ttable]
[tr][td]Vehicle Name[/td][td]Max World Speed[/td][td]Max GTA speed[/td][/tr]
[tr][td]Bike[/td][td]25[/td][td]0.025000[/td][/tr]
[tr][td]Infernus[/td][td]175[/td][td]0.090000[/td][/tr]
[tr][td]Hydra[/td][td]300[/td][td]0.120000[/td][/tr]
[/ttable]
Or if you want to do it yourself:

Exponential Regression

Edit:

Well, I just got to make other functions with other real speeds:
pawn Код:
//velocity - velX*velX+velY*velY+velZ*velZ
//bike- 40KMH, infernus- 180KMH, Hydra- 346KMH
stock Float:GetSpeedInKPHlo(Float:velocity)
{
    return (11.211*floatpower(velocity,2.0))+(128.55*velocity);
}

//bike- 48KMH, infernus- 321KMH, Hydra- 949KMH
stock Float:GetSpeedInKPHhia(Float:velocity)
{
    return (35.564*floatpower(velocity,3.0))+(44.432*floatpower(velocity,2.0))+(142.15*velocity);
}

//bike- 40KMH, infernus- 180KMH, Hydra- 500KMH
stock Float:GetSpeedInKPHhib(Float:velocity)
{
    return (35.564*floatpower(velocity,3.0))-(44.432*floatpower(velocity,2.0))+(142.15*velocity);
}

//bike- 40KMH, infernus- 280KMH, Hydra- 1200KMH
stock Float:GetSpeedInKPHhic(Float:velocity)
{
    return (113.53*floatpower(velocity,3.0))-(83.693*floatpower(velocity,2.0))+(146.89*velocity);
}
also my max velocity measurements:
Bike - 0.303138
Infernus - 1.261432
Hydra - 2.250000
pawn Код:
new Float:maxspeed = 0.0;

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/reset", true) == 0) {
        maxspeed = 0.0;
        return 1;
    }

    return 0;
}

public OnPlayerUpdate(playerid)
{
    if(GetPlayerVehicleID(playerid))
    {
        new Float:vec[4];
        GetVehicleVelocity(GetPlayerVehicleID(playerid),vec[0],vec[1],vec[2]);
        vec[3] = vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2];
        if(vec[3] > maxspeed)
            maxspeed = vec[3];
        new string[64];
        format(string,64,"Max speed: %1.6f",maxspeed);
        SendClientMessage(playerid,-1,string);
    }
    return 1;
}
and IMHO, a simple formula with speed*magic number is complete bullshit for real (world) speeds.
You cant just base the whole vehicles speed on the bike speed thats just wrong.
Reply


Messages In This Thread
The "Real" vehicle speed thread - by Sinner - 29.07.2012, 17:54
Re: The "Real" vehicle speed thread - by Arca - 29.07.2012, 20:13
Re: The "Real" vehicle speed thread - by Sinner - 30.07.2012, 07:31
Re: The "Real" vehicle speed thread - by Mauzen - 30.07.2012, 09:34
Re: The "Real" vehicle speed thread - by Vince - 30.07.2012, 12:06
Re: The "Real" vehicle speed thread - by playbox12 - 06.08.2012, 18:23
Re: The "Real" vehicle speed thread - by Joe Staff - 06.08.2012, 20:03
Re: The "Real" vehicle speed thread - by Vince - 06.08.2012, 21:14
Respuesta: The "Real" vehicle speed thread - by zugg48 - 12.08.2012, 09:07
Re: Respuesta: The "Real" vehicle speed thread - by Mauzen - 14.08.2012, 23:56
Respuesta: The "Real" vehicle speed thread - by zugg48 - 17.09.2012, 03:00
Re: The "Real" vehicle speed thread - by [ABK]Antonio - 17.09.2012, 08:59
Re: The "Real" vehicle speed thread - by Edix - 02.08.2013, 12:06
Re: The "Real" vehicle speed thread - by Konstantinos - 02.08.2013, 12:13
Re: The "Real" vehicle speed thread - by [ABK]Antonio - 02.08.2013, 18:17
Re: The "Real" vehicle speed thread - by Pottus - 04.08.2013, 17:47
Re: The "Real" vehicle speed thread - by -Prodigy- - 04.08.2013, 18:53
Re: The "Real" vehicle speed thread - by Kar - 04.08.2013, 18:55
Re: The "Real" vehicle speed thread - by -Prodigy- - 04.08.2013, 18:57
Re: The "Real" vehicle speed thread - by Kar - 04.08.2013, 19:00
Re: The "Real" vehicle speed thread - by Pottus - 04.08.2013, 19:52
Re: The "Real" vehicle speed thread - by Mauzen - 05.08.2013, 00:47
Re: The "Real" vehicle speed thread - by Edix - 07.08.2013, 01:59
Re: The "Real" vehicle speed thread - by Pottus - 07.08.2013, 04:53
Re: The "Real" vehicle speed thread - by Edix - 07.08.2013, 12:05
Re: The "Real" vehicle speed thread - by Pottus - 07.08.2013, 17:29
Re: The "Real" vehicle speed thread - by sgoten - 13.08.2013, 10:13
Re: The "Real" vehicle speed thread - by Edix - 13.08.2013, 19:00
Re: The "Real" vehicle speed thread - by Pottus - 13.08.2013, 20:38
Re: The "Real" vehicle speed thread - by Pottus - 13.08.2013, 23:56
Re: The "Real" vehicle speed thread - by Edix - 14.08.2013, 10:10
Re: The "Real" vehicle speed thread - by Mauzen - 14.08.2013, 11:03
Re: The "Real" vehicle speed thread - by Pottus - 14.08.2013, 19:24
AW: The "Real" vehicle speed thread - by Drebin - 04.09.2013, 01:38
Re: The "Real" vehicle speed thread - by Squash - 09.09.2013, 05:20
Re: The "Real" vehicle speed thread - by Pottus - 09.09.2013, 05:27
Re: The "Real" vehicle speed thread - by Squash - 09.09.2013, 05:50
Re: The "Real" vehicle speed thread - by Pottus - 09.09.2013, 06:14
Re: The "Real" vehicle speed thread - by Squash - 09.09.2013, 06:53
Re: The "Real" vehicle speed thread - by Pottus - 09.09.2013, 07:03
Re: The "Real" vehicle speed thread - by Cypog - 13.09.2013, 21:05
Re: The "Real" vehicle speed thread - by Pottus - 13.09.2013, 23:14
Re: The "Real" vehicle speed thread - by Kimossab - 08.11.2013, 22:23
Re: The "Real" vehicle speed thread - by Pottus - 09.11.2013, 04:04
Re: The "Real" vehicle speed thread - by PowerPC603 - 09.02.2014, 20:51
Re: The "Real" vehicle speed thread - by Pottus - 10.02.2014, 00:34
Re: The "Real" vehicle speed thread - by Anzipane - 09.03.2014, 18:04
Re: The "Real" vehicle speed thread - by Pottus - 09.03.2014, 18:50
Re: The "Real" vehicle speed thread - by VerticalGaming - 09.04.2014, 09:36
Re: The "Real" vehicle speed thread - by VerticalGaming - 09.04.2014, 11:57
Respuesta: The "Real" vehicle speed thread - by Siralos - 08.08.2014, 09:02
Re: Respuesta: The "Real" vehicle speed thread - by [XST]O_x - 08.08.2014, 10:15
Respuesta: Re: Respuesta: The "Real" vehicle speed thread - by Siralos - 08.08.2014, 10:50
Re: The "Real" vehicle speed thread - by Kar - 08.08.2014, 16:56
Re: The "Real" vehicle speed thread - by Pottus - 09.08.2014, 15:59
Re: The "Real" vehicle speed thread - by Kar - 09.08.2014, 16:21
Re: The "Real" vehicle speed thread - by Pottus - 09.08.2014, 17:35
Re: The "Real" vehicle speed thread - by Kar - 09.08.2014, 17:45
Re: The "Real" vehicle speed thread - by Kar - 11.08.2014, 17:31
Re: The "Real" vehicle speed thread - by n0minal - 30.12.2014, 16:41
Re: The "Real" vehicle speed thread - by Kimossab - 30.12.2014, 17:14
Re: The "Real" vehicle speed thread - by n0minal - 30.12.2014, 18:44
Re: Respuesta: The "Real" vehicle speed thread - by eikzdej - 30.03.2016, 08:38
Re: Respuesta: The "Real" vehicle speed thread - by RyanKingstone - 10.06.2016, 09:01
Re: The "Real" vehicle speed thread - by Crayder - 03.09.2016, 12:13
Re: The "Real" vehicle speed thread - by AmigaBlizzard - 19.05.2018, 10:36

Forum Jump:


Users browsing this thread: 6 Guest(s)