Vehicles in UE4 , a constructive debate

To be honest, the Unreal’s vehicle implementation leaves a lot to desire - by default, we have to modify the C++ bit to even have a ‘proper’ reverse gear. The default behavior is to press ‘W’ to move forward, and ‘S’ to move backward… so you keep pressing ‘S’ until it reverse the vehicle (and that is the reverse gear). So Unreal’s template vehicle is more to arcade thingy…

And one way to move forward fast is to purchase Vehicle Movement from marketplace… (you can search). I have bought one, and I think the tank movement component is working (I have not tested it yet). You still most likely end up customizing these C++ classes a lot to your requirements.

I have been playing around with unconventional (non 4 wheel) vehicles for a few months now, and although I can get some things to work using various static meshes assembled with constraints to work I have had no success at all with any part of the vehicle set up.

My conclusion is the components do not work with each other properly. (outside a standard 4WD buggy/sedan setup)

I see requests here for a high level construction mode eg place mcpherson strut at x,y,z trailing link at a,b,c. etc

I think we can do all that for ourselves, we just need the components,
starting with a wheel that we can place /add “n” to static or skeletal meshes (or into BP as child actor) and add drive, suspension, brakes, steering as req.

Start with the wheel please… it seems it does need re-inventing in UE4 land
the rest will follow

Cheers

PaulG

If you search around this forum, you will find various efforts (which some of them are quite impressive) and source code is released too. Well it depends on the requirement - do you want a simulator vehicle which needs precise physics, or arcade or tanks etc etc…

Yep seen quite a few specialized adaptions and they are impressive, however that is the point they are specialised and probably C++ creations…
What we need is a BP placeble wheel, then it will be possible to create just about any vehicle with whatever level of sophistication you wish to hook up to it
With respect it is not about simulator or arcade,

Paul G

Author “The Railway” UE4

I could add a wheel component into Machinery Modelling Toolkit as its not exclusive to tanks. What I’m not sure about is the model - arcade can be made already by using tank sprocket as a wheel. More complex variant can be added too but I don’t see some sort of unity in opinions of how complex people want them to be.

Hiya
I have been watching your MMT thread with interest for some time now, there are elements that are of great interest for the “Railway” project such as the physics tick / substepping.
If in the future you wish to tackle rail vehicles physic simulation, give me a shout I am sure there could be some really intersting progress made in this area.

All the best

Paul G

Some hints for better car physics:

  • Use SI units: It’d be way easier for people to make car game if they could use SI units(m, kg, N/m, rad/s, etc.) for everything. Only exception(IMO) is damping which should use the ratio(0 = no damping, <1 = particulary damped, 1 = critically damped, >1 = overdamped)
  • Have different tire models provided: depending on data aviable to user they would like to have multiple models aviable in game. I’d suggest you adding Pacejka model for data receival aswell as some other(like the one found in Brian Beckman’s PHORS part 29). Also it’d be great if there would be different models for combined slip aviable. The brush model is very popular and well working aswell as simple one. You may wanna try it.
  • Let the default PhysX handle car. Use the add force at location for the wheel forces. The PhysX vehicle model seems to have wrong weight transfer system and wrong force application. I’ve already heard many comfirmations that PhysX standard vehicle physics sucks(so does Bullet standard vehicle physics)
  • Add more variables to wheels. Add camber angle, toe angle. For suspension add caster angle(it changes how the car reacts to road bumps aswell as changes steering). Also add ackerman steering. And make it all changable dynamically(especially camber - you should look how much it changes for some suspension types when car drives over bumps). Oh, and also don’t forget to make it all affect friction.
  • Just always remember that tire dynamics is the most important component of car. Nor suspension, nor drivetrain, nor chasis equations matters as much as tires does. Tires always are the most important, always…

Thanks for the continued support on this,

Though atm i think we’re flogging a dead horse, i wish this wasn’t true but atm i see/hear nothing but empty words, i’ve pretty much gave up with UE4 ever getting half decent vehicles, lets be honest with ourselves, decent vehicles are not require for VR , mobile or moba so with that i guess our luck is out.

