Sunday, 21 September 2014

"And Now for Something Completely Different!"

A Dream of Electric Sheep - By Phil Baines

  As a lot of the Stainmore Route is over remote moorland, I was asked if it was possible to animate a few animals to add interest to the scenery.
It is possible to make a simple animation of individual animals and using TS2014's AnimatedScenery blueprint, place them in game. I will be using this option, but, whilst I think it is very suitable for single or small groups of animals, such as horses, it seemed that a flock of sheep, or herd of cattle, needed a more random approach. A field full of cows all doing the same thing would probably look worse than the current static models.Looking at the options available, the current animated characters we see on platforms appeared to provide the nearest thing to random movement, so I decided to see if the technique would work for quadrupeds as well as bipeds?So, first catch your sheep!
  As this was to be a Proof of Principle exercise, there were a lot of short cuts in order to speed the process up and this was the first shortcut, as it is a free mesh I downloaded from the web, thanks to azly. It is only for personal use so will be replaced when the final version is created, also, it had several thousand polys which I reduced to 2000, but that is still too high for this kind of model.

  Having loaded the mesh into my 3d software I added the texture. As this will be an animated model it is important that one of the Kuju Skin shaders is used otherwise the model will not appear in game. ( in my case SkinNormal.fx as it has a normal map)
  With the mesh in side view the bones are added to the model to prepare it for animation. I used a picture of a sheep skeleton I found on the web as a guide in placing the bones.
  Putting the model into see through mode, bones were quickly added to each limb, the spine, neck and head. Again, for speed, no attempt has been made to make it very tidy. Also, as the animations would also be just trial ones, no IK chains were added, as the bone placements were to be added by hand.
  Note, that whilst it is common practice to re-name bones, root/neck/hip etc,  to assist the animation process, this is not possible in TS2014. They can be re-named but they must be prefixed by bone_. So, "bone_root" is possible but not just "root".
If you wish to learn about bone placement there are lots of guides on Youtube.
  With the bones in place the model could be skinned. Skinning is a long and tedious process to get right so I didn't try too hard, given the temporary nature of this particular model. So, apologies in advance for some of the images that follow!
Looking at the blueprints for existing Platform Characters there are three different elements. Firstly an AnimProceduralSceneryBlueprint which puts the animated model into the game. then the PlatformCharactersBlueprint, which collects all the characters together and finally, the PlatformSectionBlueprint, which is the loft the characters are generated on.
  So the first requirement was to create the AnimProceduralSceneryBlueprint. The existing Platform Characters appear to have three different animations, walk, wait and shuffle, and these seem to be hard coded so, having prepared my sheep model, I now needed three animations!
  I decided to make the walk animation first and to help me do it I turned to the father of animation, Eadward Muybridge.
  Edward James Muggeridge was born 1830 in England. At age twenty, he immigrated to America, first to New York, and then in 1855, to San Francisco, where he acquired an interest in photography. At this time, he changed his surname to Muybridge.
