Friday, March 20, 2009

Trainz 2009. Decisions Decisions!

I finally managed to get myself a copy of the new version of Trainz! The focus of this version is on high quality models, and the old polygon limits that I was so worried about, are gone! That isn't to say that I can add as many as I like - Im still keeping count, but it allows me to do things like add a few poly's here and there to improve the sharpness of the texture :)

I wasn't aware, until yesterday, that Auran have dropped support for Gmax, and have released new exporters for 3DS Max. I know that you can still use Gmax, but the old exporters do not support a lot of the new features that allow you to increase the resolution (quality) of the model without decreasing the perfomance of Trainz. I have always intended for my models to be high quality, so I have been wrestling with the decision to either leave things the way they are and release the items that Im currenly working on as TRS2006 assets, or to convert them to 3DS Max and take advantage of the new exporters to make them look even better in the game.

Converting to Max would take time, as there is no direct conversion process, and every conversion tool I have tried always seems to corrupt the model in some way. Fixing the corruption is time consuming, for example, in one model that I converted recently, several vertices (just a few here and there) were out by 16mm and had to be nudged back into place - it took about 2 hours find and fix them all, and that was just a simple building.

I know a lot of you have been waiting for my models to be finished and available for Trainz, so I don't want to delay them even further by putting them through a long and tedious conversion (and repairing) process this late in the day, but at the same time, I want to take advantage of the latest features in TS2009.

I'm already using the old 3DS Max exporters in Gmax, so there was originally no advantage to using Max - I can do normal maps and specular lighting in Gmax just the same. The only real difference was not being able to render a high quality image of the model in Gmax. No big deal, and certainly not required for Trainz! Now, with the extra features of TS2009 being enabled by the way the new exporters work, it's a much bigger deal.

After thinking about it for some time, and having converted the building mentioned above, Im leaning towards conversion. The Tangara is more complex than the 86 class, and already has a lot of textures in place, as well as several areas where the mesh is very fine. It would easily be corrupted and require a lot of time to fix before I could finish it off, so I have decided to continue working on the Tangara in Gmax, and release it as a TRS2006 asset.

The 86 Class on the other hand, is close to my heart. Its sad to see these locomotives go into forced retirement, and in a way, Im trying to do my part to preserve what made them special. There are some parts of the 86 Class that I had always planned to make in 3DS Max from the start, but at the time, there didn't seem to be any reason to build the rest of it there too. The model is almost complete but the mesh is simpler and it only has a few textures applied so far, so I'm going to take the risk to convert it, and export it as a TS2009 asset.

I may release an update to the Tangara in the future, making it a native TS2009 model, but for the moment, at least I will have one item that I can finish off, while I am rebuilding the other.

Leave me a comment and tell me what you think.

Tangara Progress

Progress on the Tangara has been slow, so I've been holding off on writing an update here. Now I have some other things to say, so Im posting this to get it out of the way :)

First, let me say that I have been working on some fiddly bits, re-arranging vertices by hand, in order to assist with the texture mapping, so there has been a lot of work, but very little to show for it.

I've found that its much better to create a "hard" line (for example around the driver's window, or the cab door) at the edge of a polygon, rather than trying to draw the line on a texture. The Tangara is 20 metres long and almost 5 metres high, and all that has to fit onto a couple of texture bitmaps. I have been using 512 x 512 pixel texture images, but even at double that size, one pixel is still equal to several centimetres on the side of the Tangara. The end result is, that if I draw a solid line on the texture, at any sort of angle, it has a jagged, pixelated edge. Not so on a polygon boundry - the edge is smooth and sharp!

So, I have added a few polygons by cutting an area around the driver's window, which gives the sharp lines that I'm looking for. I also added exterior sills to all of the windows, to allow me to texture the sill area in black. Previously the sills were part of the interior, which will be white, and getting the sharp dividing line between the outside and the inside (between black and white), and getting it in exactly the right place, (since the windows are only about 1cm thick) would be difficult on a texture. Cutting the mesh gets the location right, and gives a nice sharp line.

I tried simply painting the texture around the guard's door, since it is at a 90 degree angle, but I have found that with the resolution of the texture images, the line along the top and bottom falls mid-pixel, so I would have to slide the texture map up or down a bit. Its just easier to cut around the door, and have it be consistent with everything else, so that is the way I am going to go.

File Version: 400
Poly Count: 13,325

Bogies and pantograph have been exported to seperate files for texturing

Note: The poly count shown here is for the Gmax model in progress. The count will generally be higher than that of the finished in-game model since it includes duplication, tools, jigs, and other pieces which may not be part of the final model. It may also include parts which are generally counted separately, such as pantographs, interiors, or bogies. LOD modelling will be used to further reduce in-game polygons.

