Bomber's locomotive works reopens

Creating and Editing Rollingstock
User avatar
Gumboots
CEO
Posts: 4817
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Bomber's locomotive works reopens Unread post

I tend not to use subdivide. Too messy, as you found out. I just make new bits. A boiler is only a cylinder after all, and Blender will make those for you with any radius and height you want, and any number of sides (Add > Mesh > Cylinder). So I just make them, put them where I want them, and make them fit the skin by matching the UV mapping of the original. It's quicker and easier than screwing around with the default parts.

For a tapered boiler all you need to do is select an edge loop (Alt+right click on the loop, between two vertices, and it will select the whole loop) center the cursor on it (Shift+S > Cursor to selected) then scale it to the correct radius (S, then hold left button and drag cursor, or, for more precision, S, then type in the scaling factor, and Enter to finish).

Subdividing a cylinder to get it into three sections (like smokebox, first taper, second taper) can be done by going to wireframe in profile view (Z key takes you from Material view to wireframe, but you have to manually select Material view to get back to it) then hold down Ctrl+left mouse and drag the cursor across the horizontal edges. This selects them all. Then it's Ctrl+E > Subdivide to split them in half. Repeat for the third section, then move the loops to where you want them and scale to suit.

Edit: Just thought of something with subdivide. It can be useful sometimes. If you do want to use it on an existing model you'll have to start by converting the element from tris to quads (Select a vert > Ctrl+L to select linked verts > Ctrl+F > Tris to Quads). Subdivide can do very weird things at the ends of an object, but for cases where it's going to behave itself it's easy to get rid of any excess loops.

Alt+right click on a loop, between two verts, to select the whole loop. Then use X key > "Dissolve edges" to remove the loop.

Sometimes this will play up too, depending on how the geometry is arranged, and dissolving faces can be a better way to start. Experiment with it a bit and you'll see what I mean.


I should package up that Pacific as a quick fix. It can always be taken further later, if anyone ever wants to do that.


By the way, Estonian is related to Finnish, but I'm not sure how close they are. I know they're impossible to tell apart when looking at them in written form, unless you speak/read them fluently. Anyway I have a question: what does "vorst" mean?

This is from the Latvia map. There's a lake in Estonia called "Vorstjarv". I know "jarv" means "lake" (or "lake" means "jarv" if you prefer to look at it that way :-D ) but I haven't been able to find a translation of "vorst" anywhere and I'm wondering what it means.

(It probably means "muddy" or "ducks".)
User avatar
bombardiere
Dispatcher
Posts: 425
Joined: Tue Nov 14, 2006 9:07 am
Location: Turku, Finland

Re: Bomber's locomotive works reopens Unread post

Edit: Just thought of something with subdivide. It can be useful sometimes. If you do want to use it on an existing model you'll have to start by converting the element from tris to quads (Select a vert > Ctrl+L to select linked verts > Ctrl+F > Tris to Quads). Subdivide can do very weird things at the ends of an object, but for cases where it's going to behave itself it's easy to get rid of any excess loops.
I get the idea and for new locomotive I will use cylinders etc. BUt above method work well for me.

Here original Norris.
NorrisOld.jpg
And only with few minutes work I was able to do following: (Ok it took bit more than two minutes because I was practising and undoing. :oops: )
NorrisNew.jpg
NorrisNew2.jpg
There is still room for improvement and I messed right side cylinder. :oops: This makes about 100 extra vertices and that does not count conversion for quad back tris. I could adjust some edges to make boiler etc more rounder, but it was a pleasant surprise to see how simple adjustment were. No need to mess with UV map.
By the way, Estonian is related to Finnish, but I'm not sure how close they are. I know they're impossible to tell apart when looking at them in written form, unless you speak/read them fluently. Anyway I have a question: what does "vorst" mean?

This is from the Latvia map. There's a lake in Estonia called "Vorstjarv". I know "jarv" means "lake" (or "lake" means "jarv" if you prefer to look at it that way :-D ) but I haven't been able to find a translation of "vorst" anywhere and I'm wondering what it means.
Difference between Finnish and Estonian is something like Dutch and German. Perhaps. Hard to relate, but difference is more than between Swedish and Norwegian.