Under the pseudonym "Helios," he set out to record the scenery of the west with his mobile darkroom. He produced a wide array of panoramic landscape photographs, most famously of Yosemite Valley, and travelled to Alaska to photograph the Tlingit people.
  As Muybridge's reputation as a photographer grew in the late 1800s, former California Governor Leland Stanford contacted him to help settle a bet. Speculation raged for years over whether all four hooves of a running horse left the ground. Stanford believed they did, but the motion was too fast for human eyes to detect. In 1872, Muybridge began experimenting with an array of 12 cameras photographing a galloping horse in a sequence of shots. His initial efforts seemed to prove that Stanford was right, but he didn’t have the process perfected.
  Between 1878 and 1884, Muybridge perfected his method of horses in motion, proving that they do have all four hooves off the ground during their running stride.
  Muybridge worked at the University of Pennsylvania between 1883 and 1886, producing thousands of photographs of humans and animals in motion. During the remaining years of his life, he published several books featuring his motion photographs and toured Europe and North America, presenting his photographic methods using a projection device he'd developed called the Zoopraxiscope.
  Many examples of his work are available on the web in picture format and as animated gif. Unfortunately, he didn't do any sheep but there are animated gif of a walking pig and I thought its gait was sufficiently close to what I needed for the sheep walk. Just needed to get the pictures into my modelling software.
  OK, here is the geek bit! Please note, most of these operations do not seem to like drag-and-drop, so if you want to give this a try, please avoid it.
  Save the animated gif to desk top then open it in photoshop using File\Import\Video Frames to Layers, and you will see in your layer palette all the layers that make up the gif animation. Then use Files\Scripts\Export Layers to files, give them a suitable prefix, e.g. pig and you will have a full set of images to work with.
  There are two options at this point. Create the same number of planes in your 3d modelling software as there are animation frames, then create a Multi\Sub_Object material with each frame as a new sub-object in your material then apply it to the planes. The planes should then be aligned with each other, behind the model, where they are hidden or exposed sequentially during the animation process.
  A more elegant solution is to load the collection of layer images into After Effects and convert it into a movie. If you haven't got After Effects, it can be downloaded for a free trial.
Use File\Import\File and select the first file in your collection of images, tick the box in the lower right corner for sequence then Import. This should load all of your images into AE. From the toolbar select Composition\Add to render queue then click the Render button on the right. This will create an .avi file of your images. In your modelling software create a single plane then texture it using the .avi file as a material. This does two things, it add the images to the plane and creates an animation timeline with a key frame for each image. Align the plane with your model and you are ready to go.
  If you want to see this operation at work have a look at Dave Saxon's Youtube video here  which will demonstrate it better than I can explain it.

With the video in place the bones could be animated, frame by frame, with the following result.
  I quickly made two further animations for the wait and shuffle cycles and added them to the blueprint. For the wait cycle the sheep just turns its head to one side, and for the shuffle ir bends to eat the grass.
  Next the PlatformCharactersBlueprint. This blueprint lists all the characters that will appear on the platform and, as I only had one, was fairly simple to set up. Other factors of this blueprint decide the population density of the characters and when they will appear. If you are familiar with placing Platforms as scenery, these are the adjustable items that appear in the right-hand fly-out of the editor.
  Finally, there is the PlatformSectionBlueprint. This basically combines a platform loft with the platform characters to give the finished product. As I wanted to place the finished item anywhere on the route, the obvious choice was to have an invisible platform, so the existing terrain would show through. This was easy to achieve as I regularly use invisible lofts for viaducts, so I already had the necessary assets. Other items, such as entry point spacing and waiting point offset, are specified in this blueprint. Haven't a clue how these work so just copied some values from an existing people platform.
Finally, ready to place in game and ......nothing!
  Took me nearly a week to work out the problem. Apparently these procedural platforms don't like being near the edge of terrain tiles. Moved the platform away from the edge and, at last, a result.
  The following video shows the Sheep Platform Loft in operation. I apologise once more for the lousy skinning and weird animation.
  I hope you agree I have achieved the Proof of Principle I set out to get, now the hard work starts, creating a new model with proper skinning and believable animation, plus the development of a herd of cows as well!
More Soon............................

Wednesday, 10 September 2014

Start of an Epic Journey

Barnard Castle Takes Shape
  In the latest edition of our 'In Development' blog posts, we take a look at the start of the Stainmore Route, at it's eastern-most point, at Barnard Castle. 

  A station opened at Barnard Castle in 1856. However, it was soon realized that this station would not be sufficient to serve the future needs of the site. A new station was constructed and opened in 1865, leaving the old station to become a goods shed. We are of course modeling the 1865 station, with the track layout representing the railway in it's latter years, but before significant running down began. Please note that the following pictures represent the route as a work in progress, with many details yet to be added. We hope you enjoy the following images.
