Wheel mechanic

Making or wanting help making your own asset? Check in here
Post Reply
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Wheel mechanic

Post by MaxP »

Trying to make more realistic recoil for light vehicles, but got some side effects: the vehicle starts to slide over the surface.

I experimented with the grip parameter, and didn't notice any change.
Then with FrictionMod parameter in engine section, and with high enough values I could minimize the sliding, but the vehicle behavour is very odd with it.

What should I do to minimize the sliding in the transverse axis?
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: Wheel mechanic

Post by Arab »

In your recoil comp, make sure ObjectTemplate.recoil.hasRecoilForce is 0
Image
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Wheel mechanic

Post by MaxP »

Arab wrote:In your recoil comp, make sure ObjectTemplate.recoil.hasRecoilForce is 0
Are you sure it is the hasRecoilForce?
If I set the ObjectTemplate.recoil.hasRecoilForce 0 under the WeaponBasedRecoilComp section, nothing happens.
If it is the ObjectTemplate.recoil.recoilForce parameter, then if I change it to 0, there is, of course, no recoil at all.
Last edited by MaxP on 2018-10-16 21:08, edited 1 time in total.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: Wheel mechanic

Post by Arab »

MaxP wrote:Are you sure it is the hasRecoilForce?
If I set the ObjectTemplate.recoil.hasRecoilForce 0 under the WeaponBasedRecoilComp section, nothing happens.
If it is the ObjectTemplate.recoil.recoilForce parameter, then if I change it to 0, there is, of course, no recoil at all.
Ye it's the ObjectTemplate.recoil.recoilForce code which you can set to 0.1.

Otherwise I'm not sure. There's these codes which are used in PR. Camera Recoil is not 3P, recoil size
Other codes:

Code: Select all

ObjectTemplate.recoil.recoilSize 15
rem Recoil Size = How far the recoil backs on each shot.
ObjectTemplate.recoil.recoilSpeed 10
ObjectTemplate.recoil.recoilSpeedGB 2.5
rem Recoil Speed = How fast a gun will recoil
Image
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Wheel mechanic

Post by MaxP »

Arab wrote:YCamera Recoil is not 3P, recoil size
Thanks.
I don't care about the camera recoil, I set to to reasonable values.
But, as I can see, the tanks in PR have the recoil and roll (don't know exactly how is it in english, I mean the gear working) on it. But the tanks don't slide on the surface, I assume due to the different engine logic.
So I wonder is there any way to minimize the wheel sliding. Maybe I would do it by myself, but I can't find any manual for this engine type parameters.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: Wheel mechanic

Post by Arab »

MaxP wrote:Thanks.
I don't care about the camera recoil, I set to to reasonable values.
But, as I can see, the tanks in PR have the recoil and roll (don't know exactly how is it in english, I mean the gear working) on it. But the tanks don't slide on the surface, I assume due to the different engine logic.
So I wonder is there any way to minimize the wheel sliding. Maybe I would do it by myself, but I can't find any manual for this engine type parameters.
Maybe add ObjectTemplate.newCar2.wheelInertia 100, otherwise no idea.
Image
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Wheel mechanic

Post by MaxP »

Arab wrote:Maybe add ObjectTemplate.newCar2.wheelInertia 100, otherwise no idea.
No changes.
I've set the following parameters:
...
ObjectTemplate.newCar2.wheelLongFrictionMod 1.3
ObjectTemplate.newCar2.wheelLongDriveFrictionMod 1.6
...
ObjectTemplate.newCar2.wheelLatFrictionMod 2
ObjectTemplate.newCar2.wheelLatDriveFrictionMod 2

The sliding is much less, but still exists. Will look at it in game. It cause some problems with the bots firing without driver at place, but it's really improves the immersion...
Heavy Death
Posts: 1303
Joined: 2012-10-21 10:51

Re: Wheel mechanic

Post by Heavy Death »

Fiddling with inertias will do jack shit except make driving different.

Any force excerted on an object will "dislocate" them and put them in "ragdoll" mode. What you can try is increasing the vehicle mass to some ridiculous high number - it doesnt change driving, its just a multiplier or rather a scale on which vehicles are put on in regards to eachother.
PBAsydney
Posts: 369
Joined: 2016-10-15 22:14

Re: Wheel mechanic

Post by PBAsydney »

If there is indeed a way to make vehicles less prone to sliding when they are stationary, it might be worthwhile to look into that on a lot of other vehicles, some vehicles handle like the tyres are covered in grease if they are on a slope more than 1%.
Image
Image Image
Image
HITREG CARRY
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Wheel mechanic

Post by MaxP »

PBAsydney wrote:If there is indeed a way to make vehicles less prone to sliding when they are stationary, it might be worthwhile to look into that on a lot of other vehicles, some vehicles handle like the tyres are covered in grease if they are on a slope more than 1%.
Of course, but even if I would change the parameters one by one (actually I did )), there will be a way tooo much combinations, so I wouldn't understand what I have to do, and how it works in general.
Also, some vehicles have a strange behaviour with the same settings as the others, like civ_jep_technical2 - it's sliding with the most working parameters set.

So, for now I've just minimized the sliding. It could be some problems with the bots firing for a long time without moving, as the vehicle will slide back, but it has too many advantages, so, probably, I'll keep it in this state. Anyway, there're many maps where the vehicles just sliding on slopes without any external forces.

Thank for all :)
Last edited by MaxP on 2018-10-18 13:39, edited 3 times in total.
Heavy Death
Posts: 1303
Joined: 2012-10-21 10:51

