Skip to content

Commit

Permalink
Tweak car/motorcycle handling parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
StyledStrike committed Dec 15, 2024
1 parent f048a5f commit 504abd4
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 29 deletions.
6 changes: 3 additions & 3 deletions lua/entities/base_glide/sv_wheels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ function ENT:WheelInit()

-- Static friction
maxSlip = 20,
slipForce = 70,
slipForce = 80,

-- Dynamic friction
extremumValue = 5.0,
extremumValue = 4.0,
asymptoteSlip = 0.5,
asymptoteValue = 2.0
asymptoteValue = 1.2
}
end

Expand Down
8 changes: 4 additions & 4 deletions lua/entities/base_glide_car/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function ENT:OnPostInitialize()
self:SetSteering( 0 )
self:SetEngineRPM( 0 )
self:SetEngineThrottle( 0 )
self:SetPowerDistribution( -0.8 )

self:SetTireSmokeColor( Vector( 0.6, 0.6, 0.6 ) )
self:SetWheelRadius( 15 )
Expand Down Expand Up @@ -67,15 +66,16 @@ function ENT:OnPostInitialize()
self:SetMinRPM( 2000 )
self:SetMaxRPM( 20000 )

self:SetMinRPMTorque( 1100 )
self:SetMaxRPMTorque( 1300 )
self:SetMinRPMTorque( 1200 )
self:SetMaxRPMTorque( 1500 )
self:SetDifferentialRatio( 1.9 )
self:SetTransmissionEfficiency( 0.8 )
self:SetPowerDistribution( -0.9 )

-- Steering parameters
self:SetMaxSteerAngle( 35 )
self:SetSteerConeChangeRate( 8 )
self:SetSteerConeMaxSpeed( 1500 )
self:SetSteerConeMaxSpeed( 1800 )
self:SetSteerConeMaxAngle( 0.25 )

-- Update wheel parameters next tick
Expand Down
12 changes: 6 additions & 6 deletions lua/entities/base_glide_car/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ if SERVER then
ENT.LightBodygroups = {}

-- How much force to apply when trying to turn while doing a burnout?
ENT.BurnoutForce = 60
ENT.BurnoutForce = 45

-- How much force to apply when the driver tries to unflip the vehicle?
ENT.UnflipForce = 3
Expand All @@ -230,11 +230,11 @@ if SERVER then
[-1] = 2.9, -- Reverse
[0] = 0, -- Neutral (this number has no effect)
[1] = 2.8,
[2] = 1.78,
[3] = 1.3,
[4] = 1,
[5] = 0.8,
[6] = 0.7
[2] = 1.7,
[3] = 1.2,
[4] = 0.9,
[5] = 0.75,
[6] = 0.68
}
end

Expand Down
4 changes: 2 additions & 2 deletions lua/entities/base_glide_motorcycle/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function ENT:UpdateSteering( dt )
local inputSteer = Clamp( self:GetInputFloat( 1, "steer" ), -1, 1 )
local sideSlip = Clamp( self.avgSideSlip, -1, 1 )

local tilt = Clamp( sideSlip * -2, -0.5, 0.5 )
local tilt = Clamp( sideSlip * -2, -0.75, 0.75 )

if isAnyWheelGrounded then
tilt = tilt + inputSteer * Clamp( self.forwardSpeed / 300, 0, 1 )
Expand All @@ -107,7 +107,7 @@ function ENT:UpdateSteering( dt )
end
end

self.steerTilt = ExpDecay( self.steerTilt, tilt, 6 + invSpeedOverFactor * 3, dt )
self.steerTilt = ExpDecay( self.steerTilt, tilt, 8 + invSpeedOverFactor * 2, dt )

if
isAnyWheelGrounded and
Expand Down
8 changes: 6 additions & 2 deletions lua/entities/gtav_airbus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,17 @@ if SERVER then
self:SetSuspensionLength( 13 )
self:SetTransmissionEfficiency( 0.8 )
self:SetDifferentialRatio( 1.6 )
self:SetPowerDistribution( -0.7 )

