Adding your own models to RtR

Ver.: 0.91


About this documentation


This document describes how to add your static (not animated) 3D models to RtR. Adding animated models will be described later here or in a separated document.

This description is valid with RtR version 1.4 and later.


IMPORTANT!

This documentation can be used only with the registered program! You cannot add your own models to the unregistered free version.


Creating the model


This documentation will not describe how to create 3D models, but there are a few important things we have to know about the new models.


The model can be created with any 3D modeller program. The model should be exported as an X file, this format is the basic supported format of DirectX. Not all 3D modeller programs can export X format, so this can be an important consideration when choosing it.

The scale of the model can be set later, so it is not really important what scale you use during the modelling process.

One important question is the source directory of the textures. The directory for engine and rolling stock textures should end with „…\Scenes\trains”, and the directory for the building textures should end with „…\Scenes\001haz”. So the textures can be copied in the game directory into these destination directories, and the program will find them, even if the full path contains more subdirectories at the beginning of the full texture path.


So if the model is ready, it should be exported using X format, and the X file should be placed in the „Scenes\xfiles” game directory, and the textures in the already mentioned directories.


During the modelling process you can work with bmp or jpg files, and RtR 1.4 will accept these textures. But better solution is to convert these textures to dds files, because dds files can be processed in compressed format in the video card (DXT1, DXT5), they can contain mip maps, and dds files can contain alpha channel, and that can simplify your modelling task.


If you want to create models with in the night lighting parts, these parts should have separated textures (not only a part of a bigger texture). The whole texture will light in the night, when it is listed in the file ’ltex.list’.

Smoke, steam or the lighting cones of the spots should NOT be modelled, these will be added by the program.


The buildings can contain semi-transparent parts (e.g. windows). The semi-transparent texture should be a dds file with alpha chanel (DXT5), and its name should end with ’_aa.dds’ (e.g. window_aa.dds).


Listing the model in the usr.xli file


When the X file and the textures are placed in their right directories, the model should be listed in the file ’usr.xli’. This file is not part of the installed RtR, it can be downloaded with the password generator, and then should be copied in the main directory of RtR.

The usr.xli file is a simple text file, so it can be edited with Notepad or Wordpad. The sample usr.xli file contains a model from add_obj1.xli, this object should be deleted when you add your first model to the file.


The xli file has a fixed structure.

There are a few data on the beginning, and then the records of the X files.


The structure of the file ’usr.xli':

960956 checksum, don't touch it!

1 number of objects in the file (used by the load process circle on the load screen)

RECORDs repeated record of listed objects


The structure of the RECORD when describing engines or wagons:

ENGINE_TYPE type of the object (possible values: ENGINE_TYPE, CWAGON_TYPE, PWAGON_TYPE)

1234 unique identifier (see later)

myengine.X name of the X file

1.0 scale

myname name in the object list

NOREF reference model, use only NOREF here

0.0 this number is not used

14 max. speed of the engine (this number is not used with wagons)

20 number of wagons, which can be pulled (this number is not used with wagons)

1234567 generated password (see later)




Up-date - Installing the bogies 1.5:

ENGINE_TYPE type of the object (possible values: ENGINE_TYPE, CWAGON_TYPE, PWAGON_TYPE)

1234 unique identifier (see later)

myengine.X name of the X file

1.0 scale

myname name in the object list

NOREF reference model, use only NOREF here

103.87605 distance from bogie to bogie (relative symetric on the model)

14 max. speed of the engine (this number is not used with wagons)

20 number of wagons, which can be pulled (this number is not used with wagons)

1234567 generated password (see later)




The structure of the RECORD when describing other objects:

HOUSE_TYPE type of the object (possible values: HOUSE_TYPE, RAILWAY_TYPE, INDUSTRY_TYPE, PLANT_TYPE, MISC_TYPE)

1234 unique identifier (see later)

myhouse.x name of the X file

1.0 scale

myhouse name in the object list

Scenes\001haz\texture1.dds name of the texture to paint 1

Scenes\001haz\texture2.dds name of the texture to paint 2

0xffeef5ca default RGB colour for painted texture 1

0xff029544 default RGB colour for painted texture 2

1234567 generated password (see later)



The record structure contains an unique identifier for each object.

One identifier can be used only once, that is very important.

For your own models you can use the following identifiers: 4500…4999


The scale value should be chosen so, that the size of the model will be right in RtR. (The length of the short straight track is 1, that can help to find the right scale value.)


Generating the passwords for your objects


As you can see every object has a generated password. This password can be generated with a utility program (gen_pass_for_usr_xli.exe). As the utility needs a parameter, you have to use the shortcut to start it. In the shortcut the start parameter can be edited.

First the 'usr.xli' file should be copied in the directory of the utility. Then the utility should be started using the shortcut with the right parameter. This parameter is the directory of all X files (and is already given in the shortcut with its default name), because the generated password contains information about the X files too. After running the utility it creates a new file with the name 'usr.xli_result'. This file should be renamed to 'usr.xli' and copied back in the game directory.


Now you can start RtR, and it will read the new object(s). If any password is wrong in the usr.xli file, the program will send a message, that it is not registered. In this case generate the password again, because you must have made errors in the described process.


The new object can be selected in the proper select list. If it will not displayed right, you can try to open the file startlog.txt, and find your model with the name of the X file. There you can find detailed description of the error.


Adding Sounds


The engines and wagons can have sound when they are moving. To add sound create your own sound description file and of course the needed wav file (or use an existing wav file). The name of the sound description file should be like ‘soundsources_*.list’. This file is a plain text file, you can edit it with the Notepad. Each row in this file describes one sound source. One row has the following structure (check also the original file ‘soundsources.list’):


1234 unique identifier of an engine or wagon

sound.wav the name of the wav file (sampling rate 22KHz, mono PCM file)

loop play control of the file, should be ‘loop’ for engines and wagons


The sound file should be created so that it sounds good when it will be played repeated. The sound should be stored with maximum volume, the program will control the real volume depending on the distance of the engine or wagon from the camera.