Legacy:Vehicles/Dynamics - Unreal Wiki

# Legacy:Vehicles/Dynamics

### From Unreal Wiki, The Unreal Engine Documentation Site

< Legacy:Vehicles

Physics as they apply to vehicles.

- Unlike the Anatomy page, no subPages exist for specific types (land, air, sea...)
- Any Unreal references may or may not be Karma related. Just keep in mind that Karma does have its own page!

## Real

Various forces that act upon ANY vehicle in real life. Under most circumstances, every object has these four basic forces acting upon it.

### Basic Forces

#### Thrust

  The force generated to enable forward motion of an object.

#### Drag

  The force that resists forward motion of an object.

- Aerodynamics - this is caused by an object moving through a fluid. The fluid isn't going to move out of the way by itself, so the object must use thrust to overcome this resulting drag and 'squeeze' it's way through.
- Friction - A measure of how hard it is to slide one object over another
  - This is one cause of drag.
  - Coefficient of Friction (μ) == Force Applied (F App) / Weight (w == Mass * Gravity )

#### Lift

  The force that resists the weight of an object.

- Land-based Vehicles: The 'land' itself applies an equal & opposite force to the weight.
- Winged Vehicles: Lift is generated through pressure variations caused by turning a moving fluid. Confused? I often imagine it like this: the shape of an object creates changes in air/fluid pressure when moving. The wings on a plane are designed to "manipulate" and "ride" that pressure change like a wave.
- Hovering Vehicles: Hovering is often generated from a downward thrust to cause lift, though forward thrust is non-existent.
- Balloon Vehicles: Blimps, use buoyancy to generate lift. Since air, like water, is a form of fluid... it too has a level of buoyancy.

#### Weight

  The force generated as a result of gravity.

- Weight = Mass * Gravity

### Other Forces

#### Friction

  The measurement of the force it takes to slide one object over another.

- Friction occurs due to the microscopic interactions of two surfaces.
- Example: Imagine rubbing two sheets of sandpaper together. The force keeping the two sheets together causes their roughness to also squeeze closer together. The greater the force, the more difficult it is to rub the sheets together; this is friction.

#### Traction

  A measurement of the 'grip' a vehicle has on it's surroundings.
  NOTE: This is being approached as a form of grabbing (through friction) and then pulling (through centripetal force). Possibly the most common vision is "the grip a tire has on the road".

- As traction increases, typically thrust increases and drag decreases. The actual amount of 'change' is dependent on the density of the surrounding fluid (be it liquid or gas) and the maximum amount of traction the driving surface has.
- The ratio of thrust to drag of the vehicle's tread is an occasional factor to consider. A tread comprised of long spikes would provide superior traction but greatly decrease it's ability to provide thrust.
- Surface Type - The type of surface affects the level of traction that can be obtained.
  - Small objects producing a surface - It is the individual shape (rocks vs. marbles) and collective density (Packed Gravel vs. Loose Gravel) that comprise the actual traction of the resulting surface.
  - Surface Modifiers ~ ( Dirt Road + Water = Muddy Road )

#### Buoyancy

  Most vehicles have an initial buoyancy level, since the air inside cant always escape b4 the vehicle becomes submerged.

### Aerodynamics

#### Level Flying

  Both these equations must be true. Remember: the change in speed will also change the amount of lift on the wings. Only a constant speed will provide a constant lift, enabling the plane to fly level.

- Thrust == Drag
- Lift == Weight

Note: When thrust equals drag, speed isn't eliminated but will remain constant. Similarly, elevation is constant when lift equals weight.

  odo324: Took me quite a while b4 I figured out this one :rolleyes:.

#### Changing Altitude

- Ascending (+) == Lift > Weight
- Descending (-) == Lift < Weight

#### Changing Speed

- Accelerating (+) == Thrust > Drag
- Decelerating (-) == Thrust < Drag

### Natural States

States that are NOT powered by the vehicle. ("Driving" would not be one, but "Rolling" would.)

#### Diving

- Vehicles should have an initial buoyancy factor, representing the maximum amount of buoyancy it can have (due to air being initially trapped inside).
- A vehicle's initial buoyancy will decrease immediately when it starts to take on water. However, this doesn't mean it will immediately sink.
  - The slower a vehicle travels into water, the less of a chance its buoyancy will be enough for it to momentarily float.
  - The faster a vehicle travels into water, the greater a chance its buoyancy will be enough for it to momentarily float.

#### Sinking

  If the vehicle 'could' take on water (as most do), its buoyancy should rapidly decrease (sinking it).

#### Submerged

  Underwater (or any liquid), drag is greatly increased due to the higher density of the water.

## UT2004

How the Unreal Engine mimics these forces.

### Thrust

Getting pawns to move forward.

#### Appling thrust to a KCar Wheel

The TorqueCurve is used for applying thrust to the wheel. It's defined like this:

    var (KCar) InterpCurve      TorqueCurve; // Engine RPM in, Torque out.

    defaultproperties
    {
            TorqueCurve=(Points=(
                                            (InVal=0,         OutVal=150),
                                            (InVal=245756,    OutVal=150),
                                            (InVal=491512,    OutVal=0)
                                    ))
    }

The variable "Points" can be read like this:

Starting at this Speed... | ...Effect... | Change per. ??? Category:Legacy Answer Needed
0 | A static Acceleration begins. | 150
245756 | Climax is reached, acceleration begins to drop (linarly?). | 150
491512 | Maximum speed is reached. No more acceleration. | 0