The south side of the station, as seen from the station yard. The 1865 building was made from an attractive yellow sandstone
The 'train shed' can be seen to good effect in this view of the north side of the station. We look west. The Stainmore route heads off into the distance
Looking at the west end of the station, with the 1949-built canopy
A passengers view, looking towards the main platform, under the train shed. Note the impressively modeled cast-iron scrollwork
Looking north east across the station site
North Eastern Railway trespass warning sign positioned in the station yard 
Looking west towards the station. On the left is a placeholder signal box and the level crossing ahead. The level crossing was controlled from the east signal box. Hopefully we can replace the level crossing with something which fits better. The left-hand line accesses the east bay, which was lifted in 1954. Out of shot, to the right, is an engine shed and turntable
Behind the station, to the south, is a short NER goods branch. The original Barnard Castle station was along this line
The site of the original Barnard Castle station, now the site of a goods depot. Note the coal drop. These were found throughout the system, at various stations and yards along the line.
  So that how Barnard Castle looks at the moment. Lots of finer details are to be added, including: Point rodding, signals and much more.

More soon..........................

Tuesday, 12 August 2014

Kirkby Stephen East Takes Shape


  Thanks to the work of Phil Baines, the buildings in and around the station at Kirkby Stephen East are beginning to take shape now. We present a pictorial update on the station:
An overview of the station looking west
The footbridge down onto the island platform. Note the lift to the left. Way ahead of it's time!
An overall roof gives shelter to east-bound passengers
Looking east through the station. To the left are goods through lines, sidings and the engine shed
That's the main station buildings in place
A view from above the roof towards the engine sheds
The sheds and turntable. Note the unique electric coal gantry
Watering facilities at the west-end of the station site
That concludes our look at the progress at Kirkby Stephen East station. 
  In other news, the Ivatt 4MT has progressed a little, with the tender modeling now almost complete. Here are the latest renders:
More soon........................................

Tuesday, 22 July 2014

The Building of Belah Viaduct - Part 3

By Phil Baines

  In the final photo of my previous blog you can see the bottom of the columns rested on concrete bases.
  So my next task was to model these, which was quite simple as they were tapered cylinders. As they were painted black, similar to the bottom of the steel columns, I saw no point in creating shadow baking for them, so having produced one, it was a simple copy and paste operation to put in the other 95.
With the supports and decking complete that left the abutments at each end. The East abutment was a fairly simple structure set into the hillside

  The West abutment was virtually identical, but with wings added.

  Fortunately, Peter Walton's book provided a side elevation of the East abutment and I was able to model the East abutment from that. Next I cloned the abutment, added wings and I had the West version as well.



  Two more jobs to do and the finished article could be assembled.
Firstly, the abutments were textured with a tiling material which is a quick way of texturing large objects, but the results look too even and un-lifelike. The addition of the shadow map gives some depth to the model, but on large items like this I like to add a bit more. So, I open the shadow map in photoshop and using greyscale colours with a selection of "grunge" brushes, I add random splashes of weathering to the shadow map. Nothing too complex, at 30mph the driver won't notice too much! Grunge brushes are readily available as free downloads on the net and well worth getting.
Finally, I look at all the objects I have created to assemble the bridge and, where suitable, I select and clone any upwards facing polys. These are then combined into a single object called snow. I raise this object by a couple of mm to stop its polys z-fighting with the polys they were cloned from, then apply my snow material. This is composed of two textures, a default season texture and, using the _wi suffix, a winter texture. The winter texture is, obviously, white snow, but, for the default season texture, I use an invisible texture (just a copy of the invisible texture I use in Viaduct building lofts), so nothing shows except in winter.

  The Belah viaduct was now ready for inclusion in the game and I hope you have enjoyed my description of how it was achieved.


Monday, 14 July 2014

East Meets West


