digitrp / fivem-public-board

1 stars 0 forks source link

Fuel consumption rate appears high #4

Closed NerxaOG closed 4 years ago

NerxaOG commented 4 years ago

Gas tanks when full will run out of gas in under 3 minutes and 37 seconds.

Cyntaax commented 4 years ago

Thanks for bringing this to our attention, just for reference, here's how the fuel calculation works. We'll have to settle on a good fuel consumption rate

                if rpm > 0.9 then
                    rpmfuel = fuel - rpm / 0.8
                    Citizen.Wait(1000)
                elseif rpm > 0.8 then
                    rpmfuel = fuel - rpm / 1.1
                    Citizen.Wait(1500)
                elseif rpm > 0.7 then
                    rpmfuel = fuel - rpm / 2.2
                    Citizen.Wait(2000)
                elseif rpm > 0.6 then
                    rpmfuel = fuel - rpm / 4.1
                    Citizen.Wait(3000)
                elseif rpm > 0.5 then
                    rpmfuel = fuel - rpm / 5.7
                    Citizen.Wait(4000)
                elseif rpm > 0.4 then
                    rpmfuel = fuel - rpm / 6.4
                    Citizen.Wait(5000)
                elseif rpm > 0.3 then
                    rpmfuel = fuel - rpm / 6.9
                    Citizen.Wait(6000)
                elseif rpm > 0.2 then
                    rpmfuel = fuel - rpm / 7.3
                    Citizen.Wait(8000)
                else
                    rpmfuel = fuel - rpm / 7.5
                    Citizen.Wait(5000)
                end
MixerM3 commented 4 years ago

Possible Efficiency

if rpm > 0.9 then rpmfuel = fuel - rpm / 0.7 Citizen.Wait(1000) elseif rpm > 0.8 then rpmfuel = fuel - rpm / 1.0 Citizen.Wait(1500) elseif rpm > 0.7 then rpmfuel = fuel - rpm / 1.9 Citizen.Wait(2000) elseif rpm > 0.6 then rpmfuel = fuel - rpm / 3.4 Citizen.Wait(3000) elseif rpm > 0.5 then rpmfuel = fuel - rpm / 4.6 Citizen.Wait(4000) elseif rpm > 0.4 then rpmfuel = fuel - rpm / 5.9 Citizen.Wait(5000) elseif rpm > 0.3 then rpmfuel = fuel - rpm / 6.7 Citizen.Wait(6000) elseif rpm > 0.2 then rpmfuel = fuel - rpm / 7.4 Citizen.Wait(8000) else rpmfuel = fuel - rpm / 7.5 Citizen.Wait(5000) end

MixerM3 commented 4 years ago

Edit #5

if rpm > 0.9 then
rpmfuel = fuel - rpm / 4.10
Citizen.Wait(1000)
elseif rpm > 0.8 then
rpmfuel = fuel - rpm / 4.97
Citizen.Wait(1500)
elseif rpm > 0.7 then
rpmfuel = fuel - rpm / 5.43
Citizen.Wait(2000)
elseif rpm > 0.6 then
rpmfuel = fuel - rpm / 5.89
Citizen.Wait(3000)
elseif rpm > 0.5 then
rpmfuel = fuel - rpm / 6.24
Citizen.Wait(4000)
elseif rpm > 0.4 then
rpmfuel = fuel - rpm / 6.72
Citizen.Wait(5000)
elseif rpm > 0.3 then
rpmfuel = fuel - rpm / 7.35
Citizen.Wait(6000)
elseif rpm > 0.2 then
rpmfuel = fuel - rpm / 7.61
Citizen.Wait(8000)
else
rpmfuel = fuel - rpm / 7.98
Citizen.Wait(5000)
end
Cyntaax commented 4 years ago

@MixerM3 @glitchygg How are we feeling since these last changes?

glitchygg commented 4 years ago

Fuel seems good. Thank you @MixerM3

MixerM3 commented 4 years ago
if rpm > 0.9 then
rpmfuel = fuel - rpm / 4.10
Citizen.Wait(1000)
elseif rpm > 0.8 then
rpmfuel = fuel - rpm / 4.97
Citizen.Wait(1500)
elseif rpm > 0.7 then
rpmfuel = fuel - rpm / 5.43
Citizen.Wait(2000)
elseif rpm > 0.6 then
rpmfuel = fuel - rpm / 5.89
Citizen.Wait(3000)
elseif rpm > 0.5 then
rpmfuel = fuel - rpm / 6.24
Citizen.Wait(4000)
elseif rpm > 0.4 then
rpmfuel = fuel - rpm / 6.72
Citizen.Wait(5000)
elseif rpm > 0.3 then
rpmfuel = fuel - rpm / 7.35
Citizen.Wait(6000)
elseif rpm > 0.2 then
rpmfuel = fuel - rpm / 7.61
Citizen.Wait(8000)
else
rpmfuel = fuel - rpm / 7.98
Citizen.Wait(5000)
end