Vehicles in UE4 , a constructive debate

lets start a constuctive debate on what we would like for vehicles in Unreal Engine 4 and how to implement them.

i’ll be updating this post as idea’s / bugs come up

1st. what known bugs are causing you problems as of 4.12.4

2nd. how do you want to make your vehicle ‘engine side’ eg using a ‘wizard’ / base blueprint with add on components / base code with as much open as posible / other ideas

3nd. how important is realisum to you eg. control variables/physics

4nd. what sort of vehicles do you want to create

please remember i want to keep this constructive, please make 1 post as wish list and lets see what we can get done

current options

engine - pawn class / 4wd car
BoredEngineer - Machinery-Modelling-Toolkit Free plug-in

reserved for me
bath towel is on the lounge by the pool

issues/bugs/show stoppers

  1. physics - wheels / flying of into space due to curbs/props
  2. replication on posses/unposses for child actors eg passengers
  3. wheeled vehicle code fix when adding more than 4 wheels in the blueprint (not had time yet to double check if this still crashes)

wish list

  1. wizard for simple vehicles
  2. advice for multiplayer vehicle passengers
  3. vehicle AI
  4. some want every variable exposed, i can understand that to an extent, but would only help the people who know what each one does.

my wish list atm

1, basic vehicle class with built in posess/unposess with pawn/character/multi-seat
2, add to above movement components for wheeled / tracked / hover / copter / air
3, advice on best practise for adding weapons / turrets / extras

my bugs atm

tbc

my debatte themes

  1. Vehicle Wizard , nice idea but can be limiting if the options you want are not included.
  2. base Bp with add-on components, my personnal choice more control which means more work for me.
  3. pure code base, great for those that can code would be require for full on car/race/flight sims. sorry out of my depth not for me.
  4. Plug-ins yes / no - free / paid. plug-ins are a great idea and gives a for devs to really show what can be done, down side i see is if the dev doesn’t keep up with the engine then your stuck, some devs are really on the ball with this other need to pull thier socks up, worst case the dev stops !!!

Hi ,

For tanks, I’ve tried 1st and 2nd options.

1st option (Tracked Vehicles) seams to be more popular with users. Unfortunately it’s hard to develop it as you have to pre-can functionality for different type of vehicles and then somehow propagate improvements between pre-canned BPs. I’ve tried using inheritance in BPs to solve this, unfortunately it’s too wonky to be really useful.

2nd opinion (MMT Content) is somewhat better. It provides a lot of flexibility and you could build pretty much anything. The downside is that users would have to learn quite a lot of ins and outs of the system and it takes quite a lot of time to document everything and I don’t mean documenting code but documenting how it all works so that anyone can assemble and tune a vehicle. This option allows to build a plenty of pre-canned setups and they would be easier to maintain and develop by means of working on components themselves.

Honestly, I think the #1 problem with vehicle dynamics in UE is that they use PhysX, which isn’t particularly highly tuned for the job.
The Open Dynamics Engine has a “contact patch” joint which has tons of helpful features to simulate wheel contacts, including parameters like:

  • anisotropic friction
  • static-and-dynamic friction
  • force dependent slip
  • surface movement velocity
    The PhysX physics model does not have the same level of configurability and thus making a properly behaving tire contact hard.

My list would be:
1: No bugs in my vehicle workflow yet.
2. I’d love a wizard for vehicle creation. I’d love to see a dialog or window that prompted the import of vehicle chassis, what the body is, assign tires, and how should the suspension behave. I do this often enough that I know the processes and can do them basically with my eyes closed, but to have this automated (I don’t really know how to build tools effectively, and I’m not at the point where I want to create/test/implement my own tools) would be just fantastic. Particularly when controlling how movement priority should be handled, and even moreso for streamlining line traces to materials for tire track creation. That’s just a pain.
3. I’d prefer ease of physics configuration over realism to a point. If easy configuration comes at the cost of physics realism (adjust these four values to makes the physics you want! But, it’s not going to be as accurate as Gran Turismo!) I’m Super Okay with this.
4. My primary interest is in creating mostly standard vehicles - road and offroad stuff. Not like rock crawler kinds of things, more along the lines of rally cars, with my target audience being kids. This is why ease of implementation is key, and hyper-accurate physics aren’t critical. I need to be able to put new cars in quickly to react to demand, and as long as they react predictably the physics aren’t going to be judged harshly.

For me the most pressing thing would be modularity that works.

The theory of adding child actors to a BP is a great one, except that physics and collisions are not cascaded down.

Sort this for the entire engine and you could make sub assemblies eg a Mcpherson strut that had dimensional parameters and just drop it into any vehicle BP.

My development arena is rail vehicles using purely physics.

Sly

This is a really great way of presenting this information. We’re always looking to improve the engine and it would really help us understand how you would expect an “Epic Quality” vehicle tool to work. Please keep the feedback coming, we’re listening :smiley:

Vehicle AI like with characters. When u have set of simple instructions to tell your vehicle where to go without calculating when and how vehicle show streer and throttle

I agree with the last one. A vehicle AI that can be used just like a character AI.

It’s great that Epic backs this thread up, otherwise it would be just whishfull thinking.

