Arnoldio's Vehicle Physics Improvements

Making or wanting help making your own asset? Check in here
Post Reply
Heavy Death
Posts: 1303
Joined: 2012-10-21 10:51

Arnoldio's Vehicle Physics Improvements

Post by Heavy Death »

Again, an addition I wanted for One-Life events, but it will not work properly server-side due to client prediction.

I have worked on this in the past, but this time I'm much more engaged. The goal of the retouch is realistic vehicle behaviour that needs more user experience to operate efficiently and also react to enviroment more realistically. I have come to an extremely favourable settings on the Transport Trucks, then I extrapolated the stats to othe vehicles, namely the Fuchs, G-Wagon and BRDM, the latter giving me trouble on the last test.

There is still one variable I need to test sometime soon to try to circumvent some power-related issues on BRDM, but once that is finished, I will have a near-perfect logical formula that I can then use to put real data in and the given vehicle will have very believable response. I have so far exited the "experimental" phase, which saw me being up to 3AM for a week straight so it should be smooth sailing for the most part now.

I'm going to focus on wheeled vehicles first as the formula I have is for those only, for tracked vehicles, I'll need to play around more as they sadly work in a different manner alltogether, and a very crude manner that is.

Will post media if I find someone to record it for me, soon™.

Dumping the WIP "template" for modding the engine/wheel parametres. Spring and daming are separate and more "by feel" so far.

Vehicle mass should be set to RL value, so it is relatable to other vehicles. It does not impact the actual mass. GravityModifier to 1.5.

Code: Select all

Note: All values are in [b]kg[/b] and [b]N/m[/b].

