Making Dynamic Mileposts - Parts 1 and 2

Tips and discussion about scenery creation for RailWorks.

Making Dynamic Mileposts - Parts 1 and 2

Unread postby SMMDigital » Tue Nov 08, 2011 2:13 pm

This tutorial assumes that you already have experience with an image editing program that can make alpha masks, an ace-conversion program, a shape editing program that can export to Railworks, and the Railworks asset editor.

Setup

Everything flows a bit easier on this project if you set up your work environment first.

- Start by creating a folder somewhere on your computer (i.e. My Documents) that will contain your basic shape file for the asset.
- Within that folder, create a "textures" folder.
- In the Railworks\Source folder, create a provider folder (here it will be SMMDigital), a product folder (RailNetwork), and then two subfolders within - "Mileposts" and "TextureSets".
- Within the Mileposts folder, create a sub-folder called "textures".
- Within the TextureSet folder, create two sub-folders - "numbers" and "placeholders".

Making the Numbers

Now we will open our graphics program an make the numbers that will show up in the game. First, we need what are called "placeholder" numbers. This will be seen on the basic asset in the Editor, but will not show up in the game. They show the game where to put the finished numbers.

- Create a 64x64 texture in your editing program. Fill paint it a light gray color, then in white, put a "zero" in the middle of the texture. Around the border, put a pink border so that you can differentiate this tile from the others in your shape editor. Then, save this file as "primarynumber_0.BMP" file in the "textures" folder of your basic shape file.
- Create more 64x64 with the numbers 1, 2, 3, etc. for however many numbers you will be using on your mileposts. These don't need the pink border. Save them as "primarynumber(1,2,3,etc).BMP" files in the textures folder of your basic shape file.

tut01.JPG


- Create a 64x64 texture in your editing program and fill-paint it black (we are making black numbers).
- On the texture, use your image editing program to create an Alpha Channel (or mask) so that the entire image file is transparent.
- Choose a font style in your program, make it WHITE, and make a "0" in the middle of the 64x64 image file. The white font should cause the black background to be visible, while the rest of the image around the font will be invisible.
- Save this file as a 32-bit Targa (.tga) file, with the naming convention of "(youchoosethename)_0.tga" in the textures folder of your basic shape file.
- Repeat the last four steps for each number, 1-9, that you will be using. The naming should be "(youchoosethename)_(1,2,3,etc.).tga".

tut02.JPG


- After creating all of your texture files, you will need to convert them to .ACE format. If you do not have a plug-in in your imaging program, you can use a third party program such as Two-Ace to do this. Be sure that the Targa files are converted as 32-bit ACE files or the alpha transparency will not show up in the game.

Making the Placeholders

Assuming that you already have a Milepost shape file ready in your asset creation program, we now need to make the placeholders where the dynamic numbers will go. In this example, you will be shown a two-number milepost and where to put the placeholders.

- Create a single face for your asset and move it into the desired position for the first number on the milepost.
- Name this face "Face1", and the group that contains it "primarydigits_1".
- Paint this face with the texture "primarynumber_0" from the "textures" folder.

tut03.JPG


- Now, in the exact same place, create another face. Copy this face below as well to denote a second number.
- Join these faces as a single object. Name this two-faced, single object "Face2", and the group that contains it "primarydigits_2".
- Paint the lower face of this object with the "primarynumber_0" texture. Paint the upper face with the "primarynumber_1" texture.

tut04.JPG


- If you have three or more numbers on your milepost, keep repeating the above steps until you get them all in.
- The faces that are painted with the primary numbers should have their material properties set to "Transparency" in the TxAlpha material field. The .bmp placeholder files do not contain transparency, but they numbers that will replace them in the game do have transparency, so it will need to be specified here.

tut05.JPG


- Save and export your asset.
You do not have the required permissions to view the files attached to this post.
Last edited by SMMDigital on Tue Nov 08, 2011 2:26 pm, edited 1 time in total.
SMMDigital
 

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby SMMDigital » Tue Nov 08, 2011 2:17 pm

Getting it in the Game

- Copy all of the "primarynumber_X" .ace files from the asset "texture" folder to the Railworks\Assets\(YouProvider)\RailNetwork\TextureSets\placeholders folder AND the Railworks\Assets\(YouProvider)\RailNetwork\Milepost\textures .
- Copy all of the "(youchoosethename)_X.ace" files from the asset "texture" folder to the Railworks\Assets\(YouProvider)\RailNetwork\TextureSets\numbers folder.
- Copy your .ace texture files for your milepost asset to the Railworks\Assets\(YouProvider)\RailNetwork\Milepost\textures folder.
- Copy your .igs object files for your milepost asset to the Railworks\Assets\(YouProvider)\RailNetwork\Milepost folder.