### Drag

What keep holding back pawns.

### Lift

Keeping pawns in the air.

- Hovering Vehicles
    odo324: A good visual example (in a game) that uses a single form of thrust to hover and for propulsion is the "Hydra" Fighter Jet seen in GTA: San Andreas. Its hovering jets are redirected to enable thrust.
    Regarding UT2004's "Hover Bike"? Unknown but I truly doubt it's created in this manner of downward thrust. Sadly, it act's more like a wheeled vehicle that has low traction, no tires, and has low mass.
    I've come to this conclusion because... (excluding the "Destroyed" vehicle state)
    1. ..it can't snag the ground.
    2. ..it can't tip left/right from an impact.
    3. ..it doesn't travel backward when tilted backward (holding "crouch").

### Weight

Getting pawns to fall and how the engine enables it to fall.

### Friction

How Unreal vehicles simulate 'friction'.

### Traction

How Unreal vehicles are able to 'grip' their environment.

### Buoyancy

Karma handles buoyancy by adding a bit of force to an object that is touching water. The problem with this is that it does not take into account things like how much of the object is submerged. If the top half of a vehicle isn't submerged, then buoyancy has less effect than if the entire vehicle is submerged (this is ignoring things that change buoyancy such as the vehicle filling with water.), so if you're trying to create a boat class, then the object will bounce up and down in the water as the object is in the water, is accelerated upwards, then is pulled back down by gravity. Most objects in real life stop bouncing when they reach an equal point where a small amount of the object is submerged and therefore the force caused by the buoyancy and gravity is balanced.

### Aerodynamics

### Natural Vehicle States

#### Diving

#### Sinking

- Initial Buoyancy Factor
    odo324: Say a vehicle was only submerged 40% and unable to sink further, than its buoyancy should stop decreasing once roughly 40% of is submerged.

#### Submerged

### Code

Some of these examples could be quite simple but are perhaps not obvious to everyone.

#### In-Game Examples

  Example snippets from UT'04.

#### User-Made Examples

  User examples - Snippets for UT'04.

## Related Topics

- Vehicles
- Karma
- External:
  - www.HowStuffWorks.com - Search any topic for some seriously detailed information!

## Discussion

odo324: IMO, the Hover-Bike & Helicopter-Thing feel very 'fake' (while air-born) because they respond to UI as if they have little (if any) weight. Not only that, but all vehicles have a high resistance to being crushed, which only serves to decrease their level of value in any situation.

Solid Snake: The is because there is no weight applied onto the raptor when it is flying hence there is no reason to continually thrust upwards to hover. If you notice the weight value it actually doesn't have any, if you add some on it will sink to the ground. Vehicles can't be crushed because from memory they ignore encroaching things... Besides UT2004 can't really handle crushing things very well...

odo324: The lack of Aerodynamic forces isn't really the issue (although I feel it is 'part', I left some specifics out). The Raptor in question, acts like a 'ball' that can fly. IE: "Turning". With wheeled vehicles, you can spin out of control, adding a little difficulty in performing a quick 180 (something quite fun). Now, rotating of the raptor occurs at the center of the front section, but the tail doesn’t swing around like it should. This prevents any possibility of maneuvering with skill. Of course, this subject is debatable in a game like UT'04. It is the first "real" appearance of vehicles in Unreal, after all. → At my fault, I didn't mean crushed as in "squished" but instead their resistance to sudden large forces (2 parts). 1) High-Speed collisions with anything, result in very little damage. 2) In ut'04, vehicles are 100% functional, or 0% functional. Vehicle health has no influence on vehicle-ability, sad. For an example, take the Raptor for a high-speed impact into what should be a very damaging obstacle (building or cliff) and see how damaged you become :p.

Foxpaw: I believe that those are design decisions, not really flaws. If vehicles were damaged realistically from high speed collisions, vehicles would become very unattractive as anyone could take out your vehicle by ramming it with another vehicle.

WRT not losing functionality when damaged, this is also an important design decision. The abilities of the vehicles must be carefully balanced - any change in capabilities will disrupt this balance. In effect, taking only a very small amount of damage would make a vehicle next to useless against any other vehicle - making vehiclular combat mostly an issue of "who hits first," sort of like instagib.

T1: Actually, the Manta IS a hovercraft. It CAN tip back and forth, but not much. It is held up by KRepulsors that ALWAYS repulse downward rather than repulsing the direction that the bottom of the craft is facing. If you disable the always upright variable in it's KarmaParams then it'll continue to repulse downwards even while flipped. It has 3 KRepulsors, 1 in the front, 1 on each side. Because of this, it leans back while ducking because there is no KRepulsor there to hold it up.

5parrowhawk: Making the Manta behave more "realistically" is not excessively difficult. For swaying/rocking, it's simply a matter of altering its center of gravity and adjusting the parameters of the repulsors (e.g. to increase softness). You'll want to set bStayUpright to false in any case, which will help too. Finally, you'll need to set the penetration direction of the repulsors, every tick, to match the vehicle's rotation (not too hard either). The real question is whether this would improve gameplay very much (or, indeed, at all).

## Comments

odo324: Oh, may the wiki gods forgive me! Honestly, I no references as to 'how' Unreal simulates this stuff (YET!). I'm starting with real-life info and add Unreal references as I find them. I hope others may do the same.

Category: Legacy Answer Needed

##### Views

- Legacy
- Discussion
- Current revision

##### Search