[b]ObjectTemplate.setTorque[/b] - RL value x1,5
[b]ObjectTemplate.setDifferential[/b] - 1 if possible, otherwise adjust for gearing.
[b]ObjectTemplate.setNumberOfGears [/b] - RL values is possible.
[b]ObjectTemplate.setGearUp[/b] - 95, so it doesn't shift up on hills.
[b]ObjectTemplate.setGearDown[/b] - 35, so it doesn't shift down on hills.
[b]ObjectTemplate.SetGearChangeTime[/b] - Older the equipment, the longer it should be. Between 1.25 and 2.5
[b]ObjectTemplate.setGearRatios[/b] - Fictional values, adjust to feel. Equal number to NumberOfGears. First gear counts as reverse aswell.
[b]ObjectTemplate.spinWhenNoEngineInAir[/b] 1 - As default, so it doesn't cut power when loss of traction.
[b]ObjectTemplate.newCar2.minRpm[/b] - Adjust to RL idle value.
[b]ObjectTemplate.newCar2.maxRpm[/b] - Adjust to RL redline.
[b]ObjectTemplate.newCar2.useClutchedTorque[/b] 1 -This not only disengages drivetrain but also drops revs when shifting.
[b]ObjectTemplate.newCar2.wheelInertia[/b] - RL mass x0,25
[b]ObjectTemplate.newCar2.engineFeedbackMod[/b] - 0.2, otherwise engine is lethargic.
[b]ObjectTemplate.newCar2.brakeTorque[/b] - RL mass x2
[b]ObjectTemplate.newCar2.engineBrakeTorque[/b] - RL mass
[b]ObjectTemplate.newCar2.frictionTorque[/b] - 10x(#ofwheels)x(typeofwheel)x((RLmass/10000)+1), where type of wheel would be 1,5 for larger army/tractor wheels, 1,25 for common offroad wheels and 1,0 for civilian wheels.
[b]ObjectTemplate.newCar2.frictionMod[/b] 2 - About the right ammount of grip.
[b]ObjectTemplate.newCar2.slopeTorqueMod[/b] 1 - So the torque is constant and physics do the work.

- Wheel friction still in experimental mode, coming soon.
Last edited by Heavy Death on 2017-11-03 12:08, edited 1 time in total.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Arnoldio's Vehicle Physics Improvements

Post by Mats391 »

Quite interested in this. Wheeled vehicles physics are on long term to do list, but never got around to it. Especially trucks are quite stupid to drive right now as they almost come to complete hold on slight slopes.
Image

Mineral: TIL that Wire-guided missiles actually use wire
Heavy Death
Posts: 1303
Joined: 2012-10-21 10:51

Re: Arnoldio's Vehicle Physics Improvements

Post by Heavy Death »

Actually, the trucks are too powerful and sudden in terms of acceleration (everything is, there is no inertia), and there is no powerloss on gearchanges, they go like bat out of hell currently, not to mention BRDM wich can be considered an F1 car. I have remedied the truck issue in such way that if you get upt to speed, then hills will not affect you greatly since you gain inertia on your engine - one the other side, if you start rom the bottom of a hill, the you can control the throttle in the desired powerband for the truck not to change gear. If it changes gear, then it will indeed lose power and you can effectively "stall" it.

As said, there is still stuff to test and the hill climbing vs road going is really hard to achieve realistically on both ends, but expect truck files to be avaliable soon, you can test them quickly then.
Last edited by Heavy Death on 2017-10-28 07:19, edited 1 time in total.
Heavy Death
Posts: 1303
Joined: 2012-10-21 10:51

Re: Arnoldio's Vehicle Physics Improvements

Post by Heavy Death »

My continous struggle with BRDM power issues has led me to construct a formula for wheel friction... 10x(#wheels)x(typeofwheel)x((masskg/10000)+1)

Its fun being autismal, schizo and OCD. Fingers crossed it will produce satisfactory results because I really don't want to modify other numbers as that would break continuity.
Lugi
Posts: 590
Joined: 2010-10-15 21:36

Re: Arnoldio's Vehicle Physics Improvements

Post by Lugi »

Would be cool if you managed to somehow make light vehicles take damage when moving through terrain other than roads. Its just nonsense tak you can take a 2.5 ton logi and drive it through a cornfield like it was a road.
Sequadon
Posts: 35
Joined: 2015-11-19 14:15

Re: Arnoldio's Vehicle Physics Improvements

Post by Sequadon »

Since corn has no collision it's just a plain field for the truck from engine side. I don't think it's a big problem that you can drive it trough without damage. But if it's possible to limit the max speed when going through it that could be an acceptable solution.

@Heavy Death:
Thank you for your efforts. Please share your test results if you have some.
mebel
Posts: 143
Joined: 2017-02-18 16:03

Re: Arnoldio's Vehicle Physics Improvements

Post by mebel »

If you played ofp/arma - you could notice that you could drive faster on roads, and slower off them. It was not based on collisions, so it didn't require much computing power.
I wonder if same mechanics could be implemented in PR, also for infantry - eg. disable sprint through bushes. I guess it would require to create velocity-maps for all maps - or maybe one could use existing low-vegetation maps?
Last edited by mebel on 2017-11-12 12:18, edited 1 time in total.
Heavy Death
Posts: 1303
Joined: 2012-10-21 10:51

Re: Arnoldio's Vehicle Physics Improvements

Post by Heavy Death »

There is no such thing in BF2 engine im afraid, otherwise ofcourse I'd do it. Or I just havent gotten far enough. :P

There is a workaround maybe possible, with fields that are flat there could be a small layer of invisible water in it, however it would need rework of all maps and a separate "water" material that wouldn't produce any sound and whatnot. But then you wouldn't be able to go prone on foot...

On another note, I have quite some big changes in life ATM, so this is on short pause, and i still need to get a hold on grip levels. I can start working on it at the end of the week again.
mebel
Posts: 143
Joined: 2017-02-18 16:03

Re: Arnoldio's Vehicle Physics Improvements

Post by mebel »

any updates on project?
Post Reply

Return to “PR:BF2 Community Modding”