tut06.JPG


Now, we need to create a number list for the asset to refer to in the game. Start up the asset editor and go to the "(YouProvider)\RailNetwork\TextureSet folder and right click on that folder. Choose from the menu "New Blueprint", then choose "Named Texture Set". This will bring up a blueprint that you can list all of the numbers you created earlier in. This file will be referenced by the asset.

tut07.JPG


Go ahead and blueprint the milepost asset as a "Milepost Blueprint". In the Primary Texture set fields, put "(YouProvider)" in the top field, "RailNetwork" in the second field, and "TextureSet\whateveryounamedyourtextureset.xml" in the third field. It is important that you add the ".xml" at the end of the last field or your numbers won't show up.

tut08.JPG


- Preview your asset. The placeholders will still show up, as the Asset Editor does not draw the "(youchoosethename)_X.ace" files yet. If you are satisfied with the asset, export it to the game.

tut09.JPG


- Export the number list from the "TextureSet" folder. This should also export the numbers, but if it doesn't, go into the "numbers" folder, right click on each number, and click "export".
- Export the placeholder numbers from "placeholders" folder by right clicking on each number and clicking "export".

smmMP.JPG




If you have followed the steps above correctly, you should have a dynamic milepost in your game. Note that if you want a horizontal signal plaque, it's simply a matter of moving the placeholder faces into the right positions in your asset editing program.
You do not have the required permissions to view the files attached to this post.
SMMDigital
 

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby Kali » Tue Nov 08, 2011 4:36 pm