Posted by Picasa

Saturday, March 14, 2009

86 Class Update

Ive spent most of the last couple of weeks working on the 86 Class. This is the one that has been tearing at me to be finished, so I needed to make some progress on it. I've done a lot, and now that it’s ready to be texture mapped, I can leave it for a while and catch up on the Tangara too.

I finished off the body detail, headlights, marker lights, side mirrors, windows etc, and cleaned up the roof, then mirrored the body and base to create the other end of the loco. I started on the low res interior next. This is the one that will be seen in DCC mode, from outside the train (through the doors or windows). Technically, its part of the body, but I'm keeping it separate for now. I isolated parts of it that would have detailed textures, and then used a micro texture to map out the general colouring on the rest.

A micro texture is a 32x32 bitmap with 16 colour squares on it (4x4 each). Using detailed textures only where they are needed and micro textures for everything else greatly reduces the amount of memory required by the graphics card to hold all of the textures.

I added all the under-frame gear - compressors, motor-alternator, main reservoir, etc and joined the body and base together, then hand optimised it to get it ready for texturing. I also added the Comeng builder's plates and will texture them separately later. At this point, I built the bogies and moved them off to their own file, ready to be imported into Trainz. The pantograph has also been finished and is ready to import.

The horns had been on my hit list for a while now. They started as a single horn from the Art Source CD, which I used to create a basic set of 5 horns for the 86 Class, but they are very high poly. I finally got around to fixing them and mounting them properly. I took over 1800 polys out of the horns alone!! (900 each end)

I did some fine tuning of the low res interior texture mapping, and then went back to the high res one (for Cab Mode) and cut holes in the drivers desk for the gauges and indicators. I had been leaving that until last since the boolean (cutting) tool always tries to optimise the mesh but usually ends up doing more damage than good. To avoid that, I detached the face of the panel before I cut, limiting the damage just to that area, and then hand optimised and repaired it before re-attaching it to the interior.

As a final touch, I added the Auran Fire Extinguisher in the appropriate place. I’m going to make that a trade mark - each of my cabs will have an Auran fire extinguisher somewhere :)

Now that I’ve mirrored the two halves of the loco and added al the asymmetric detail, the poly count has doubled, as expected. My previous post deals with that. Also check out my Flickr sets by clicking on the slide show to the right… I’m uploading screenshots there as I go.

Overall, there was quite a lot of work in this update, and now that its done, I’m ready for a change, so its back to the Tangara for a while. I’ve learnt a lot while doing the 86 Class, and have used different techniques in places, and these will be transferred to the Tangara so that both models will benefit.

File Version: 150
Poly Count: 22,900

Note: The poly count shown here is for the Gmax model in progress. The count will generally be higher than that of the finished in-game model since it includes duplication, tools, jigs, and other pieces which may not be part of the final model. It may also include parts which are generally counted separately, such as pantographs, interiors, or bogies. LOD modelling will be used to further reduce in-game polygons.
Posted by Picasa

Monday, March 09, 2009

About Poly Counts

Every time I post an update to this blog, Im worried that the poly counts shown may seem excessive to the casual reader who may be aware of Auran's poly recommendations, or the poly counts of various Trainz assets, but not so familiar with the modelling process or my intentions. Ive touched on it a few times in various posts, but here, I'd like to create a post just about that, which I can refer to later.

I add the poly counts to each post so that you can see my progress, and also get a feel for the level of detail in the models, but in recent months, these counts have been creeping up, and in some cases, Ive gone over my self-imposed upper limits. It troubles me, and while I'd like to create some really nice Trainz assets, Im concerned that others reading this blog may see the counts and think that these models are too "High-Def" to run on their PC or their version of Trainz.

Here's my thinking on that...

For a diesel locomotive, Auran recommend 9000 polys for the body, 8000 for the interior, and 2000 for a bogie. There are no recommendations for electric, so lets use those numbers and add 1000 for a pantograph. That's a total of 20,000. They also recommend 12000, 8000, and 5000 respectively for a steam locomotive (a total of 25,000). That's 5000 more! Why? Well, its because with all the push rods, pistons, and cylindrically shaped boilers, its difficult to do even a basic steam loco in less polys. The lower recommendation for diesels is not because Trainz wont handle anything higher - its simply a recommendation which helps Auran to lower the minimum PC requirements for running the game. The reality is, that in the years since those recommendations were made, the power of CPU chips in current PCs has just about doubled while the price has stayed about the same.

If I were to mirror the 86 Class right now, it would come to about 23,000 polys, which is just under the recommendation for a steam loco, so the question becomes... "Why do the steam fans get to have all that extra detail?" My answer is: "They don't". There is absolutely no reason why one locomotive should be less polys than any other. If Trainz will handle 25,000 for one locomotive, it will handle it for another. Naturally, if you can build it under that, so much the better.

