Creating a mesh building

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 create a building for my Mesh Building Enabler mod.

    This tutorial requires the Mesh Buildings Enabler to be installed. Download here: Mesh Buildings Enabler


    Step 1: Create the mesh


    First of all you need to know what type of building you want to create. There are residential, commercial, industrial and leisure buildings in the game. Next you need to choose a size. It must always be dividable through eight. Here are the sizes for the default lots::

    WidthDepth
    Small16m24m
    Medium24m24m
    Large32m32m
    Very Large48m40m


    The width is the y-axis in the modeler and the x-axis in the game. The depth is the x-axis in the modeler and the y-axis in the game. The house gets always placed in the center of the lot with the positive x-axis (in the modeler) facing the road. The axes mentioned refer to a right-handed, z-up system.


    Next you need to choose a capacity of workers/residents/customers for your lot. Here you can see the capacities of the default lots:

    ResidentialCommercialIndustrialLeisure
    Small1-41-161-81-16
    Medium5-1017-409-2017-40
    Large11-1841-7221-3641-72
    Very Large19-10073-40037-20073-400


    Since the house can be placed on a sloped road, you should create a foundation for your building, that goes a few meters into the ground.


    Step 2: Placement of files


    Files should be placed here:


    MESHES (.msh/.msh.blob):
    – res\models\mesh\building\{YourSetName} (if you create a set of buildings)
    – res\models\mesh\building\residential
    – res\models\mesh\building\commercial
    – res\models\mesh\building\industrial
    – res\models\mesh\building\leisure


    TEXTURES (.tga):
    – res\textures\models\building\{YourSetName} (if you create a set of buildings)
    – res\textures\models\building\residential
    – res\textures\models\building\commercial
    – res\textures\models\building\industrial
    – res\textures\models\building\leisure


    MATERIALS (.mtl):
    – res\models\material\building\{YourSetName} (if you create a set of buildings)
    – res\models\material\building\residential
    – res\models\material\building\commercial
    – res\models\material\building\industrial
    – res\models\material\building\leisure


    MODELS (.mdl):
    – res\models\model\building\{YourSetName} (if you create a set of buildings)
    – res\models\model\building\residential
    – res\models\model\building\commercial
    – res\models\model\building\industrial
    – res\models\model\building\leisure


    BUILDING UTILITY DATA (.bud):
    – res\config\building\bud\meshbuildings\{YourSetName} (if you create a set of buildings)
    – res\config\building\bud\meshbuildings\residential
    – res\config\building\bud\meshbuildings\commercial
    – res\config\building\bud\meshbuildings\industrial
    – res\config\building\bud\meshbuildings\leisure


    Step 3: Create your model


    A typical .mdl file for a model looks like this:



    The bounding box is (as always) very important. If it's too big, the model will not be displayed / the building will not be chosen. Always make it 0.5m to 1m in each direction smaller than the ground size is. Is the size of one direction not equal to the opposite direction, the model will be centered so that the bounding box is centered.


    Also of importance is the “visibleTo” value. Buildings should be displayed even when fully zoomed out. So turn it up real high (as in the example above) and make the mesh either very low-poly or create multiple LODs.


    Step 4: Create the building data


    Now comes the part which is probably new to you. Create a .bud text file with the following content in the appropriate folder (see step 2):



    The green colored lines are completely optional. If you leave them out, the default parameters are used most of the time.


    "result.availability.yearFrom" and "result.availability.yearTo" must not be 0 otherwise they might crash the game. Use a very high number if you want to make it available almost forever.


    Here are the rest of the parameters:

    ParameterDescription
    result.type = "RESIDENTIAL"The type of the lot. Possible values are RESIDENTIAL, COMMERCIAL, INDUSTRIAL and LEISURE
    result.capacity = { 1, 4 }The capacity of the lot. A random value between the first value (low value) and the second value (high value) is chosen when a building gets built. It always fits the cities needs.
    result.parcelWidth = { 3, 3 }The width of the lot. Caluclated by width divided by eight. No decimal values are allowed. If the value is too high, the chance of it appearing sinks drastically. See the data table in step 1 for default sizes which are always appearing. Both values should be the same.
    result.parcelDepth = { 3, 3 }The width of the lot. Caluclated by width divided by eight. No decimal values are allowed. If the value is above six, it will never appear. See the data table in step 1 for default sizes which are always appearing. Both values should be the same.
    result.params.assetCenter = ""The model you created which gets placed in the center of the lot.
    result.params.assetGarden = { }An array of garden assets (.mdl) placed randomly in the part of the lot that is not blocked by the bounding box of the building's mdl file. By default no assets are used.
    result.params.assetTree = { }An array of possible tree models you want to use on your lot.
    result.params.assetProbGarden = .0Not sure what this does, but the higher the number, the more garden assets are placed. It's probably a value between 0 and 1. By default it won't spawn any garden assets.
    result.params.assetProbTree = .0Not sure what this does, but the higher the number, the more trees are placed. It's probably a value between 0 and 1. By default it won't spawn any trees.
    result.params.matWall = { }An array of walls from the folder "res\config\building\btd\wall" which are placed at the edges of the lot beneath the ground (so that there is a wall when the house is placed on a sloped road and floats in the air). By default, there won't be any walls.
    result.params.shapeGridSize = 6.0This defines how accurate the terrain gets leveled around the building. The higher the value, the more precise it'll be. Six is a good value to work with.


    Step 5: Test it in the game


    If you did everything right, you should have a a custom building in the game.
    [Blocked Image: http://www.train-fever.net/index.php/Attachment/15221-Picture-jpg/]


    Congratulations! The Train Fever Community awaits some cool buildings from you now.


    If you have any trouble concerning this tutorial/mod, leave a comment/reply here or in the Mesh Buildings Enabler Thread.

Share