How to create your own models and add them into game
Now I try to briefly explain how to get new models into game. From zero to moveable on the rails.
For anyone who never did it before: after reading this you will be able to make your own model.
Let's start:
New model for Rule the Rail game must include these files.
file.x = 3d model
file.dds = textures
file.xli = info for game about new model
Optional is:
file.list = additional things like, lights, smokes, sounds, and night windows. These *.list files are not necessary for running of model.
1) Creating 3D model
When I began I tried download 3d models of objects I wanted from internet. I thought it is very difficult to make anyone by myself......until ...... until I discovered Sketchup. Such amazing - easy - intuitive - beautiful - google software. I can only and only recommend to use for making 3d models. The basic version is free and I never needed any tools from the paid version. But, yes, there are some plugins I would highly recommend to install into Sketchup.
3DradExporter
from TIG: Mirror v3.8, weld v1.0, Extrude Tools v 2.1
from Fredo6: Joint Push Pull, RoundCorner v2.5a, Curviloft v1.2d
The first one 3DradExporter you must have, because this converts the model into X file, which is needed by game.
Download Sketchup, try it and you will see how easy is making new train. For better understanding some tools you can watch tutorial videos on youtube. There are many.
When creating model, it doesn't matter what scale you are using. The scale is set later by the game. When I create something, I firstly find the technical drawing on Internet according which I am able to make well proportional model.
See picture:
For anyone who never did it before: after reading this you will be able to make your own model.
Let's start:
New model for Rule the Rail game must include these files.
file.x = 3d model
file.dds = textures
file.xli = info for game about new model
Optional is:
file.list = additional things like, lights, smokes, sounds, and night windows. These *.list files are not necessary for running of model.
1) Creating 3D model
When I began I tried download 3d models of objects I wanted from internet. I thought it is very difficult to make anyone by myself......until ...... until I discovered Sketchup. Such amazing - easy - intuitive - beautiful - google software. I can only and only recommend to use for making 3d models. The basic version is free and I never needed any tools from the paid version. But, yes, there are some plugins I would highly recommend to install into Sketchup.
3DradExporter
from TIG: Mirror v3.8, weld v1.0, Extrude Tools v 2.1
from Fredo6: Joint Push Pull, RoundCorner v2.5a, Curviloft v1.2d
The first one 3DradExporter you must have, because this converts the model into X file, which is needed by game.
Download Sketchup, try it and you will see how easy is making new train. For better understanding some tools you can watch tutorial videos on youtube. There are many.
When creating model, it doesn't matter what scale you are using. The scale is set later by the game. When I create something, I firstly find the technical drawing on Internet according which I am able to make well proportional model.
See picture:
When making model have in mind following thing. Sketchup creates surfaces (faces) with both sides. The front side is white. Back sides are like blue. Back sides are fully transparent in Game! In game you will see "through" this faces like they are not there. So you must make model with all faces front-sided. To reverse face, use right mouse button and select "reverse face".
During modeling avoid doing too much complicated surfaces and models. Everyone wants models in game which are not too hardware demanding. To keep fps in proper values. The worst are any curved surfaces, like cylinders, spheres etc. When making circle in Sketchup after selecting the tool you can write number of segments it should have. (right bottom you see that option) for train bumpers it is more than enough 6 segmented cylinder (hexagon instead of high polysurfaced cylinder).
Ingame camera view is made in such way that any bottom faces on models cannot be visible. So it is good idea to delete them all. See pictures.
During modeling avoid doing too much complicated surfaces and models. Everyone wants models in game which are not too hardware demanding. To keep fps in proper values. The worst are any curved surfaces, like cylinders, spheres etc. When making circle in Sketchup after selecting the tool you can write number of segments it should have. (right bottom you see that option) for train bumpers it is more than enough 6 segmented cylinder (hexagon instead of high polysurfaced cylinder).
Ingame camera view is made in such way that any bottom faces on models cannot be visible. So it is good idea to delete them all. See pictures.
For undercarriage (wheels on trains) I use two faces very close each other. And each of them turned the opposite side. Because I wrote the back sides are not visible and if is the gear from one face only, you would not see in game the wheels on opposite rail. I mean the wheels which are farther. Hope you understand.
Well, the model is done. All faces are turned right. It's time to clothe our model into textures.
2) Making textures
Look at some texture from game to know how it can look. See picture.
Well, the model is done. All faces are turned right. It's time to clothe our model into textures.
2) Making textures
Look at some texture from game to know how it can look. See picture.
The best way is to find your model on Internet and download some pictures of it. To have an awareness how the models looks in colors. Or if it's something real in your neighborhood then take a camera and make the best pictures of it. All parts that will be textured simply place as close as you can in one file. By using any paint program. Sometimes you can do it only with paint from windows. Try to have the size of file as small as possible with maintain good readability. If you have no good photos, then you must paint the texture by hands in some paint program. Sometimes it is even better because models then look more like models and it is more beautiful than top real objects. I say that nicely painted models are in game prettier because we play with game not with ultra real simulator.
The file must have this multiple dimensions!! 2,4,8,16,32,64,128,256,512,1024,... (For example 1024 x 256, 1024 x 512, 128 x 128, 64 x 256, etc...) Avoid using any other measures like (137 x 1050) - this is wrong! And dimensions bigger than 1024 are too big in vain.
Note: The game will load the textures in any sizes, but it takes more time and PC resources to load such texture. Due to it is BETTER to use textures in dimensions of two.
Well. Format of texture files: The game can read BMP, JPG and DDS. But the Game developers highly recommend using dds format. Because the game can work with it faster. And in dds you can also apply alpha channel. So when you have textures in bmp or jpg use a graphic editor to save it in DDS. I use Paint.net, it's free and almost professional. There is also DXTBMP tool which is really simple, but works.
But here is a note: When applying textures in Sketchup, this program doesn't support dds files, so you must use other format (I prefer PNG, because it also supports alpha channel) and convert to dds only just prior to copying into game. The file format in X file we will change later.
Now how it all works: I spent a lot of time to study how the game knows which part of texture belongs to which part of 3d model. Here is the explanation. (heuréká) This information is hidden inside of X file. Or in 3d model file. Sketchup has *.skp files and when you cover model in Sketchup by textures, the program writes these infos together with 3d positions of faces and parts into the skp file. When you exports skp file to *.x file, this info is copied into x.file as well.
SO, You have your model in Sketchup. Click File/Import... and open your texture file from your disk. Before opening check that you import it as a texture.....see picture
The file must have this multiple dimensions!! 2,4,8,16,32,64,128,256,512,1024,... (For example 1024 x 256, 1024 x 512, 128 x 128, 64 x 256, etc...) Avoid using any other measures like (137 x 1050) - this is wrong! And dimensions bigger than 1024 are too big in vain.
Note: The game will load the textures in any sizes, but it takes more time and PC resources to load such texture. Due to it is BETTER to use textures in dimensions of two.
Well. Format of texture files: The game can read BMP, JPG and DDS. But the Game developers highly recommend using dds format. Because the game can work with it faster. And in dds you can also apply alpha channel. So when you have textures in bmp or jpg use a graphic editor to save it in DDS. I use Paint.net, it's free and almost professional. There is also DXTBMP tool which is really simple, but works.
But here is a note: When applying textures in Sketchup, this program doesn't support dds files, so you must use other format (I prefer PNG, because it also supports alpha channel) and convert to dds only just prior to copying into game. The file format in X file we will change later.
Now how it all works: I spent a lot of time to study how the game knows which part of texture belongs to which part of 3d model. Here is the explanation. (heuréká) This information is hidden inside of X file. Or in 3d model file. Sketchup has *.skp files and when you cover model in Sketchup by textures, the program writes these infos together with 3d positions of faces and parts into the skp file. When you exports skp file to *.x file, this info is copied into x.file as well.
SO, You have your model in Sketchup. Click File/Import... and open your texture file from your disk. Before opening check that you import it as a texture.....see picture
Put the texture on part you want. Right click and choose: position texture. Increase/decrease/move/rotate the texture to fit with your model. On curved faces use the "projection" function. How to project textures on model, see tutorial videos on youtube. Here is one: CLICK
3) Before Exporting
So, you have completed model with all surfaces textured. It is time to export the model into x.file format.
First: you must your model unify with coordination system used in game.
Solid green axis = positive height in game
dashed green axis = negative height in game (parts placed in dashed green space will be under ground in game :))
blue axis = longitudinal axis of your object. In our case longitudinal axis of train (from nose to tail)
red axis = transverse axis of object.
Origin (0,0,0) in sketchup is the center by which the game places objects. Your train accordingly must be placed ...., ...ehm, too difficult to describe.... see the picture :)
3) Before Exporting
So, you have completed model with all surfaces textured. It is time to export the model into x.file format.
First: you must your model unify with coordination system used in game.
Solid green axis = positive height in game
dashed green axis = negative height in game (parts placed in dashed green space will be under ground in game :))
blue axis = longitudinal axis of your object. In our case longitudinal axis of train (from nose to tail)
red axis = transverse axis of object.
Origin (0,0,0) in sketchup is the center by which the game places objects. Your train accordingly must be placed ...., ...ehm, too difficult to describe.... see the picture :)
Whole train is in the solid green space, and divided by blue and red axis to exact halves.
NOW here is an IMPORTANT NOTE:
The game and the Sketchup program work with respectively flipped YZ planes. SO when you have your model in sketchup finished and placed in origin as I described above, you MUST flip it through YZ plane. It is the plane determined by green and blue axes in sketchup! I explain: Use the scale tool: [s-key is shortcut] and mirror the whole train along RED AXIS direction. Keep scale 1. See picture.
The second option is this: Select whole model, use right mouse button and choose: Flip / along Red axis. The model will flip and will stay in the center.
What you get is model with mirrored textures. It is OK. Because the game flips it back into right position. How fairy !
What we make by hands should normally make plugin which converts skp into x file. But I haven't found such yet.
So: You have finished model, fully textured and flipped. Only now you can export it. For this you need 3DradExporter plugin installed. Open Menu/Plugins/3Drad/ and choose: "Export as generic DirectX file"
Open the currently saved file.X by notepad. Go to the very end by pressing Ctrl + End. Here you find lines with names of textures you used in Sketchup. Before each name insert this path "C:\\Scenes\\trains\\" So it looks like: see picture.
What we make by hands should normally make plugin which converts skp into x file. But I haven't found such yet.
So: You have finished model, fully textured and flipped. Only now you can export it. For this you need 3DradExporter plugin installed. Open Menu/Plugins/3Drad/ and choose: "Export as generic DirectX file"
Open the currently saved file.X by notepad. Go to the very end by pressing Ctrl + End. Here you find lines with names of textures you used in Sketchup. Before each name insert this path "C:\\Scenes\\trains\\" So it looks like: see picture.
Here is the right time to change PNG (or bmp, jpg) format of textures you used in Sketchup, into DDS. It is quite simple, just rewrite the info in the X file. PNG, or JPG or whatever extensions just overwrite with DDS. (\\Scenes\\trains\\texture1.bmp >> \\Scenes\\trains\\texture1.dds). Save and close.
Your path must always include: Scenes and one more folder with double \\ among. Only in such form the game will know where to locate the texture. You can use trains folder for engine and wagons textures, and any other folder you can choose for others models. You can create any folder you want, but the texture must be there physically.
\\Scenes\\trains\\xxx.dds
\\Scenes\\001haz\\xxx.dds
The changed file.x is done and ready to copy into game. As well as textures.
4) Creating file.XLI
XLI file has this shape
Your path must always include: Scenes and one more folder with double \\ among. Only in such form the game will know where to locate the texture. You can use trains folder for engine and wagons textures, and any other folder you can choose for others models. You can create any folder you want, but the texture must be there physically.
\\Scenes\\trains\\xxx.dds
\\Scenes\\001haz\\xxx.dds
The changed file.x is done and ready to copy into game. As well as textures.
4) Creating file.XLI
XLI file has this shape
1053127 2 ENGINE_TYPE 4715 cd810.x 0.135 CD_810 NOREF - 15 0 893289 PWAGON_TYPE 4716 bdtax782.x 0.135 Bdtax_782 NOREF - 0 0 1358992 |
1053127
2 ENGINE_TYPE 4715 cd810.x 0.135 CD_810 NOREF - 15 0 893289 |
= number generated by Xvalidater tool. Each XLI file has its own unique number.
= suma of all objects added in the file. In our case there is an Engine type and Pwagon type = 2 items. = info for game which type is the model. = Specific ID number of model. In game cannot be two models with the same ID !! For list of ID's check littlevile forum on web. = name of your X file which you copied into xfiles folder in game. = scale of model. Here you define the scale! When modelling in 3d software it doesn't matter the size, and here in XLI you correct the size to be appropriate in game. (By method comparing to others models by eye :)) = name in the list in game where you take the models to the layouts. How it's called. Must be different than X file!. And spaces are allowed only underlined_____like this = Means: No reference. If you have more exact models just with different textures, then you can refer to ID of first model and game will load only the one mesh just applying different texture informations. It saves resources. (Ideal for a rolling stocks). If you wanna use it: Instead of NOREF write: ID number of model you are refering from. = Used only in case of rotating bogies. Then number here stated means wheelbase.If your model has static bogies, then write '-' = Speed of train. change this number and max. speed will change, Play with it and see how it changes. = Max number of carried wagons. Write 2 and the train will be not moving anymore with two wagons attached.With one wagon it will be moving by halfe speed. = Check Sum number generated by Xvalidator tool |
Well, what is Xvalidator tool? Write this name in google, find it in Littlevile forum and install. This tool is very useful and requested. Because in game there is necessary to "validate" models. 1053127 is special number for your unique name of XLI file. Kaja.xli file has different. Usr.xli file has different. This number generates Xvalidator tool. As well as Check sum number. Try it and use it.
Here is a speciality: Models are always validated for an unique XLI file. IF is model validated for kaja.xli, then all xli infos must be in kaja.xli file. If you copy this info >>
ENGINE_TYPE 4715 cd810.x 0.15 CD_810 NOREF
-
15
0
893289
<< into for example usr.xli file, then the model will not work correctly. Even I guess the game converts to unregistered version and will be closed.
In the opposite way: *.list files are not validated. Their infos can be copied into others *.list files and the game will run properly. Yes, you can copy soundsources_kaja.list info into soundsources_dave.list and it will work. Here doesn't matter the name of file.
Make an XLI entry of your models according my description. You can create your own xli file. Or you can add info into another one you choose. NOW Launch the Xvalidator tool. Find the X file. Find the XLi file you want to validate. Click Validate. CLick write XLI. Close.
GREAT! We have X file, dds files and XLI.
This belongs to the game.
x files >>> into Scenes/xfiles folder
dds >>> into Scenes/trains folder
xli >>> into main game directory
5) PLAY the GAME with your NEW MODEL !! Yes, You did it!!!
Infos about *.list files will be added later. It is only bonus to your model. I guess, You are happy with your model as I am always too. Good Job!
Note: If you still have unclear some parts, don't hesitate to ask me in Guestbook. In other way, if this tutorial read somebody who knows something better than me, so Please give me an explanation in comments as well. I'll be very glad. This tutorial can be time by time updated. Karel
Here is a speciality: Models are always validated for an unique XLI file. IF is model validated for kaja.xli, then all xli infos must be in kaja.xli file. If you copy this info >>
ENGINE_TYPE 4715 cd810.x 0.15 CD_810 NOREF
-
15
0
893289
<< into for example usr.xli file, then the model will not work correctly. Even I guess the game converts to unregistered version and will be closed.
In the opposite way: *.list files are not validated. Their infos can be copied into others *.list files and the game will run properly. Yes, you can copy soundsources_kaja.list info into soundsources_dave.list and it will work. Here doesn't matter the name of file.
Make an XLI entry of your models according my description. You can create your own xli file. Or you can add info into another one you choose. NOW Launch the Xvalidator tool. Find the X file. Find the XLi file you want to validate. Click Validate. CLick write XLI. Close.
GREAT! We have X file, dds files and XLI.
This belongs to the game.
x files >>> into Scenes/xfiles folder
dds >>> into Scenes/trains folder
xli >>> into main game directory
5) PLAY the GAME with your NEW MODEL !! Yes, You did it!!!
Infos about *.list files will be added later. It is only bonus to your model. I guess, You are happy with your model as I am always too. Good Job!
Note: If you still have unclear some parts, don't hesitate to ask me in Guestbook. In other way, if this tutorial read somebody who knows something better than me, so Please give me an explanation in comments as well. I'll be very glad. This tutorial can be time by time updated. Karel
6) Additional info about *.LIST files
I repeat, they are not necessary for running your model in game. They are just additional. BUT - you must use them if you wanna have model with sound, smoke, lights, or properly working signal, gates, etc..
Let's see what you can add to your model:
enginespots.list - headlights and smoke for ENGINE_TYPE
itex.list - shining windows (textures) in the night for any_TYPE
soundsources.list - sound for any_type
rtr_objcontrol.list - controlling of objects - like rotating, flashing,
lampinfo.list - illuminates area around lamps or any light sources.
rtr_useanglexz.list - adjust models to terrain slopes (e.g. el.wires follows the terrain slopes.)
You can create your own list files if you want, or you can add entries into files that already exist in game. For example I made my own which look like this: enginespots_kaja.list, or itex_kaja.list. So the names will be the same with underlined spaces____ and additional letters.
Let's look closer each single type.
Let's see what you can add to your model:
enginespots.list - headlights and smoke for ENGINE_TYPE
itex.list - shining windows (textures) in the night for any_TYPE
soundsources.list - sound for any_type
rtr_objcontrol.list - controlling of objects - like rotating, flashing,
lampinfo.list - illuminates area around lamps or any light sources.
rtr_useanglexz.list - adjust models to terrain slopes (e.g. el.wires follows the terrain slopes.)
You can create your own list files if you want, or you can add entries into files that already exist in game. For example I made my own which look like this: enginespots_kaja.list, or itex_kaja.list. So the names will be the same with underlined spaces____ and additional letters.
Let's look closer each single type.
Enginespots.list
Enginespots Adds smoke and spot lights to your engine.
To edit any LIST files, use Notepad.
Each entry looks like this:
To edit any LIST files, use Notepad.
Each entry looks like this:
ltex.list
ltex illuminates the textures, that thay look like shining at night.
If you want to have some parts shining in the night (like windows), you must make special texture for this parts. In Sketchup you place this texture on parts you want them shining. Texture in game MUST be in DDS format and cannot be just a part of other texture file. It must be single one.
To make it shining in the night, just tell the game which texture it is. By writing into ltex.list !
The entry looks like this:
If you want to have some parts shining in the night (like windows), you must make special texture for this parts. In Sketchup you place this texture on parts you want them shining. Texture in game MUST be in DDS format and cannot be just a part of other texture file. It must be single one.
To make it shining in the night, just tell the game which texture it is. By writing into ltex.list !
The entry looks like this:
... there are only names of textures. Very simple!
Soundsources.list
This is the best way to add sounds to your models! Just write an entry into soundsources.list like for example these ones:
The sound will play when your in-game camera comes near to the object.
The sound will play when your in-game camera comes near to the object.
Rtr_objcontrol.list
You can make your models controlable like for example switches, powers, signals or gates are.
To make it you must have your 3d model in more variants. For example you want to make new 3-light signal. Which will be controlable in game. (When insert control box on the rails, you can choose what should model do. Whether shines green, red or yellow light, like on the picture.)
To make it you must have your 3d model in more variants. For example you want to make new 3-light signal. Which will be controlable in game. (When insert control box on the rails, you can choose what should model do. Whether shines green, red or yellow light, like on the picture.)
In Sketchup you must export 3 different models. Each with one light shining. See picture:
So you get three different X files:
signalgreen.x
signalred.x
signalyellow.x
In XLI file the entry will be like this: (Notice DUMMY_TYPE for other two models, the same name for all, and each one has unique ID)
RAILWAY_TYPE 12855 signalgreen.x 0.135 entry_signal3
-
-
0
0
1093956
DUMMY_TYPE 12856 signalred.x 0.135 entry_signal3
-
-
0
0
1095373
DUMMY_TYPE 12857 signalyelllow.x 0.135 entry_signal3
-
-
0
0
1096752
And now finally the entry in rtr_objcontrol.list !
will look like this:
signalgreen.x
signalred.x
signalyellow.x
In XLI file the entry will be like this: (Notice DUMMY_TYPE for other two models, the same name for all, and each one has unique ID)
RAILWAY_TYPE 12855 signalgreen.x 0.135 entry_signal3
-
-
0
0
1093956
DUMMY_TYPE 12856 signalred.x 0.135 entry_signal3
-
-
0
0
1095373
DUMMY_TYPE 12857 signalyelllow.x 0.135 entry_signal3
-
-
0
0
1096752
And now finally the entry in rtr_objcontrol.list !
will look like this:
Which literally means that the game will load on the same place different models. So your models should be absolutely identical except the lights textures.
AND how to make flickering (flashing) signal?
For that we use blinker option in XLI entry. Which means, that Dummy type exactly below the blinker will alternate with him. See example:
RAILWAY_TYPE 12860 signal_right.x 0.135 semafor
blinker
500
0
0
1099249
DUMMY_TYPE 12861 signal_left.x 0.135 semafor
-
-
0
0
1100666
signal_left will alternate with signal_right in 500 millisecond intervals.
Blinker option is not applicable for ENGINE_TYPE or P(C)WAGON_TYPE
NOTE: rtr_objcontrol allows to have maximum 3 controllable options.
AND how to make flickering (flashing) signal?
For that we use blinker option in XLI entry. Which means, that Dummy type exactly below the blinker will alternate with him. See example:
RAILWAY_TYPE 12860 signal_right.x 0.135 semafor
blinker
500
0
0
1099249
DUMMY_TYPE 12861 signal_left.x 0.135 semafor
-
-
0
0
1100666
signal_left will alternate with signal_right in 500 millisecond intervals.
Blinker option is not applicable for ENGINE_TYPE or P(C)WAGON_TYPE
NOTE: rtr_objcontrol allows to have maximum 3 controllable options.
Lampinfo.list
Lampinfo illuminates the area, like the real LIGHT. You can adjust the shining intensity, size, color, and whether the source has glare effect.
Rtr_useanglexz.list
Useanglexz gives to your model ability to follow the terrain and copy the slopes. For example, the el. wires wan't stay in direct position, but they adjust their angle to fit the terrain under. This is very useful for any wires, guardrails, pipelines, etc...
Princip is very simple. Just write the ID number of model you wish to apply into the list file.
Princip is very simple. Just write the ID number of model you wish to apply into the list file.