Having said that, the poly count expressed below each post is for a work in progress. It includes things like body, bogies, and cab mode interior detail together. In Trainz these are separate assets, as are the pantographs, and generally they are not all added together, as they are in my workspace.

By the time I split the model into separate files for body, bogie, interior, panto, levers, etc, the total count will be spread over several files, and things that a file doesn't need will be removed (ie: there will be no levers in the body file). Duplicated parts (switches etc) will become a single item, to be attached multiple times.

The 23,000 poly estimate for the mirrored 86 class includes a lot of duplication (two full cab mode interiors, with all of their associated levers and switches for example). Obviously, the duplication wont be present in the in-game asset. For example, only one cab is required - Trainz simply uses the same model at either end, and only one is ever active at any given time.

Another factor to take into account is LOD, or "Level Of Detail" modelling. I will be using LOD in all of my locomotives and trains. When an asset is set up properly for LOD, Trainz uses the high poly, high detail model only when it fills the entire screen (Zoomed in). As the train dissapears into the distance, Trainz will substitute increasingly lower detail copies as it moves further away, so with all those engines in that big yard, only the ones in the foreground will be high detail, and the rest are low poly versions. This is how it should be, and its kind of sad that more Trainz assets aren't set up this way. Obviously, in the real world, you can't see that 2cm diameter hand rail from 5km away, but you do see enough of the basic outline of the loco to recognise it's type. This is how it is with LOD modelling too.

Finally, Im building these for me. If you like them too, that's cool, but to paraphrase Tim Curry in Rocky Horror Picture Show, and with all the humour intended in that scene...

"I didn't make them for you!"

I guess you really have to see the movie.

Anyway, in conclusion, the poly counts in my working files may seem high, but this is because I want to build the best looking models that I can, and also because those work files include a lot of parts that will never be seen in-game, or be counted together. Auran's recommendations are fairly conservative, and aimed at the minimum average PC requirements, yet PCs are becoming more and more powerful, and LOD modelling will greatly reduce the poly count of distant models. All of these things combined mean that the finished product will have less of an impact on your PC performance than you might expect from simply looking at the poly counts in this blog.

Hopefully now that Ive written all that in a single referenceable post, it wont bug me as much in the future.

Oh, and when you see the models in action, you'll realise it was worth it :)

Monday, March 02, 2009

Tangara Progress


So, after something like 30 attempts (seriously, probably more), I finally got the body texture mapped in a way that Im comfortable with. Did I mention that I hate doing textures? Im sure I have.

I spent a lot of time getting to know Gmax again. At first I couldnt even remember how to scroll the camera around. Once I figured that out, I quickly re-did a couple of tutorials to get reacquainted with the process, and spent a bit of time just scrolling around, looking at the model from all angles to get familiar with it again. It took a while to be brave enough to start manipulating verticies - I didnt want to break anything!

Luckily the Tangara was in the midst of texturing, so there was something I could do, without having to mess with the actual geometry. Even so, eventually, I did start tweaking a few things, and correcting a few little problems that I found. Ive always hated the texturing part. Its tedious, and there are so many faces to do. Even a simple cube has 6 sides which each need to be mapped to a material and then UVW mapped to a texture. The Tangara is a little more complex than a cube.

When I left it, I had been experimenting with a technique that involved using Lithunwrap to paint the texture map onto a texture file. It really seems to me that once you have your surfaces UVW mapped, you should simply be able to export that to an image file and begin to fill in the colours and detail. Alas, Gmax doesnt have such a feature, but Lithunwrap does. The problem is that with the limited file formats supported by both Gmax and Lithunwrap, you have to first export the model into a 3DS file so that Lithunwrap will read it. This was causing a few problems, with the conversion process warping the model out of shape in some places. Also, this is a one way process so you cant make use of Lithunwrap's UVW mapping tools. Its only purpose in this case is to simply convert the Gmax UVW maps to an image.

Finally, after a few problems, I decided not to use Lithunwrap to create my bitmaps. Instead, Im using a less accurate method used by a lot of Gmax users, which is simply to take a screenshot of the texture map after you have laid it out, and then use photoshop or similar software to save it as an image. This is a lot less accurate and doesnt produce the cleanest bitmaps, but at least it works and I dont have to convert the model to another format and export a piece at a time.

The picture above is a mix of a simple plain texture, and a screenshot based texture with some text on it. I just knocked it up quickly to test, and to be sure that the lettering was facing in the correct direction on each side. You can see the UVW mapping as blue lines on the front of the Tangara. Ive roughly painted over it on the sides, using a grey that I derived from actual photos (just to see how it looked) . At this stage I havnt started to work on the texture files, which is when all the details will be added, but at least I have the maps laid out onto the first of several texture files which I can work with. Next I will have to tackle the interior and map that.

