Map mod format

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

  • How to package a map mod

    From Train Fever 7554 we can create maps based on height maps, but just adding the height map isn't enough.
    The first part of this guide is for basic maps without any extra mod manager support. The second part is about how to package the map so it can be handled by a mod manager.


    First off, if you haven't already a maps folder in your Train Fever root, go ahead and create one.
    To install a height map you need one folder for the map and then at least two files

    Code
    Maps
      +-- Arbitrary_folder
              +-- info.lua
              +-- heightmap.png


    The Arbitrary folder can be named anything you like and is not shown anywhere in TF. However, it servers like a map ID internally in TF to keep track of what map you have selected. Just as with the mod ID, I would recommend to use the same naming convention as for mods, except the version part.


    Author_MapName


    For example:

    Code
    Maps
      +-- gwinda_west_sweden
              +-- info.lua
              +-- heightmap.png


    Info.lua
    This is a much more simple version of the mod's info.lua

    Code
    function data() return {
    
    
      description    = "The area from Bohus to Kungsbacka",
      name           = "Sweden's west coast",
      range          = { 25, 1000 },
      seed           = 'A working map seed'
    
    
    } end


    description
    This is obviously a description of the map, but doesn't support localization at all.


    name
    This is the map name you will find inside Train Fever and has nothing to do with the folder name (map ID). This name doesn't support localization.


    range
    A table specifying min and max height of the map where the water level is fixed at 100.
    In the example above, pure black will be placed at 25 (-75m below the water level) and pure white at 1000m (900m above water level).


    seed
    If the height map contains a lot of water or other obstacles, there is sometimes not enough space to connect all cities and the map creation will fail. To ensure that the map will work, a tested map seed can be provided. The seed follows the same rules as any map seed in Train Fever.



    heightmap.png
    This must be a grayscale image saved in .png format. It can be either a 8bit or 16bit image. It can be one of three accepted sizes.


    Small: 2049×2049
    Medium: 3073×3073
    Large: 4097×4097


    Black is the lowest point and white the highest. The range parameter in info.lua controls the scale and water level.



    Package a map mod for use with a mod manager
    TFGM can already handle the basic map format described above, but with very little feedback. For example no author information or localization.
    Just zip or rar the map ID folder and you are ready to go.

    Code
    Archive.zip
        +-- gwinda_west_sweden
                +-- info.lua
                +-- heightmap.png


    From TFGM's point of view, a map mod is treated as any ordinary mod and can have additional files, to be used by a mod manager.

    Code
    Archive.zip
        +-- gwinda_west_sweden
                +-- info.lua
                +-- strings.lua
                +-- image_00.tga
                +-- heightmap.png


    Info.lua
    This is pretty much the same as a mod's info.lua


    name
    Note that the name can be localized with the strings.lua file. This localization only works in the mod manager.


    description
    Note that the description can be localized with the strings.lua file. This localization only works in the mod manager.


    minGameVersion
    This is the minimum Train Fever version this map mod requires to run. In practice, set this to the Train Fever version you tested the map mod against.
    The variable is optional and can be excluded.


    tags
    This is a table with tags so the map mod can be categorized/grouped/sorted etc.
    The tag name itself serves as the tag identifier and should therefore be in English, preferable one word.


    Example:
    tags = { "Map", "Sweden" }


    TFGM have the capability to localize tags so you can search for a tag in any of the localized tag versions and still find it.
    There is no need to put the authors or map mod name as a tag, these are included automatically in TFGM searches.


    authors
    This is a table with one or more authors to the mod. An author can have a role indicating his contribution to the mod.


    Example with 3 author:



    name
    The name of the author, displayed on the author card and in list view.


    steamProfile
    This is the numerical Steam profile ID. You can retrieve it from TFGM's Preferences dialog.
    The ID is used to fetch your Steam avatar image and link to your Steam Profile Page.


    role
    There are currently 5 roles.


    "CREATOR"
    This is a lead creator of the mod.
    The text field have at this point no meaning and can be freely used. You can put it inside a _(...) for translation.


    "CO_CREATOR"
    This is a Co-Creator contributing to the mod.
    The text variable specifies what he/she contributed with. You can put it inside a _(...) for translation.


    "BASED_ON"
    This mod was based on the work of this author.
    The text variable specifies the mod(s) this mod was based on.


    "TESTER"
    This author did mod testing.
    The text variable specifies what was tested. For example "Windows 7", "Linux", "Mac" etc...


    "TRANSLATOR"
    This creator contributed with a localization (translation) of the mod.
    The text variable specifies what language he/she contributed with.
    The language is specified with it's ISO639-1 language code (not to be confused with a country code).


    text
    This field has different meaning depending on the role, see each role for an explanation.



    Strings.lua
    This works exactly in the save way as the mods do.


    Code
    function data() return {
    
    
      sv = {
        ["The area from Bohus to Kungsbacka"] = 'Området från Bohus ned till Kungsbacka',
        ["Sweden's west coast"] = 'Sveriges västkust'
      }
    
    
    }


    Image_00.tga
    This is the map mod's image inside the mod manager. If this file is missing, the heightmap.png will be used instead.
    Since this image isn't used by Train Fever, it can actually be in any of the following formats:


    .png
    .tga
    .bmp
    .gif
    .jpg

Share