Many Estonian can speak or understand Finnish, especially around Tallinn area. But Finns in general do not understand Estonian. And I am one of those who do not.

Many old words are similar, such lake is in Estonian Järv and in Finnish Järvi. But pronunciation is different. In Finnish there is only one extra letter "i", but that makes the word two syllabus in Finnish language and thus emphasis is in different place. That makes me hard to understand Estonian.

Then a lot of words are different and languages have evolved independently. Something similar than in English language. I have read that many short words comes from Old English. Saxon Language. Such as Cow or Fish. I understand that both have similar words in Dutch. But more complex words are from French influence.

Ok, A long answer to your question. :roll: So "Järv" is lake, but I don't know what "Vörst" is. That is alien word to Finnish and I don't know it. Perhaps it is from German influence. In google's opinion it could be Dutch and means Frost. :lol:
User avatar
Gumboots
CEO
Posts: 4817
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Bomber's locomotive works reopens Unread post

There is still room for improvement and I messed right side cylinder. :oops: This makes about 100 extra vertices and that does not count conversion for quad back tris. I could adjust some edges to make boiler etc more rounder, but it was a pleasant surprise to see how simple adjustment were. No need to mess with UV map.
You still have the model flat-shaded, and RT3 will automatically smooth shade everything. If you want a better idea of how it will look, in Object mode select the model, then go look over in the left side panel. Just under a dark button labelled "Set origin" you will see buttons for smooth and flat shading. !*th_up*!

The verts count will be fine. And yes, it is quite amazing what you can do for the looks of a model without much effort or much increase in rendering loads. LOD's are easy for locomotives too. For the boiler I'd just select every second longitudinal edge and dissolve those edges (checking to make sure it doesn't do weird things to the UV's of course). I make the LOD's on separate layers. so first one will be on Layer 1, then copy that to Layer 2 and simplify mesh to suit. Repeat as necessary. You have to export each LOD as a separate body file and then merge them in a hex editor, but that's easy. Let me know when you get to that point if you want tips. (0!!0)



Ok, fair enough on the Estonian. That's why they're different languages. I just thought it was worth asking on the off chance that it was one of those bits that did make sense to Finns.

Anyway I found out. Turns out I had copied it from the wrong place and it had the wrong accent over the "o". The correct version is Võrtsjärv and according to Google (must be true) it means "Lake Peak". This makes sense, because Väike Emajõgi flows into it from higher land adjacent to the lake, so I assume there's a handy local peak of sorts next to it. Probably quite noticeable, given how flat a lot of the country is.*

*Meh. Now Google wants to say it's Latvian for "widget". *!*!*! Stuff this. I'm going to ask some Estonians at that website. They should know. :lol:

Regarding English, I once read a book on the Gokstad ship that had side-by-side texts in English, Norwegian and Swedish. That was cool, because while reading the English I could spot obvious correlations in the other languages. A wooden peg to hold planking to a frame is "treenail" in English, while in Norwegian it's "trenagle". "Wooden boat" in English is "trebåt" in Norwegian. Four is "fær". Eight is "ott". Etc, etc. On the other hand, a lot of words are entirely different.

I have noticed some similarities between Russian and Latvian. The Latvia for lake is "ezers" (lotsa them in Latvia) while the Russian is "ozero". These are obviously from the same root word. Apparently they share derivatives of quite a few other words too. Linguistics is interesting stuff.
User avatar
bombardiere
Dispatcher
Posts: 425
Joined: Tue Nov 14, 2006 9:07 am
Location: Turku, Finland

Re: Bomber's locomotive works reopens Unread post

Smooth shade. Thanks. I did not know that.
NorrisSmooth.jpg
That is a quite improvement. For game purposes, I don't think the boiler needs to be any more rounder.

Now I need to think what to do with the tender. Its end could use a little bit rounding, but subdive does not work well with box.

LODs, Yes that would be next question. I need advise on how to hexedit. For Norris project, I guess that I only need to add my upgrade and then delete the lowest quality LOD.

But do we need that many LODs? Based on the picture file, I count the locomotives have 6 to 7 LODs. Is that many really needed? Shouldn't 3 or 4 do the same? Consider how much more computer power we have now.
User avatar
Gumboots
CEO
Posts: 4817
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Bomber's locomotive works reopens Unread post