For me would do driveable vehicles without AI. Some basic vehicle types and exposed variables to modify them easily (e.g. top-speed, accelleration, and so on).
Vehicle types could be like in UT3, or such basic “vehicle-factory-setups”:

  • 4-wheel: car to cover the range (by parameters) from race-car to offroad-buggy.
  • tank
  • 2-wheel: bike to motorcycle
  • train, maybe spline-based for the tracks?

Additionally:

  • helicopter
  • plane to jet
  • parachute

Each vehicle type should not have a sterile prototype mesh like in the existing vehicle templates, but rather a modern, realistic model & animations like the pickup in the vehicle game/launcher.
The model should be build for easy modification (e.g. see the material-instances of the pickup to change colour, add dirt and so on), adding a weapon, exchange some basic parts/modules (like wheels) and so on.

For each vehicle type should be provided several example setups/paramters e.g. for the 4-wheeler this could be:

  • race-car showcasing the grip
  • muscle-car showcasing drifting
  • -buggy showcasing suspension
    … and so on

Some additional pickups for fuel and repair of the vehicle would round up this set.

1st. what known bugs are causing you problems as of 4.12.4

So far the problems I have had have existed since I started with vehicles in 4.6: The physics bodies of the vehicles have a lot of artifacts when interacting with other physics bodies, and particularly character movement capsules. I got around this by always protecting the vehicles physics bodies with an external collision body I add in later and flag “ignore vehicle”

A big problem which causes me to have to spend a lot of extra time in level creation is when the physx wheels clip over a protruding piece of collision, like say a rock or a short post, the sudden change in height can cause the physx to react sharply and potentially flip the vehicle, this happens a lot when turning into the object and hitting it from the side. I have to spend a lot of time going over every part of the map and either setting collision on objects to ignore vehicle, or putting in tall vehicle blocking volumes to prevent the vehicle stepping up on the object.

The gearbox, the current gearbox only allows for gear shifts based on RPM, as it stands if you have a vehicle trying to climb a hill it will shift up, lag, then shift down, and repeat. This only happens when climbing hills, the gearbox won’t sit in a gear and crawl. I have made a custom gearbox that shifts based on speed, but it is far from perfect.

The engine torque, as it is right now, the engine does not lose RPM when shifting up a gear, it seems to operate more like an electric motor with a brief lag between gear shifts, this is more common in heavy vehicles with slow top speeds and higher gear ratios.

Also wall riding still happens, vehicles don’t like to roll over unless the wheels have already broken contact with the surface for other reasons (jump, fall)

A bug with the replication - the vehicle shuddering left and right when moving at speed, I think it may have to do with location updates in the networking.

Super heavy vehicles - setting the vehicle weight to anything over say 10, 000 and the vehicle just does not operate well at all.
**
2nd. how do you want to make your vehicle ‘engine side’ eg using a ‘wizard’ / base blueprint with add on components / base code with as much open as posible / other ideas — **

I like the way everything is set up as it is, you can use external curves for the engine torque, it just all needs a bit more tuning especially with load and gear shifts.

**3nd. how important is realisum to you eg. control variables/physics — **

Realism is nice, however too much realism is expensive performance wise, I like a balance, I just think the obvious unrealistic results of crashing or flipping a vehicle should be fixed.

4nd. what sort of vehicles do you want to create —

I have created 2wd, 4wd, 8wd, half tracks and tanks, this is mainly the stuff I work with, however motorbikes would be awesome one day, I have attempted but the results were not very good.

Some things I have yearned for in the UE4 vehicle is to have “contact surface” from the debug exposed to BP so we can change effects etc based on the physmat the vehicle is on, and also for some basic skidding or slip detection in built in (might be there already and I goofed)

All in all I am pretty happy with the vehicles in unreal, there are some obvious bugs that need to go, but I think the system offers quite a lot considering how difficult vehicles can be!

I would also need somekind of support or tutorials to Car AI, which is my biggest problem. Different cars can be bought in marketplace, but ai is for many big problem

All fixed for now…

Hi,
I am not an expert in UE4, but my own personal experience is that I almost never take the physical layout of the subject recreate in whatever software and expect it to work.

In your example of the wheelchair, you mention that 2 wheeled vehicles don’t work… then put 2 more wheels under it that are invisible.

Come to think of it… I have never seen a two wheeled wheelchair, they all have castor wheels under the front/ rear ?

Guess what I am saying is come up with a physics layout that reproduces the movement you want, all invisible then add the visible bits after
EG

Add a cube as wheelchair chassis
Add a sphere each side as the wheels
2 small cubes as a castor for the front wheels with pivot offset
the 2 small spheres as the castor wheels
eash object needs physics enabling and held together with constraints.

You don’t make things in a computer game the same way as they are made in the real world

Hope of some help

Sly

All fixed for now…

Honestly for a wheelchair I would probably use the character movement component and have the wheelchair as an attached mesh with constraints to make it look like it is behaving properly.

just add a bone front and rear to enable steering (invisable wheels) and use the 2 side wheels for drive/power, i did that sort of thing in udk for motorbikes and it worked fine

Thanks this fixed my issue, as best as it could, now I need to tweak it to fit the proper feel and look.