self:SetBrakePower( 2500 )
self:SetWheelInertia( 10 )
self:SetWheelInertia( 8 )
self:SetMaxSteerAngle( 45 )
self:SetSteerConeChangeRate( 6 )
self:SetSteerConeMaxSpeed( 700 )

self:SetMinRPM( 1000 )
self:SetMaxRPM( 8000 )
self:SetMinRPMTorque( 1000 )
self:SetMinRPMTorque( 1100 )
self:SetMaxRPMTorque( 1200 )

self:SetSlipForce( 110 )
Expand Down
8 changes: 4 additions & 4 deletions lua/entities/gtav_blazer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ if SERVER then
self:SetSteerConeChangeRate( 10 )
self:SetSteerConeMaxSpeed( 1000 )

self:SetTransmissionEfficiency( 0.7 )
self:SetPowerDistribution( -0.7 )
self:SetDifferentialRatio( 1.2 )
self:SetBrakePower( 1300 )
self:SetWheelInertia( 6 )
self:SetWheelInertia( 5 )

self:SetMaxRPM( 15000 )
self:SetMinRPMTorque( 980 )
self:SetMaxRPMTorque( 1000 )
self:SetMinRPMTorque( 1000 )
self:SetMaxRPMTorque( 1200 )

self:SetSuspensionLength( 10 )
self:SetSpringStrength( 450 )
Expand Down
6 changes: 3 additions & 3 deletions lua/entities/gtav_gauntlet_classic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if SERVER then
duplicator.RegisterEntityClass( "gtav_gauntlet_classic", Glide.VehicleFactory, "Data" )

ENT.SpawnPositionOffset = Vector( 0, 0, 30 )
ENT.BurnoutForce = 70
ENT.BurnoutForce = 65

function ENT:GetGears()
return {
Expand All @@ -87,8 +87,8 @@ if SERVER then
self:SetDifferentialRatio( 1.9 )

self:SetMaxRPM( 25000 )
self:SetMinRPMTorque( 1000 )
self:SetMaxRPMTorque( 1200 )
self:SetMinRPMTorque( 1200 )
self:SetMaxRPMTorque( 1400 )

self:CreateSeat( Vector( -22, 18, -3 ), Angle( 0, 270, -10 ), Vector( 40, 80, 0 ), true )
self:CreateSeat( Vector( -8, -18, -3 ), Angle( 0, 270, 5 ), Vector( -40, -80, 0 ), true )
Expand Down
13 changes: 8 additions & 5 deletions lua/entities/gtav_speedo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if SERVER then

ENT.SpawnPositionOffset = Vector( 0, 0, 50 )
ENT.ChassisMass = 900
ENT.BurnoutForce = 60
ENT.BurnoutForce = 50

ENT.AirControlForce = Vector( 0.4, 0.2, 0.1 ) -- Roll, pitch, yaw
ENT.AirMaxAngularVelocity = Vector( 200, 200, 150 ) -- Roll, pitch, yaw
Expand All @@ -63,15 +63,18 @@ if SERVER then
}

function ENT:CreateFeatures()
self:SetWheelInertia( 11 )
self:SetWheelInertia( 10 )
self:SetSpringStrength( 700 )
self:SetSteerConeMaxSpeed( 1000 )
self:SetAsymptoteValue( 1.5 )

self:SetDifferentialRatio( 2.3 )
self:SetTransmissionEfficiency( 0.7 )
self:SetTransmissionEfficiency( 0.75 )
self:SetPowerDistribution( -0.75 )
self:SetBrakePower( 3000 )

self:SetMinRPMTorque( 900 )
self:SetMaxRPMTorque( 1100 )
self:SetMinRPMTorque( 1000 )
self:SetMaxRPMTorque( 1200 )

self:CreateSeat( Vector( 5, 22, 0 ), Angle( 0, 270, -10 ), Vector( 50, 80, 10 ), true )
self:CreateSeat( Vector( 25, -22, 0 ), Angle( 0, 270, 5 ), Vector( 50, -80, 10 ), true )
Expand Down

0 comments on commit 504abd4

Please sign in to comment.