A+ A A-

Changing and adding cab cameras in an engine

by Chacal

2014-08-17


Driving an engine from the cab in a train simulator can be a claustrophobic experience because you cannot move your head and body around like you would do in reality, you can only rotate your view around a fixed camera position. This limitation can be somewhat circumvented by adding more camera positions.

Screenshot1

TS 2014 allows this, whereas previous versions allowed only two positions. This tutorial presents this little-known and little-used feature.

The blueprint editor (launched with Utilities.exe) was updated for this feature. If you are the engine builder and you create a new cab camera blueprint, you will be able to add more than two cameras, using the "Timeline Entry" element.

If you want to add camera positions to an existing engine of which you are not the author, you will need to edit the cab camera blueprint manually. This is the subject of this tutorial.

I will use as an example Reppo's excellent GP20 SP (advanced) diesel locomotive, which is my favorite DLC.
In the advanced version, you have to manually start the engine by using switches on the engine cab's rear bulkhead. To make this easier, Reppo has placed his 2nd camera position as if you were standing up in the cab. You then have to turn around and use the switches behind you. The unfortunate effect of this is there's no camera position for the conductor's seat.

In this tutorial, we will:

  • modify the 2nd camera position so that it looks back towards the electrical panel, so we don't have to turn around;
  • add a 3rd camera position for the conductor's seat; and
  • add a 4th camera position in the nose steps for looking forward through the center window.


NOTE     I use Mike Simpson's excellent RW-Tools free utility. . Get it here (verified 2019-10-10):  http://www.agenetools.com/downloads.html.

I have made RW-Tools my default program for opening .bin files in Windows, this makes editing .bin files so much easier.

You can also use serz.exe for uncompressing .bin files into .xml files, and comressing them back to .bin files. This is out of scope for this tutorial.



1- Find and open the cab camera blueprint

 

  1. Navigate to the engine folder for the engine you want to modify, and open the engine's blueprint. For Reppo's GP20 SP, this is Assets\Reppo\Gp20PackSP\RailVehicles\Diesel\Gp20SP\Gp20SP_Adv.bin.
  2. Open this file in RW-Tools and search for InteriorCamera.
  3. Inside the <InteriorCamera> node, we find this:

    <BlueprintID d:type="cDeltaString">CabView\gp20_Cab_camera.xml</BlueprintID>.

    We have found the location of the cab camera blueprint. It is :

    Assets\Reppo\Gp20PackSP\CabView\gp20_Cab_camera.bin.
  4. Close the file.
  5. Make a backup of Assets\Reppo\Gp20PackSP\CabView\gp20_Cab_camera.bin, just in case, then open it with RW-Tools.


2- Find and understand existing information

The blueprint contains all the information (position, direction, freedom of movement) for the 1st and 2nd camera positions.

The 1st camera position is described in nodes <cameraOffset> and <cameraDirection>.
The 2nd camera position is described in nodes <windowCameraOffset> and <windowCameraDirection>.

Both cameras share the same degree of freedom parameters described in nodes <verticalDirectionalFreedom> and <horizontalDirectionalFreedom>. There are also other parameters that don't interest us now.

Positions are given in meters from the engine's center point at ground level.

In this example, the engineer's camera position (the <cameraOffset> node) is 1.25 meters from the cab's center (X=1.25), 3.42 meters from the ground (Y=3.42) and 3.81 meters from the engine's center (Z=3.81).

Looking at the <windowCameraOffset> node, we see that Reppo placed his 2nd camera at 0,45, 3.78, 3.81, which is adequate for someone standing a little to the left of the engineer's seat.

Directions are, uh, harder to explain and possibly buggy. As far as I can tell, directions define the X, Y and Z position of the point the camera is looking at, except that 0,0,1 is looking straight forward, which makes no sense. 0,0,-1 should look straight backwards but does not work, use -0.0001, 0, -1 instead. For other directions you'll have to experiment. For an example, see my caboose passview file in "Passenger views for the HSC P70 and caboose" in the RWA File Library (search for  HSC_Views.zip).

Freedom of movement is also hard to explain, but 0 means you can't move the view at all. Reppo used "2" for verticalDirectionalFreedom, which restricts vertical movement a little, and 300 for horizontalDirectionalFreedom, which lets you turn all around. Again, feel free to experiment.

3- Modify existing camera

Let's change the 2nd camera so that it faces backwards, so that we don't have to turn around every time we stand up.
In the <windowCameraDirection> node, for the X position, we need to change 0 to -0.0001, and for the Z position, we need to change 0 to -1.
The result is the two following lines:
<X d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">-0.0001</X>
<Z d:type="sFloat32" d:alt_encoding="000000000000F0BF" d:precision="string">-1</Z>

  1. Make those changes, then hit Ctrl-S to save your changes.
  2. In Windows Explorer, delete the file Assets\Reppo\Gp20PackSP\Blueprints.pak.
  3. Start TS2014 and choose (or make) a scenario with Reppo's GP20 SP. Try the 2nd camera: it should now pivot backwards.
  4. Exit the scenario and go back to the scenario list. No need to exit TS 2014.

 