Re: Wheel mechanic

Post by Heavy Death »

Sliding on slopes is a weird thing - you can change the LatFrictionMod to higher but as soon as it "tests" for the lateral grip, if the grip is smaller than what would be necessary to keep it in place it will start sliding until it reaches a point where in the timeframe of "testing" the grip value is higher, it will stop. In other words, never, until its very reasonably flat. :P I can also look into it a bit if i have time and provide you with some stuff if i deem it useful-ish.
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Wheel mechanic

Post by MaxP »

Heavy Death wrote:I can also look into it a bit if i have time and provide you with some stuff if i deem it useful-ish.
Here is config for us_jep_hmmwv_uparmored (other things not touched):

Code: Select all

ObjectTemplate.setMinRotation 0/0/-1
ObjectTemplate.setMaxRotation 0/0/1
ObjectTemplate.setMaxSpeed 0/0/10000
ObjectTemplate.setAcceleration 0/0/10
ObjectTemplate.setInputToRoll PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETNewCar2
ObjectTemplate.setTorque 240
ObjectTemplate.setDifferential 4
ObjectTemplate.setNumberOfGears 4
ObjectTemplate.setGearUp 0.85
ObjectTemplate.setGearDown 0.4
ObjectTemplate.setGearChangeTime 0.7
ObjectTemplate.setGearRatios 2.25 1.25 1 0.8 0.8
ObjectTemplate.spinWhenNoEngineInAir 1
ObjectTemplate.newCar2.minRpm 1000
ObjectTemplate.newCar2.maxRpm 4000
ObjectTemplate.newCar2.useClutchedTorque 0
ObjectTemplate.newCar2.wheelInertia 100
ObjectTemplate.newCar2.engineFeedbackMod 0.6
ObjectTemplate.newCar2.brakeTorque 2500
ObjectTemplate.newCar2.engineBrakeTorque 2000
ObjectTemplate.newCar2.frictionTorque 100
ObjectTemplate.newCar2.frictionMod 1.5
ObjectTemplate.newCar2.slopeTorqueMod 0.5
ObjectTemplate.newCar2.wheelLongFrictionMod 1
ObjectTemplate.newCar2.wheelLongDriveFrictionMod 1.5
ObjectTemplate.newCar2.wheelLongPeakAt 0.1
ObjectTemplate.newCar2.wheelLongMinDynamicFriction 0.7
ObjectTemplate.newCar2.wheelLongScale 0.05
ObjectTemplate.newCar2.wheelLatFrictionMod [b]3[/b]
ObjectTemplate.newCar2.wheelLatDriveFrictionMod 0.3
ObjectTemplate.newCar2.wheelLatPeakAt 0.1
ObjectTemplate.newCar2.wheelLatMinDynamicFriction 0.7
ObjectTemplate.newCar2.wheelLatScale 0.1
ObjectTemplate.audio.newStyleAudio 1
Recoil for it's HMG:

Code: Select all

ObjectTemplate.createComponent WeaponBasedRecoilComp
ObjectTemplate.recoil.recoilSize 1.5
ObjectTemplate.recoil.recoilSpeed 20
ObjectTemplate.recoil.recoilSpeedGB 5
ObjectTemplate.recoil.recoilForce 4
ObjectTemplate.recoil.cameraRecoilSpeed 10
ObjectTemplate.recoil.cameraRecoilSize 0.5
In projectile tweak:

Code: Select all

ObjectTemplate.mass 0.1
Post Reply

Return to “PR:BF2 Community Modding”