i did hope for some type of time line when i was asked to start this threadbut that is not forth coming, so as i’ve mentioned in the other vehicle threads if you want decent vehicles/physics then look for a different engine !!

Hi, thanks for starting this thread. I agree with a lot of the points made on here, especially about needing a simpler more modular wheel component. Today I submitted USimpleWheeledVehicleMovementComponent which simply provides n-wheel support with suspension and friction of tires. This allows you to apply drive/brake torque to individual wheels as well as steering. I’m hoping this will make it easier to make different contraptions like shopping carts, skate boards, arcade vehicles, etc…

I also submitted a fix to how our suspension forces were being applied. It seems that before my change we were applying the force based on an offset from the vehicle center of mass instead of the spring position. This required people to often give a negative spring force offset to get realistic results. Here’s a video showing the fix: https://pbs.twimg.com/tweet_video/Cq0a7qUXEAA7kWe.mp4

Please keep the issues coming.

EDIT: I should probably mention this won’t be in 4.13 as we’ve already branched for that, but expect this in 4.14 and in github soon if you’re building from source.

EDIT2: I forgot to mention that we’ve also added a bReverseAsBrake which will allow you to turn off the reverse being tied to brake functionality.

That’s a good news!
Can you also fix collision for skeletal meshes?
In two words, skeletal meshes as a part of the vehicle can collide with objects, which simulate physics, but can’t collide with those, who don’t.
Read more here: Collision for skeletal meshes in Wheeled Vehicle - World Creation - Epic Developer Community Forums
Also can you provide a link to github with suspension forces fix?

I don’t think we’ll have the github link until wednesday which is when we push into . I’ll post it here when it’s up

Now this is the best news I have heard in a long time, many thanks for implementing this.

I look forward to redesigning my vehicles using this… mmmm wel maybe :slight_smile:

Many thanks again

Paul G

Further to the announcement of the U simple wheel.

Please give it the capabilty to use custom collision shapes, a rail wheel is probably a good example of where this would be needed/ used

Thanks

Paul G

also pls fix vehicle rolls, and character(capsule) reaction on vehicle(for now character like a wall for vehicle!!!)

I have spent a lot of time during august and got a fairly promising vehicle movement component to work for my current project.
I’ll just share some details maybe it of some use for others:

1.) I use the NoDrive PhysX Vehicle class to make use of the build in suspension system and simulate the transmission and engine myself
2.) I calculate the side ways friction in the TireShaderFunction and set the longitudinal force to zero. Also note this TireShaderFunction doesn’t seem to be called when you set a brake torque, you can double check this in the PhysX SDK code
3.) The forward forces are applied inside TireShaderFunction with ApplyForceAt

The result is a easy to setup vehicle with stable physics, unfortunately my code is still work in progress and no way refined.
The vehicle is configured with a couple of data assets not with blueprints however.

Do you have a link to the code changes now?

I wonder, why when vehicle impacts with a blocking volume, then it reacts like it should be. However if it collide with any other object then vehicle will ignore its weight, even if a big car will collide with a small brick. I tried to add invisibleWall collision preset to other objects, but it didn’t help.

Unfortunately the changes are in several files and spread out over multiple changes so it would be hard to pinpoint it. However, you could try syncing to latest in github where the changes should be available. Of course I don’t recommend using this for production until 4.14 is out.

check this guy, he made a very realistic vehicle movement/physics in ue4 02 - Vehicle Setup Part 2. - YouTube

Thanks checking this vid now, just from the gameplay of his bmw, everything looks really tight and precise.

i have been a twisted metal fan for awhile sadly this game gets limited release, the last game was in 2012 for ps3, i was impressed with its features.

the cars had characters lean in and out of the cars and shoot weapons.

parts of the cars had pop out parts with missiles etc and would shoot them out.

each car had a unique special and alternate special. eg. the herses back would split open revealing a coffin that you could aim and fire.

the motor bike guy had a chainsaw special you could throw and had slight homing capability for forty damage and you could hold back and he would do a wheely dragging the chainsaw on the ground causing sparks and would go on fire and loosing all homing capabilty and do 150 damage if you could land a hit.

it was an awesome game :smiley:

how hard would it to pull of such a game as Twisted Metal 2012??? in unreal engine?