Table of Contents

Vehicle Types

Vehicle models in Transport Fever 3 are bound to one of the means of transportation road, rail, water or air. The distinction between the types of vehicles is achieved by specialized metadata entries in the .mdl-files for each type.

In comparison to Transport Fever 2, most of the metadata refer to model parts by using the node names. Hence it is important to set proper names for the nodes. The names are displayed on the left side of the model node tree in the Model Editor too. By double clicking, you can copy these names.

Land Vehicles

All vehicles on road and rail have some common properties which are specified in the landVehicle property:

...
landVehicle = { 
  engines = {
    { 
      power = 150,
      tractiveEffort = 30,
      type = "ELECTRIC",
    },
  },
  topSpeed = 19.444,
  weightEmpty = 14000,
  weightMaxPayload = 5000,
  friction = 0.02,
  brakeDeceleration = 2.5,
},
...

A vehicle may have zero, one or more engines in the engines struct. Each engine has the following three properties:

Beside the engines, there is the topSpeed in meter per second as well as the weightEmpty and weightMaxPayload of the vehicle in metric kilogram. The weightMaxPayload describes the additional weight when the vehicle is fully loaded. To adjust the acceleration and deceleration behavior, it is possible to modify the friction and brakeDeceleration values.

Road Vehicles

Road vehicles are bound to the street network built by the game or the player. They can drive along streets as well as on construction lanes of the right type in stations, depots and similar constructions.

They are indentified by the roadVehicle metadata struct and the .mdl-files usually are located in the subfolders:

Metadata


headlight, blinker and turning wheel


steering part of L'Obéissante

The roadVehicle metadata struct consists of several struct children as well as the properties for speed and weight:

...
roadVehicle = { 
  config = { 
    axles = { "w2", },
    fakeBogies = {
      { -- LOD 0
        { 
          group = "RootNode",
          offset = 0,
          position = 0,
        },
      },
      { -- LOD 1
        { 
          group = "RootNode",
          offset = 0,
          position = 0,
        },
      },
      ...
    },
    steeringParts = { },
    wheels = { "w1_lft", "w1_rgt", },
  },
},
...

The config struct inside the roadVehicle struct covers several properties regarding the 3D model:

Keep in mind to set the correct mesh origins for the vehicle parts to ensure they rotate in the right way. For axles, the origin should be aligned in the center in terms of the x and z axis. Otherwise the axle will wobble ingame.

Events


Door animation of BK 670 bus

When the road vehicle uses the default road transformator, the following animation events can be used to support model aspects like opening doors:

Rail Vehicles

Rail vehicles run on the track network built by the player and can drive along built tracks as well as on track lanes in stations, depots and similar constructions.

They are indentified by the railVehicle metadata struct and the .mdl-files usually are located in the subfolders:

Metadata


second locomotive without headlights

The railVehicle metadata struct consists of several struct children as well as the properties for speed and weight:

...
railVehicle = { 
  config = { 
    axles = { "w1", "w2" },
    fakeBogies = {
      { },-- LOD 0
      { },-- LOD 1
      ...
    },
  },
},
...

The config struct inside the railVehicle struct covers several properties regarding the 3D model:

Keep in mind to set the correct mesh origins for the vehicle parts to ensure they rotate in the right way. For axles, the origin should be aligned in the center in terms of the x and z axis. Otherwise the axle will wobble ingame.

Events


wheel animation of a steam locomotive

When rail vehicles use the default transformator, the following animation events can be used to support model aspects like opening doors:

Trams with the default transformator have the same events except for the wheels animation and additionally they support:

For both reversible trains and trams, see the description in the next chapter.

Multiple Units

Some rail and tram vehicles are defined as multiple units. Then they are a fixed consist of more than one model. The configuration files for multiple units are usually located next to the .mdl files and have .mu.lua as file ending.

function data()
return {
  vehicles = {
    { name = "ice1.mdl", forward = true },
    { name = "ice1_waggon_1.mdl", forward = true },
    ...
    { name = "ice1.mdl", forward = false },
  },
  name = _("VEHICLE_MULTIPLEUNIT_ICE1_NAME"),
  desc = _("VEHICLE_MULTIPLEUNIT_ICE1_DESCRIPTION"),
  filterTags = { "default" },
  groupFileName = "",
 
}
end

The configuration has four properties:

For multiple units to be available, all of their parts have to be in their respective availability timespan.

Water Vehicles

Ships are bound to the navigatable water on the map. The routes are dynamically calculated based on the reachable water regions. In harbors, they stop at designated points.

They are indentified by the waterVehicle metadata struct and the .mdl-files usually are located in the /vehicle/ship subfolder.

Metadata


spinning propeller and turning rudder


spume around the water line of the ship

The waterVehicle metadata struct consists mostly of properties used for simulation:

waterVehicle = {
  area = 5,
  availPower = 294000.0,
  weightEmpty = 135000.0,
  maxRpm = 55,
  topSpeed = 7.5,
  type = "BIG",
  waterLine = {
    -- waterline configuration		
  }
},

There are the following properties:

The waterLine struct describes the form of the ship at water level that is used to generate the spume around the ships body. It is a list of two-value pairs each representing a point with x- and y-coordinate relative to the model origin.

Events


Drive Animation of Frontenac Steam Ship

Ships support some animation events. They can be used in mesh nodes to support model aspects like opening doors:

Keep in mind to set the correct mesh origins for the vehicle parts to ensure they rotate in the right way. For paddles and propellers, the origin should be aligned in the center in terms of the x and z axis. Otherwise they will wobble ingame.

Air Vehicles


tilted plane on ground

Airplanes are not bound to any terrain or infrastructure except the airports where they land, stop and start.

They are indentified by the airVehicle metadata struct and the .mdl-files usually are located in the /vehicle/plane subfolder.

Metadata

The airVehicle metadata struct consists of several struct children as well as the properties for speed and weight:

airVehicle = {
  axles = {
    { 
      position = { -2.23, 0.37, },
      radius = 0.49,
    },
    ...
  },
  wheels = {
    { 
      position = { 11.66, 0.43, },
      radius = 0.34,
    },
    ...
  },
  config = { 
    axleRadii = { 0.49, ... },
    axles = { "w2_bck_lft", "w2_bck_rgt", },
    fakeBogies = {
      {
        { 
          group = "RootNode",
          offset = 0,
          position = 5,
        },
        ...
      },
      ...
    },
    steeringParts = { "gear_g1_steering", },
    wheelRadii = { 0.34, },
    wheels = { "w1_frt", },
  },
  hasFlaps = true,
  maxThrust = 160000,
  timeToFullThrust = 3,
  topSpeed = 234.7222222,
  weightEmpty = 17819,
  weightMaxPayload = 5000,
  wingArea = 64,  
  type = "BIG",
},  


Extension and retraction of the landing gear

To calculate the correct positioning of the planes, additional info about the axles and wheels is needed. Both are lists with an entry for every position along x axis where axles or wheels are. Each entry has two properties:

Further info used for animation and positioning is provided in the config struct:

Beside the config struct, there are additional properties used for the simulation of planes and helicopters:

Events


plane config elements

Planes support some animation events. They can be used in mesh nodes to support model aspects like opening doors:

Keep in mind to set the correct mesh origins and rotations for the vehicle parts to ensure they rotate in the right way when using default animations. There are different axis relevant for different purposes!