Repainting a model

Willkommen in der Transport Fever Community

Welcome to the fan community of Transport Fever and Train Fever, the economic simulators of Urban Games. The community is free for you to share and inform yourself about the game. We cultivate a friendly and objective interaction with each other and our team will be happy to answer any questions you may have.


Registration and use is of course free for you.


We wish you a lot of fun and hope for active participation.

The Team of the Transport-Fever Community

  • On preparing a model for repainting

    How to prepare a model for repainting

    Sometimes, there is one individual livery missing from some model in ones game. Now, it is of course possible to contact a modder, request him to deliver this paint job and then hope and wait.

    Or you just do it yourself. This is surprisingly easy and quickly done in TPF2.

    And here´s how.

    1. On etiquette and good manners

    Both are of the essence and of course will be well minded also when repainting a model. If one wishes to do a repaint solely for personal use, this is generally not considered a problem. But should You wish to upload Your repaint somewhere for all to use, no matter if this is on, Steam or wherever else, it positively takes the original creators approval for this. This is not only a question of style, but also of copyright laws: the model is still owned by whomever created it; as a repainter, You can only claim copyright to the files You created from scratch, i. e. the texture files.

    2. Some basics and terminology to get going

    A model consists of a number of individual parts, meshes, that sit in files holding the extension ".msh". So I´ll keep using the name .msh for those in this text. There is a secondary file to each .msh that sits in a ".msh.blob" file; this is of no relevance for repainting. I will generally use the word "irrelevant" in this text to refer to things that are of no importance to a repaint; they are of interest if one was to attack other features of the model though. Now, tThe general visual features are then assigned to the basic part via a material file, bearing the extension ".mtl" and which will therefore be referred to as such in the following. A model file with the extension ".mdl" (You already guessed how I will refer to those from now on) then assembles all those files and a few more that are not interesting for a repaint and creates the model out of those. So, to cut it short: a .mdl gathers all the .msh and .mtl into a model. So far, so simple.

    What we need to do for a repaint is to duplicate the existing model. To obtain such a duplicate, the following is required:

    - an adapted copy of the .mdl,

    - calling for an adapted/new .mtl file to apply to the relevant parts,

    - in turn using new texture files for the materials.

    The preparation can be done in less than 5 minutes; creating the new texture files may take as long as required to achieve the desired looks. Here, no estimate is possible.

    And now, let us turn to the mentioned files and see how all this is achieved. I will begin with an excerpt of a .mdl file; the model I use here as a generic example is the Cubana Tupolev 154B that is a part of the downloadable set on here. After some irrelevant lines, You will find a lot of blocks looking like this:

     materials = { "vehicle/plane/Tu-154B CU.mtl", },
     mesh = "vehicle/plane/Tu154B/Tu154B_Rumpf.msh",
     name = "MSH_Tu154B_Rumpf_1",
     transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, },

    There may or may not be other things in such a block, but those are irrelevant here as well. What matters to us here is that the .msh "vehicle/plane/Tu154B/Tu154B_Rumpf.msh" is assigned the material "vehicle/plane/Tu154B CU.mtl". It is possible that one mesh is assigned multiple materials e. g. in case of a door with a transparent window; here, the solid parts may use one material and the glass another.

    Let us now look at the mentioned .mtl that the Tu154B_Rumpf.msh is bearing.

    This does look scary at the beginning, but not much longer :) The beginning of the file is again irrelevant, but You will find various blocks that each call for one individual texture file and assign it its role. Not every block is to be found in the .mtl, but not every block is relevant anyways. In the .mtl You will use for repainting, there will always be a block "map_albedo" and "map_metal_gloss_ao" and often another "map_cblend" (possibly appended with "_dirt_rust"). If You like to brush up on the various kinds of texture here, let me refer You to SkyJoes excellent articles - with those, there is no need for me to repeat all this.

    Now, what is relevant here is the "map_albedo" that defines the colours of the livery, possibly as well the "map_metal_gloss_ao" (metallic shine, general reflectivity and ambient shading in dark corners of the model), and if so desired the "map_cblend" that defines the areas for the user-selectable paint and, in case of _dirt_rust as well (as You will have guessed) these layers. Dirt is quick to come on, rust will only appear when the model is approaching the end of its useful life. To find more detailed information on those files, let me refer You to SkyJoe again.

    3. Preparing the model for repaint

    So what we need for a repaint is a new .mdl that assigns the parts to be repainted a new .mtl. This is easily done.

    a. Preparing the .mdl

    Open a .mdl of the desired model. You will need to find out which material is used by the parts to be repainted - this is usually easily determined by reading the .msh names. If a .msh name contains the words "body", "fuselage", "boiler" or similar, You have likely found Your candidate.

    Now check the name of the associated .mtl. Assuming You want to repaint the example Tupolev, You will find it is called "Tu154B CU.mtl". Now just use the search-and-replace function of Your preferred text editor to replace all instances of this file name by another, unique material name. Let me call it "Tu154B Repaint.mtl" here - what You pick here is entirely up to You, it just better be unique to avoid cross-contaminations between models.

    That done, save the .mdl under a new, unique name!! to the same directory. Now, as the new .mtl You just referred to in the .mdl does not yet exist, trying to open the .mdl will result in a CTD, so let us continue right away.

    b. Preparing the .mtl

    Open the still present .mtl the .mdl used to bear, in this example "Tu154B CU.mtl". Look up the blocks "map_albedo" and, if desired, also other blocks and change the names of the requested texture files (.dds or .tga) to new, again freely chosen ones that You intend to use for Your repaint. Now save the .mtl under the name You assigned to the parts in the .mdl, in this case "Tu154B Repaint.mtl". It is vital that this name is unique in the entire game: if You choose a name that is already in use, the material will, loading sequence depending, be overwritten or overwrite the other material by the same name. This does not tend to yield presentable results, so again, use an unique name. I suggest something like "(your username)_(model name)_(name of livery).mtl" to be extra safe.

    The requested picture files are not required to be available at this stage - with the .mdl and .mtl prepared as just described, You can open the .mdl in the model editor or even in the game. It will however not be textured: a missing "map_albedo" will result in the model showing a purple colour, a missing Cblend file will result in very rapid aging, and so on - generally, the looks will be weird, but there will be no CTD.

    And now You have Your empty canvas at hand ready for Your repaint. So pick up the smock and the paintbrush, Picasso :)

    4. Integrating the model into the game

    Now, as soon as You have the livery done, You can use the model ingame and it will hopefully look excellent. However, what You still want to have is the little preview picture in the hangar/depot menu: until now, You just have the purple squares that the game uses as fallback if it finds no usable picture. Now, to obtain those, I suggest using the model editor that is included both in the Steam and GOG version of the game: a simple click on "Screenshot" will yield all the required pictures and place them in the correct directories.

    One final thing needs to be done: the description in the purchase menu ought to show the new liveries name as well. To achieve this, open the .mdl again. Quite far down, near the very end, there is a block reading:

    description = {
     description = _("Dreistrahliges Mittelstreckenflugzeug"),
     name = _("Tupolew Tu-154 B Cubana"),

    ...which ought to be self-explanatory and easily adjusted.

    And then it should all be done - enjoy Your new repaint! :)