Joining the West Coast Mainline at Tebay and Penrith 
The Stainmore Line(left) Arrives at Tebay
  The Stainmore Route was an incursion by the NER deep into foreign territory. Unlike the NER’s route into Carlisle Citadel, the ultimate melting pot of pre-grouping railways, the interface of both westerly ends led to some interesting  operational arrangements.

 Tebay’s existence as a town was a function of both the railway as a junction, and as 2 locomotive depots reflecting that NER locomotives could not work through over the LNWR / LMS (there is a curious exception of the occasional Sentinel Railcar working through to Ulverston, but I’ll save that for
another blog) and for the supply of banking engines for the 4 mile climb to Shap summit.

  Regular passenger traffic was limited to the stopping service to Kirkby Stephen, using the “back” or “Geordie” platform 3 at Tebay, with its dingy overall roof.  Through traffic were the seasonal Newcastle to Blackpool trains which changed engines here, westbound using Platform 3 where the cafeteria would line the platform with additional tables for the rare burst of customers; the eastbound services were worked via Platform 1 (the Down Main of the WCML) and engines were changed on the Kirkby Stephen line, presumably near Tebay No.3 box. Quite why is not documented!

  Freights were almost exclusively mineral traffic from what would now be called south Cumbria, principally Barrow. Westbound engines were taken off in the reception line by Tebay No.3 and the wagons fly shunted to the south yard of 5 roads east of platform 3 where a “wessie” engine was attached for onward routing down Grayrigg Bank (poor but more brutal cousin of Shap – 10 miles of 1in100) through Oxenholme to Hincaster Junction for Barrow. This cut ten miles off the route via Carnforth, and met the Barrow line at Arnside. Such workings were an operation headache – the run down Grayrigg required brakes to be pinned down and were taken slowly, and at Hincaster this heavy, slow train had to be pathed 
across the Down Main. It was common to schedule trains around 4 am, after the overnight sleeper traffic and fast overnight freights had passed.

  At Appleby, the link to the S&C was infrequently used, mainly for excursion traffic and engineering diversions. The was one scheduled service from Appleby Midland to Penrith for convenience of connection from a Leeds service, but ironically the link only became significant when the EVR was taken up and the link used to access the truncated section to Warcop to serve the army.

  The Eden Valley Railway didn't make it as far Penrith. Whilst there were early plans for a route parallel to the WCML, running powers were granted by the LNWR from the north facing Eden Valley Junction at Clifton as far as Penrith. Another curious point of the railway’s early history was the original connection
facing south to Clifton & Lowther station – necessitating a reversal to reach Penrith.

  Penrith was not a destination in itself other than as a market town for the Eden Valley, and as a connection to the WCML. The route to Workington via The Cockermouth, Keswick and Penrith Railway for mineral traffic was the reason the line was built – that peaked in 1900 and all but ceased by the end of the
Great War. The CKPR was a oddity of a railway company in that it didn't run any trains – the LNWR conducted all traffic bar through minerals for which the NER had sole running rights as far as Cockermouth Goods. To avoid a reversal in Penrith, the “Redhills Loop” was created - a north facing junction immediately down of the Lowther Viaduct, and a double junction and a loop diving under the CKPR at 1 in 50, curving sharply west and climbing similarly to meet the Keswick road at Redhills junction.  Its last recorded working was in 1929 with a through excursion train return from Keswick to Morecambe. 

  The NER had its own running line from Penrith No.1 box (CKPR junction) into its own bay platform (no.3) east of the WCML down line. The short platform could take a locomotive and 3 coaches but unlike the CKPR had no run round facilities. Answers on a postcard as to whether the locomotive propelled its train out or was released by a pilot. The NER had the use of Penrith’s tiny 59 foot turntable – enough for a J25 or a Cauliflower but too short for even an Ivatt 2MT. The Redhills loop was rather handy for turning longer locomotives, but the condition  of the track forced its closure and lifting by 1933.

RCH diagram showing the junctions

Wednesday, 28 May 2014

Building Belah Viaduct Continued

Phil Baines talks us through the process of building the incredible structure that is Belah Viaduct:

The Building of Belah Viaduct - Part 2

  Having built the handrail, the next section to be constructed was the deck. The reason for doing the deck next was to do with the shadow baking. As the upper portion of the supports would be under the deck, it was necessary to have it in place to cast shadows on to the supports.
  As with any major construction it can be daunting looking at the project as a whole, so the best way forward is to break it down into manageable chunks. With 16 spans, each span becomes an obvious chunk and that is how I built the deck, in 61ft sections. The model would also be used for the Deepdale Viaduct. Deepdale is curved so I decided I would need to build it as a Lofted item, therefore, it made even more sense to construct the model in single span sections.
  The start was simple, an 18.9m(61ft) long by 7.4m(24ft) wide deck which was set with its upwards facing poly at zero in the modelling  software. The deck was set as ground level so that when the Deepdale model was attached to the track, using the Offset tool, it would be at the right height.
  With the deck in place, all that was necessary was to replicate the various supports and braces underneath. I would make one brace or support at a time, unwrap it, then duplicate it as required. I make a basic assumption that the light will fall on identical parts in an identical way, so unwrapping then copying saves a lot of unnecessary duplication of effort.
  Although it was decided to make this a high poly model it is still not necessary to model every detail of the bridge, so a certain amount of artistic licence is involved in choosing the elements to re-produce. The initial view of the deck span looked like above and the observant among you will note the missing elements.
  As can be seen in the above photo, the rails crossing the viaduct ran on top of wooden baulks of timber, so the final version of the deck span had these added, then the model was textured and shadow baked with the following result. I also modelled in a check rail while I was on with it.
  Next I made a start on the supports. There are 15 supports and each support is constructed of  5m high sections, ranging from 2 sections in the shortest to 11 sections in the tallest.
The construction starts with a single central column which is displaced 2.25m along the Y axis, and then unwrapped. The column is then copied and the copy moved and inclined to represent the side column, which is repeated for the other side. The UVW maps are then selected and moved to a clear area of the texture sheet, so, when shadow baked  they display the different shadows cast by their  different orientation.
  The three columns were then grouped together and the group copied and rotated 180deg around the 0,0 point. This orients the same polys to the inside of the section so I can use the same UVW map.
  Using identical techniques I then built up all the elements of the section, adding the various beams and braces until I had a complete section ready for duplication.
  You will notice the strange extensions to the cross beams, which were added to help me during the duplication process.
The duplication process was done in three different ways. Firstly the central features were simply copied and lowered by 5m. Secondly, the side elements were copied, lowered 5m then  displaced sideways by 0.45m so their tops lined up with the bottoms of the layer above. Thirdly, the cross braces were lowered then scaled to fit the wider cross section. This stretches the texture slightly, but on such minor items I considered it an acceptable compromise. I didn't think this would be acceptable for the cross beams, as they were much larger and texture stretching would be obvious, therefore, I made them long enough for the widest cross section, but with pieces I could chop off to fit at each level.

I then have a structure like this:
  As mentioned earlier, the top section is in the shadow of the deck span, so I now select all the elements of the topmost support section and move them on the UV map, then shadow bake both sections.
  All that remains is to duplicate the lower section 9 more times and I have replicated the tallest support. This is, in turn, duplicated 14 times to generate all the supports. It is then a simple process of chopping off unwanted sections to create supports of the right height, whilst trimming the cross beams to the right length at the same time and we are nearly  there.
  One further tweak is required. In this picture from the ©Turner collection it is possible to see the lower half of each bottom section was painted black.
 Whilst this was not a consistent feature over the life of the viaduct, it was decided to add it to the model.
  This was achieved by, once more, playing with the UV map. Having selected all the bottom section elements of the model, they were unwrapped and then their UV maps moved to a clear area of the texture where the black paint could be added.


  The main elements off the Viaduct were now finished and in my next blog I'll detail the final bits and pieces to get the viaduct in game.


Tuesday, 27 May 2014

Heading West

Development of Eden Valley Line - By Ben Yates

