So, you want to build a train for BVE4?

In part 2 I discussed the raw data you need in order to produce a good, prototypical BVE4 train.  Now we're going to get on to the actual train building!

The first thing you're going to need is decent image editing software.  Personally, I favour Paint Shop Pro for this, but there are plenty of programs out there.  It's not important what program you use.  The ability to reduce colours using a custom palette is very useful, most good image editors can do this.  You'll do all the image processing in 24-bit colour, (also known as "true colour"), and only reduce the image to 256 colours right at the end.

OK, to work.  We'll start with the biggest and also in some ways the easiest image of the lot, which is the main panel background daytime image, which is often called "panel2.bmp".  This links it in name to panel2.cfg, and it allows the addition of BVE4 graphics to a BVE2 train, which used panel.cfg and panel.bmp, although in fact you can call the images anything you want, it's a good idea to use standard names.

Panel2.cfg is, as I said, the main background image for your cab view.  One of the peculiarities of BVE4 and some (but not all) graphics cards is that you get problems if the images are not sized in "powers of 2".  If you study most BVE4 trains, you'll see that all the image sizes fit powers of 2:  32x256, 64x64, 512x2048 and so on.  This goes just the same for the panel image and a popular size for this is 1024x1024.  The first thing to do, then, is to open one of your panel images.  Ideally, you'll have one with power handle off and reverser in neutral.

Now, you have to decide whether to crop, resize or both.  If you've got spare picture around the egdes, especially at the sides, which is not showing anything useful, you might want to crop to get rid of it, then resize the picture to 1024 pixels wide.  At this point it's a good idea to try different resizing methods and see which gives the nicest results.  Once you decide that, make a note of the factor that you resized by, ideally in percentage terms.  You'll have other images to resize later and you want them all to come out the same scale.

Havign resized, now is a good time to consider the overall brightness and contrast of the panel image.  This image will be the bright, daytime image, the way it looks in full daylight, so it should look quite bright.  If it's not bright enough, adjust the brightness and contrast until you're happy.  When doing this, don't do a series of adjustments - if you're not happy with the adjustment you made, undo it using the graphics program's "edit-undo" facility, and try again with different settings.  Once you're happy, make a note of the adjustment settings you used: as for the rescaling, you're going to need them again.

If it's not 1024 deep after that, you need to adjust what PSP calls "canvas size", in other words, add some new picture.  When you do this, it's best to add it so that the new bit is at the bottom.
The next thing you need to do is make the windows "blue".  Again, you don't have to use blue, you can in fact use any colour.  However, convention favours blue.  To do this you want to make the primary  or foreground colour (the one that y
ou paint with), and make it as blue as possible, like this:
selecting blue

This shows the colour selection panel from PSP10.  Note that the colour is identified by HTML code #0000ff.  You need to be using this or the correct RGB values, or in due course the train won't work right.  One of the most common errors is to have the blue not 0;0;255 but 0;0;254 (HTML #0000fe) which you can't tell the difference to look at, but when you run the train in BVE, you get blue windows, rather than the view of the track.
Once you've selected the colour, you can now paint out the windows.  Take it slowly, use plenty of zoom and make sure you get the edges right.  Make sure you save your file frequently, there's nothing worse than spending half an hour on a tricky bit of editing only to lose it because the machine threw a hissy fit or the power went off.

When you run BVE, all the stuff that's blue will come out transparent.  Here's the panel image from the class 66, so you can see what you're aiming for: all the windows are blued out, including the side window and a small strip of the RHS windscreen.  You can also see where the "canvas" has been extended at the bottom to make the image 1024x1024.
class 66 panel

Also to be seen in this image is other things that need doing:  The meter needles have all been removed from the gauges which are going to be active in BVE, i.e. brake reservoirs, brake pipe, speedo and ammeter, also the power handle (on the right) is not there.  The other thing to remove is the wiper - you'll put that back later as an animated one.  Anything you don't intend to animate can stay put - so you'll notice that one of the gauges on the image above still has its needles - in BVE, that gauge doesn't do anything.
If we zoom in on the speedo you can see what needs doing, and also see that whoever erased the needle from this one did a neat job, as you can't see where it was!
class 66 speedo]

notice how the speedo looks "pixelly".  That's becasue it's zoomed into 400%.  There's a limit to how fine the detail can be - BVE will display the images at about 100% depending on graphics settings, so you're aiming to get the image looking "right" at 100% view.  Note that if you make a really big cab image, say 2048x2048, you can get more detail into the image.  "Great", you might think, but there's a problem with that: when you run the train in BVE, the program will scale it back down to 1024, and all your cunningly added detail will get messed up.  Worse, really fine lines will sometimes disappear altogether, so there's no point in going overboard on the fine detail - that speedo above looks quite good in the game, and the numbers don't need to be clearly legible - the human brain is very good at filling in missing detail!

Carry on editing the panel image until you're confident that it looks as good as it's going to.  It's worth spending some time on this to get it right.  Once you're happy with it, the last thing to do is to reduce the
colour depth (or number of colours) to 256 (8-bit colour).  In PSP10, I use the following settings:
color reduction settigns

It's important not to use standard pallete or windows colours, you don't need them and it'll spoil the look of your picture.  It's also importnat not to use a colour reduction method which inlcudes dithering, as that makes some colours look "spotty".  As with resizing, play with the options in your editing package, see what produces the best-looking final image.  The settings above for PSP10 make an image which looks almost as good as the original 24-bit.

This is what the pallette looks like for the class 66 panel image, above - or rather, it's what it would have looked like if I'd done it using the settigns above:
sample palette

note that all the colours in the pallete are actaully used in the image somewhere, so none of them are "wasted". 

By now, you should have your final "daytime" panel image.  In part 4, we'll go into the details of animation.