For game purposes, I don't think the boiler needs to be any more rounder.
Looks fine to me. I've found that it depends on the diameter of the boiler and the livery. Bigger boilers tend to need more faces to look smooth, and a livery that has very obvious banding on the boiler will exaggerate the shape. But even for something like the Schools class a 24-sided boiler is fine, and if it was all black with no lining it would be fine at 18 sides.
Now I need to think what to do with the tender. Its end could use a little bit rounding, but subdive does not work well with box.
Select edges > Ctrl+E > Bevel. !*th_up*! Over in the left side panel there will be a box for adjusting the bevel once you have made it initially. You can add extra segments or change the amount of bevel, providing that you do it before moving on to another operation.

Most RT3 models have 5 LOD's. Buildings and cargo cars operate on a different change point to locos. I found that with cargo cars there is often no point in going past three LOD's (including the top one) since they change further away from the camera, so you can drop a lot of mesh really fast.

Locomotives are different. In some situations, like when the track is pointing diagonally at the lower corner of the screen, the loco will change LOD's really close to the corner. That means you really need the whole 5 of them to make it look reasonable as it approaches the edge of the screen (this is assuming you want to reduce the mesh as much as possible on the lowest LOD).

We have found in testing that the higher poly locomotives do impose some penalty in terms of frame rate, even with a modern desktop. Probably wouldn't be noticeable with a full-on gaming rig if you have one of those, but a lot of us run RT3 on fairly modest specs. Personally I think it's worthwhile having at least 3 LOD's for locos just in case, and they're not difficult to make. Apparently the gaming dev's rule of thumb for extra LOD's is that if you can drop at least one third of the mesh it's worth doing. If you can't, don't bother. And by the time you get down to only a handful of tris left it's probably not an issue. I often don't take things quite as far as the default models.


Making hex for LOD's is pretty straightforward. By reversing the process you can also extract default LOD's from PopTop .3dp's if you want to do that. I did a few examples when I was getting a feel for modelling. Anyway, the first two lines of hex in a body .3dp look like this:

Code: Select all

33 44 50 46  04 00 01 00  33 44 4D 44
05 00 00 00  00 00 00 00  00 00 00 00
I always set the hex editor to display in twelve columns, because for RT3 work that's generally the most convenient (X, Y and Z coordinates line up nicely). The 05 there is the number of LOD's (basic integer). When you export from Blender there is only one LOD in the exported file, so it will have 01 there.

If you want to add more LOD's you just export them as their own .3dp, then copy all the hex from 49 4E 53 54, on the next line, to the end of the file. Include the 49 4E 53 54 in the copying. It shows as INST over in the text string display, and is the header for each LOD (instance, in RT3 language). This is the first eight lines of the same file:

Code: Select all

33 44 50 46  04 00 01 00  33 44 4D 44
05 00 00 00  00 00 00 00  00 00 00 00
00 00 00 00  49 4E 53 54  E0 02 00 00
C8 02 00 00  CD CC A4 C0  00 00 34 41
9A 99 05 41  CD CC A4 C0  CD CC 9C 41
9A 99 05 41  A8 99 59 C0  CD CC 9C 41
9A 99 05 41  A6 99 59 C0  00 00 34 41
9A 99 05 41  CE CC 5C C0  CD CC 9C 41
So you'd copy this bit, and then on to the end of the file:

Code: Select all

             49 4E 53 54  E0 02 00 00
C8 02 00 00  CD CC A4 C0  00 00 34 41
9A 99 05 41  CD CC A4 C0  CD CC 9C 41
9A 99 05 41  A8 99 59 C0  CD CC 9C 41
9A 99 05 41  A6 99 59 C0  00 00 34 41
9A 99 05 41  CE CC 5C C0  CD CC 9C 41
This whole chunk of code simply gets pasted onto the end of the first LOD's file, after the last byte, making sure you haven't missed or overwritten any bits. You can check easily enough because it should all come in lumps of four bytes.