Once I got to this point, I needed a break so Ive been working on the 86 Class a bit (See below). Gmax is all coming back to me now, and I even managed to cut the windows out of the 86 Class doors using a boolean tool, entirely from memory. Ive also discovered a few new tools that I hadnt used before, thanks to some of the tutorial videos I have been watching. This will make things easier in the future.

File Version: 393
Poly Count: 17629

Note: The poly count shown here is for the Gmax model in progress. The count will generally be higher than that of the finished in-game model since it includes duplication, tools, jigs, and other pieces which may not be part of the final model. It may also include parts which are generally counted separately, such as pantographs, interiors, or bogies. LOD modelling will be used to further reduce in-game polygons.

86 Class Update

Ive been busy over the past couple of weeks. I spent most of that time getting used to Gmax again and remembering how to do all of the tricky stuff. I started on the Tangara first, but will post that later so that it appears above this post.

The 86 Class is by far my favourite locomotive, and Ive been itching to get back to this. Looking at it again after so long, I noticed a lot of little problems that I didnt see before, and I have fixed most of those. I also found some short-cuts that I took earlier to save a few polys, have come back to bite me. I left a few edges disconnected, so that I wouldnt have to add a vertex to the other edge (adding polys), but now I can see some tiny annoying gaps, so Ive fixed that, even though it adds a few extra faces.

I corrected some problems with the front of the base, aligning it better, and improving the corners. These fixes saved a few polys. While I was doing that, I figured out a cheat to save even more polys, and took out around 200 or so, without affecting the look of the model. This was mostly underneath. The foot holes through the front plate, and other things were mirrored on the back of the plate. I realised that with backfacing polys being invisible, that I could remove the detail at the back, which is rarely seen, without changing how the front looks, so underneath is now just a simple flat wall, saving all the faces which made up the corners of the holes which didnt really need to be there. Unfortunately all those saved polys came back, and brought friends, when I started on the interior detail.

Previously I had a couple of Auran brake levers temporarily in place, and the brake stand from one of the models on the the Art Source CD, which is almost a perfect match, but not quite. The independent brake is mounted quite low, and on the 86 class, has a bent handle to raise it up to where the driver can reach it. The train brake handle also has a slight bend in it, and the mount to the brake stand allows it to be removed. I quickly knocked up a mount and attached it to the top of the brake stand, then tweaked the Auran levers to be more like the real thing. Im quite pleased with the result, which you can see in the enlarged picture (or check my flickr pages for the latest screen shots).

I finally found a picture of the reverser handle (I had it all along) and realised that the reverser lever was not quite right, so I made it a bit shorter and stubbier. I added the small rails around the horn and wiper controls (added those controls too) and also the drivers and observers switch panel above the side windows. All of these will operate, and the attachment points are all in place. The speedo was floating in mid air (the cyan thing on the left) so I finished it off by adding the mount, and mounting it to the wall. To save on polys, Im not going to model the cables that extend down into the dashboard from it. You can pretend that they disappear into the wall through the mount :p Finally, I added the doors and cut out the windows in them. they're set up to be animated later.

I created some industrial push buttons and mounted them on the dash. I plan to reuse these later in the Tangara too. On the 86, these control the pantographs, and there are a couple of fault ack/reset buttons in that cluster too. I also made one (slightly different) for the backwards transition button, which can almost be seen on top of the master controller between the throttle and regen handles.

One thing that Trainz doesnt do well are push buttons. You can set toggle switches up as levers, and they work fine, but there is no built-in push button function, and nothing close (like a lever is to a toggle) that will easily do the job. I have a couple of solutions in mind, and Im sure other creators have used both methods in the past. One is to make each button a lever with a very long radius and a tiny amount of movement. By placing the pivot several metres away, you wont notice the slight arc in the buttons travel, but it will be very sensitive and possibly difficult to operate. The other is to borrow a steam engine trick and make them animated, with a collision mesh to trigger the animation. This is the method Im leaning towards, as it seems a lot simpler and more reliable. It seems that all modern cabs have push buttons now, so I hope that Auran have a better solution with Trainz 2009.

File Version: 123
Poly Count: 11434

Note: The poly count shown here is for the Gmax model in progress. The count will generally be higher than that of the finished in-game model since it includes duplication, tools, jigs, and other pieces which may not be part of the final model. It may also include parts which are generally counted separately, such as pantographs, interiors, or bogies. LOD modelling will be used to further reduce in-game polygons.
Posted by Picasa