Screenshot2

4- Add new cameras

The GP20 blueprint does not contain the necessary xml nodes for additional camera.

  1. Select and copy (Ctrl-C) below the following block of xml code:


                    <TimelineEntry>
                        <cCabCameraPosition d:id="135">
                            <CameraOffset>
                                <cRVector3>
                                    <X d:type="sFloat32" d:alt_encoding="000000000000F4BF" d:precision="string">-1.25</X>
                                    <Y d:type="sFloat32" d:alt_encoding="00000000295C0B40" d:precision="string">3.42</Y>
                                    <Z d:type="sFloat32" d:alt_encoding="00000040E17A0E40" d:precision="string">3.81</Z>
                                </cRVector3>
                            </CameraOffset>
                            <CameraDirection>
                                <cRVector3>
                                    <X d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</X>
                                    <Y d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</Y>
                                    <Z d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</Z>
                                </cRVector3>
                            </CameraDirection>
                            <VerticalDirectionalFreedom d:type="sFloat32" d:alt_encoding="0000000000000040" d:precision="string">2</VerticalDirectionalFreedom>
                            <HorizontalDirectionalFreedom d:type="sFloat32" d:alt_encoding="0000000000C07240" d:precision="string">300</HorizontalDirectionalFreedom>
                            <TransitionIn d:type="cDeltaString">eTrue</TransitionIn>
                            <TransitionOut d:type="cDeltaString">eTrue</TransitionOut>
                            <MinFOV d:type="sFloat32" d:alt_encoding="000000A09999D93F" d:precision="string">0.4</MinFOV>
                            <MaxFOV d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</MaxFOV>
                        </cCabCameraPosition>
                        <cCabCameraPosition d:id="136">
                            <CameraOffset>
                                <cRVector3>
                                    <X d:type="sFloat32" d:alt_encoding="000000606666D6BF" d:precision="string">-0.35</X>
                                    <Y d:type="sFloat32" d:alt_encoding="00000000D7A30C40" d:precision="string">3.58</Y>
                                    <Z d:type="sFloat32" d:alt_encoding="000000C0CCCC1040" d:precision="string">4.2</Z>
                                </cRVector3>
                            </CameraOffset>
                            <CameraDirection>
                                <cRVector3>
                                    <X d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</X>
                                    <Y d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</Y>
                                    <Z d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</Z>
                                </cRVector3>
                            </CameraDirection>
                            <VerticalDirectionalFreedom d:type="sFloat32" d:alt_encoding="0000000000000040" d:precision="string">2</VerticalDirectionalFreedom>
                            <HorizontalDirectionalFreedom d:type="sFloat32" d:alt_encoding="0000000000C07240" d:precision="string">300</HorizontalDirectionalFreedom>
                            <TransitionIn d:type="cDeltaString">eTrue</TransitionIn>
                            <TransitionOut d:type="cDeltaString">eTrue</TransitionOut>
                            <MinFOV d:type="sFloat32" d:alt_encoding="000000A09999D93F" d:precision="string">0.4</MinFOV>
                            <MaxFOV d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</MaxFOV>
                        </cCabCameraPosition>
                    </TimelineEntry>

 
  1. Now in RW-Tools look at the end of your blueprint file (about the 8th-to-last line) and find the line that says: </cCabCameraUpdateBlueprint>.
  2. Position your cursor at the beginning of this line, and hit Ctrl-V to paste the xml code just before this line.
    This block contains two <cCabCameraPosition> nodes, one with id 135 and the other with id 136.You could add more, making sure the id for each is unique.
    This adds two new camera positions: one at -1.25, 3.42, 3.81, which is the conductor's seat (it mirrors the engineer's seat position), and the other at -0.35, 3.58, 4.2, which looks like you are standing close to the center windshield, in the stairs going down into the nose compartment.
  3. Again, hit Ctrl-S to save your changes.
  4. In Windows Explorer, delete the file Assets\Reppo\Gp20PackSP\Blueprints.pak.
  5. Switch back to TS 2014 and play the scenario again. Try the new cameras.
  6. Continue making and testing changes until you are happy with the results.

 

 

 

Last modified on
HOT NEWS

Visitors Counter

15804555
Today
Yesterday
This Week
This Month
Last Month
6662
7730
27839
85355
224128

Your IP: 3.94.129.211

Who's Online

We have 265 guests and no members online

blue green orange red

Copyright 2018 by Mutagenix - A subsidiary of the NERR Network. Best viewed at 1280 x or more.