You appear to have missed out what shader to use for the numbers quads? you have to use one with transparency, so off the top of my head that would be TrainBasicObjectDiffuse, TrainDecal ( I think those two are the ones you're meant to choose from ).
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby Hawk » Tue Nov 08, 2011 5:53 pm

I've stickyed this. !*salute*!
Hawk
 

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby SMMDigital » Tue Nov 08, 2011 7:23 pm

Kali wrote:You appear to have missed out what shader to use for the numbers quads? you have to use one with transparency, so off the top of my head that would be TrainBasicObjectDiffuse, TrainDecal ( I think those two are the ones you're meant to choose from ).


Being that this is a tutorial and most of us who are reading it are probably n00bs to the process of making this asset, please make sure you define, in most basic terms, what you mean when bringing in a new term, such as "quads". I assume this means the number placeholders?

As you can see from the example picture in the game, the model works just fine without those shaders. They are probably replaced in the Geo file with "Lit3DirSingle" - the generic term for TexDiff. But to insure compatibility, it is more than a good idea to include a Railworks shader for each part of the model. TrainBasicObjectDiffuse.fx would be used on most of the parts of the model, with TrainDecal.fx on the dynamic numbers. These shaders would go into the "Rail Sim" properties slot in the program that the object is made with before exporting to Railworks.

I've got to go back and make some improvements to these models later tonight, and i'll insert the proper shaders then.
SMMDigital
 

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby Kali » Tue Nov 08, 2011 7:53 pm

"Quad" is a thing made up of four vertices like a "tri" would be something made of three vertices - so yes, one of the squares with the numbers. It is a basic term you'll find everywhere in 3d work, and the RSC creator docs assume you know what it means also.

I guess you don't actually have to use a shader with transparency for a sign. If you don't - like you've done here - then your textures don't need an alpha channel, so that's even easier. Other modelling packages won't automatically substitute a shader if you don't actually set one - Max will export something which will confuse the model builder when you export from the Blueprint editor, and I think Blender/Bigex is the same. It is a good idea to set a shader yourself too even if it's just TexDiff, that way you are guaranteed to get the result you're looking for in game.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby PapaXpress » Tue Nov 08, 2011 9:00 pm

See. I just learned something new. I had no idea I had to include shaders, but I can confirm that 3DC will add "Lit3DirSingle" to my models since I didn't specify one.

Is there a compelling reason to change from "Lit3DirSingle" to "TrainBasicObjectDiffuse.fx" for simple models like houses or track structures?
Image
"Just post some random unrelated text. We have members here who can help you with that." ~ Chacal
"When all else fails, read the instructions... if that doesn't work either, try following them." ~ Old Prof
Image
The Grade Crossing - Atlanta North Project - Virtual Rail Creations
User avatar
PapaXpress
 
Posts: 5147
Joined: Sat Oct 23, 2010 10:30 pm
Location: that "other" timezone

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby SMMDigital » Tue Nov 08, 2011 9:47 pm

I have not confirmed this myself, but I seem to remember asking a question about train lights shining on trackside objects and someone saying that TrainBasicObjectDiffuse.fx has something to do with proper nighttime light reflection. I can't confirm this, and I don't even remember where I saw this at, so I have no way of knowing the truth of it.

As far as going back and changing all those shaders? Probably no reason to. In my early days of asset building, in my ignorance of most shaders, I never put one in a slot unless it was for Transparency or lighting. Going forward though, all of my new assets have a shader, at least a TBOD, assigned to each part. Just peace of mind in case the game ever gets picky and decides to ignore assets that aren't properly shaded.

"Quad" is a thing made up of four vertices like a "tri" would be something made of three vertices - so yes, one of the squares with the numbers. It is a basic term you'll find everywhere in 3d work, and the RSC creator docs assume you know what it means also.


Yeah, that's the reason I asked for the simplification of the term (thanks for that, BTW!). The Creator Docs are written by professionals who do this for a living. I make aluminum cans and bale hay for a living, so i'm a little rusty on my terminology for making 3D objects and video game codings. *!embar*!
SMMDigital
 

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby Kali » Tue Nov 08, 2011 9:52 pm

This is probably not the place to talk about shaders, but in essence, no, that's fine for basic buildings. Lit3DirSingle is the basic RW shader, it's effectively TexDiff in a different name, I think. I was really just bringing up shaders for people who use Blender or Max who're following the guide. The Train* shaders have better lighting than the others but they're a bit costlier to render so you don't want to use them for generic buildings. For close-up trackside stuff I'd go all out though. I'm only a basic modeller and I have a head injury, so I would go and find out yourself if you can coz I might be 100% wrong :p

Maybe it's worth making a creator guide faq: section 4 is full of useful info, but it's a bit crammed together...
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby SMMDigital » Wed Nov 09, 2011 1:41 am

I ran into curious problem this evening while making dynamic numberboards. The mileposts that I made, with black numbers on white backgrounds, took the "TrainDecal.fx" shader in the properties slot with no problem, and are showing fine in the game. But, when I put the shader in the Rail Sim properties slot for the white numbers on black background signal number boards, the numerals show up red or yellow in the sim. Remove the shader, and they show normal white.

Odd.
SMMDigital
 

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby SCLALINE » Fri Nov 25, 2011 8:15 am

The Shader You use for the numbers has to be a shader that supports alpha as in blendatex.fx
User avatar
SCLALINE
 
Posts: 672
Joined: Sun Oct 03, 2010 10:19 am
Location: Orlando, FL

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby Kali » Fri Nov 25, 2011 8:31 am

Ehm, he's got it working with Texdiff. You want alpha blending shaders if you want to alpha blend, obviously, but for a flat colour sign there isn't actually a lot of difference replacing the entire quad colour vs replacing just the number - at least not if the rest of the sign also uses texdiff. TrainDecal is fully alpha blended along with extra tricks.

Traindecal does some funny things in the editor, I get some rather random train numbers at times - but it all comes out ok once it's running. Is it picking up colour from the model somewhere?
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby SMMDigital » Fri Nov 25, 2011 6:06 pm

I don't think that it is picking color up from elsewhere. I have made another number board that has no background but is just simply numbers floating in the air. This simulates numbers on older Southern Railway signal posts. The numbers were simply metal cutouts that were bolted to the post. Even though they are nothing but numbers with alpha "blanks" around them, they still show up red or green in the simulator when using TrainDecal.fx.
SMMDigital
 

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby Kali » Fri Nov 25, 2011 8:49 pm

Wierd. Maybe it's a 3DC thing like the glow issue :shrug:
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Making Dynamic Mileposts - Parts 1 and 2

Unread postby Bananarama » Fri Aug 31, 2012 1:42 pm

I'm having a tough time getting my own mile posts into the sim, and the process is driving me to drink. I created the following folder structure within my projects directory:

Scenery (model igs and xml)
Textures (model textures)
-- TextureSets (.xml listing texture IDs and ace files used)
---- Numbers (BK_Number_(0 through 9).ace
---- Placeholders (primarynumber_(0 through 2)

Model names and hierarchy:

1_0512_milepost
-- 1_0256_primarydigits_1 (P_Num_0 material name)
-- 1_0256_primarydigits_2 (P_Num_1 material name)
-- 1_0256_primarydigits_3 (P_Num_2 material name)

Exports OK, but when I place it in the world, all that shows is the white primary numbers. The correct number of digits displays (1, 2, or 3), but not the number typed into the object property box in the sim.

Model is based on tech docs, and it follows the source examples Derek uploaded to RSC a few years back. I'm sure I missed a step someplace, but not certain where. Please help - I've already wasted 2-hours trying to debug this and I'm about to throw my PC out the window.
Cheers!
Marc - 3DTrains

Image
User avatar
Bananarama
 
Posts: 2749
Joined: Sat Feb 14, 2009 1:17 am
Location: Another Planet

Next

Return to Scenery Design

Who is online

Users browsing this forum: No registered users and 1 guest