Kirkby Stephen East Junction - Stainmore route to the left and the Eden Valley line on the right
  Appleby (latterly Appleby East) was opened in 1862, 14 years before the Midland Railway rolled into town under the duress of Parliament with the railway they didn't want to build - sorry S&C fans, but it’s true, and this makes me wonder if the locals really rang the church bells to celebrate parliamentary approval of the railway coming to town in 1866, when they had an operational line 4 years previously. The Midland station was a stone’s throw across the Schoolyard, but critically was at a higher elevation by some 40 feet, just 200 yards apart. The 2 lines were joined with a north facing junction on the Midland, and a south facing junction on the EVR north of Appleby East. This made the line useful as a diversionary route to the northern half of the S&C, and there are records of the prestigious Thames Clyde Express (behind a Jubilee) having been diverted over
the EVR, so with Class 40s having run to Warcop it can be assumed the EVR was
built to higher loadings than Bouch’s bridges on Stainmore. The link remains to
the day despite the closure of the last section to Warcop, and is still used as an occasional refuge for special trains allowing service trains to pass. The gradient is around 1 in 77, which with a reverse curve presents a challenge to get a train started.
An overall view looking down at Appleby East, to the
left, and the Midland route to the right
  This brings us onto track-laying, and the process of how to go about capturing this in the sim. The starting point is to take the gradient profile and blow it up as large
as possible – this one is done to A3. After checking for copier distortion, work out the distance of each section to the metre. I then check this by measuring the whole length of the section and checking against the cumulative lengths of each gradient. This has usually been within 2-3% accuracy, and individual lengths are adjusted accordingly. In scientific terms, there is bound to be a significant margin for error when dealing with conversions of 1mm = 160m, but the method seems to work pretty accurately in practice.

To get a match between the profile and the DEM, it is necessary to find a known point of altitude of the railway. This is best done by finding an OS Map contour crossing the line where the line is level with the surround terrain. This method can be used to check periodically as track is laid.

The track is laid with easements, which allow use of superelevation to add cant to the track on curves. Easements are the gradual increase in radius of a curve, which gives a smooth transition to the correct radius. The tool in TS13 is, unfortunately, a swine to use and impossible to lay track under the ground, so large parts of the line have to be laid conventionally, and the terrain formed
to allow the track to be relaid with easements. This is all rather time consuming, but the end result is worth it. Another limitation (though sometimes ignored) is that applying superelevation to junctions means the don’t render properly and provide an awful ride from the cab. I make sure the easement section ends before crossovers to avoid this. 
A super-elevated curve just west of Kirkby Stephen, on the Stainmore line
  Appleby was something of a challenge. The key thing was to get the S&C trackwork over the EVR (now the S&C bridge over the A66T) at the correct height for the overbridge, and alos to match the road bridge that goes under the platform. Unfortunately there are 2 changes of gradient on the S&C between there and Appleby Station – level, climbing 1 in 200, then 1 in 400 and it is
impossible to get an accurate measurement from the tiny Ian Allen gradient book. Trial and error matched the track with both bridges (a good hour’s work!) which allowed the joining line to be worked out.

A further complication was the complicated trackwork at Appleby North yard, which includes a double slip – notoriously hard to render correctly, and impossible to do so when using correct track spacing for the 6 foot as we do (the observant of you may have noticed that default tracks have a wider spacing, presumably down to this). To solve this, tracks are laid singly and offset at a
slightly wider spacing, which did the trick. Once the junctions are laid at each end of the link, a piece of track was laid and manipulated to establish the ruling gradient of 1 in 77 (I’ve seen 1in 80 quoted) and after much fiddling I got both lines to join. I’m not totally happy with how the curves match in radius, so there may be some further work to do on this. The junction was singled around 1959, but I wanted to include the full trackwork to reflect the line at its operational peak.

The junction at Appleby
There’s still a turntable to install – it appears on the maps so I assume it lasted until the end of steam – answers on another postcard.