After pasting the new LOD you just update the LOD count on the second line of the file to 02, or whatever number it should be depending on how many LOD's you want. Then save. It should work. !*th_up*!
User avatar
bombardiere
Dispatcher
Posts: 425
Joined: Tue Nov 14, 2006 9:07 am
Location: Turku, Finland

Re: Bomber's locomotive works reopens Unread post

Bevel. Thanks. I had forgotten it. In my earlier test I accidentally beveled the whole loco. :lol: Perhaps with more precision this time. :oops:

I think I got the LOD Hexediting. Thanks. Sound simple enough.

So each LOD level has 00 00 00 00 buffer in front of new level?

I do not have a gaming rig, so I do understand meaning of the LODs. However, one question though. If a model consist five LODS, then why skins goes to letter F or G? It does not sound logical to me. The smallest of the skins are so small that I wonder if there is much performance saving.

Do you have had any issues with lower level LODs and UV maps? ANy tips or something I should be wary of?
User avatar
Gumboots
CEO
Posts: 4817
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Bomber's locomotive works reopens Unread post

So each LOD level has 00 00 00 00 buffer in front of new level?
Not always. It depends.

The 00 00 00 00 is the Z axis coordinate for the item's attachment point. For a locomotive body file this will always be 00 00 00 00.
For a truck it can be the same. Some default trucks have a different value, but zero works just as well and is simpler to remember.

For wheels, the Z axis coordinate will be the axle height above zero.
For connecting rods and coupling bars: the height at which they attach to the drivewheel (axle height minus half of piston stroke).

For pistons: the height of the piston rod centreline, at the point where the connecting rod attaches to it.

Have a look at this and see if it makes sense.
Mysterious_hex_stuffz.png
Note that although the 00 00 00 00 in front of the first LOD is part of the attachment point hex, the mapping for the last face in an LOD actually does have a 00 00 00 00 buffer at the end of it. This also applies to the mapping for all other faces (tris).

So you get: file header > number of LOD's > attachment point > LOD header > number of verts > number of tris > positions of all verts (12 bytes each) > UV mapping for all faces (76 bytes each, and ending with 00 00 00 00). Then it's on to the next LOD's header, etc.
If a model consist five LODS, then why skins goes to letter F or G? It does not sound logical to me. The smallest of the skins are so small that I wonder if there is much performance saving.
Skin LOD's and model LOD's aren't the same. The A skin changes to the B skin at pretty close range. The model changes to the second LOD much further away. But yes, there seems to be little point going too small with skins, although one thing you can do with them is fade the smaller ones a bit to simulate distance fading.

Anyway, I usually only take them down to 32x32, and skip the default 16x16. If I'm using a 1024x512 as the A skin, which is handy if you don't need 1024x1024, then I'll take it down to 64x32 and call that good enough.
Do you have had any issues with lower level LODs and UV maps? Any tips or something I should be wary of?
Not really. It'll be obvious if you screw the geometry by mistake, because the skin will look wonky. I usually don't bother applying the smaller skins in Blender. I just do the LOD's with the A skin, then just reduce it in Photoshop to make the smaller ones.

For saving as DDS, Jim put me onto a good tip. You apply a small amount of Gaussian noise (1% or less) to the image before saving. Funnily enough, this helps reduce artifacts from DDS compression. So I'll have the PSD saved, make a duplicate and flatten that, apply a tiny bit of noise, save as A skin.

Then, being pedantic *!*!*! I'll Ctrl+Z backwards to the unflattened version, flatten again, resize to 512 B skin, apply noise, save as DDS. The idea here is to not compound artifacts by starting with the best image.

The Ctrl+Z backwards again, but only to where it is full size flattened (easy coz it suddenly looks bigger), resize to 256 C skin, noise, save. By this time you're arguably at the point where you can not bother with the fancy tricks, and just keep reducing and saving.

The only thing you have to watch with the smaller skins is the alpha channel, but the threshold tool will sort that for you. (0!!0)

Oh yeah, when setting up wheels I always do them so they are centered on something divisible by 8 or 16, and so that the size of the alpha mask is also divisible by 8 or 16. This means they stay round when the smaller skins kick in at fairly close range. A lot of the defaults missed this trick, so the wheels rapidly go eggy. *!*!*!
Post Reply