The Cockpit

Overview - Creation - Powerbig - Notes


The Cockpit:

All of the files that comprise the in-truck cockpit dashboard elements are contained in "cockpit.pod".

The images themselves are composed of .RAW, .ACT and .AAI files. The .raw files are greyscale images, the .act files are 256 color palettes that give the images color, and the .aai files are anti-alias information files that dynamically smooth the edges of the cockpit panels and steering wheel elements.

The "powerbig" files located in the data folder of "cockpit.pod" are plain text files that define the size, locations and filenames of the in-truck cockpit elements, all of which are configurable. "Powerbig.480" defines the cockpit for the standard 640x480 screen resolution, while "powerbig.400" and "powerbig.200" define it for the 320x400 and 320x200 resolutions.


Stock cockpit files:

There is an independent set of cockpit files for each screen resolution. The "480" in the following filenames indicate they're for the 640x480 resolution, which is the only screen resolution I will be dealing with. The filenames with 200 and 400 deal with the 320x200 and 320x400 resolutions.

- The 307,200 byte "PBIG*480.raw" series, 640x480 pixels each, are the four cockpit wall panels. These raw files are accompanied by ".act" palettes and ".aai" anti-alias information files.

- The 50,200 byte "PW480***.raw" series, 350x150 pixels each, are a series of images (an animation) of the steering wheel in left, right and center positions. These raw files are accompanied by ".act" palettes and ".aai" anti-alias information files.

- The 24,576 byte "PS480*.raw" series, 128x192 pixels each, are the shifter in various positions, these raws have no act and so use metalcr2.act.

- The 342 byte "PL480.raw", 18x19 pixels, is the "on" shifter light.

- The 6048 byte "FORDM480.raw", 108x56 pixels, is the mirror frame.

I have converted all of the "480" cockpit art files into GIF form, naming them the same as the stock files, offering a convenient way to deal with the raw images and original act palettes all at once. I have also made a copy of the stock "powerbig.480" file, which is the text file used to configure the cockpit layout, and I've written a detailed explanation of all it's sections.

Get all of these files in a ZIP: cockpit480.zip - 1.13 mb


Cockpit creation overview:

Creating all new cockpits is a fairly simple process if you have truck making and graphics editing experience, you just create some raw files, edit some text, generate some aai files (easily done) and build a pod.


The primary elements:

   - Wall panels, as four raw images [with aai]. (info)

   - Steering wheel raw file series [with aai]. (info)

   - Shifter raw file series. (info)

   - Shifter light raw file. (info)

   - Mirror frame raw file. (info)

   - Text configuration file "Powerbig.480". (info)

   - Main 3D window. (info)

   - Rear view mirror window. (info)

   - Speedometer and tachometer needles . (info)

   - While not exactly part of the cockpit the finder is displayed in the cockpit view, it's files are contained in the cockpot.pod and can be dealt with separately if desired.


Example procedure:

1) Create the front panel of the cockpit and then the other three sides if desired, save as raw images then generate aai files for them, then edit powerbig and insert the names of your raw files.

2) Edit powerbig and adjust the 3D window to fit your front cockpit panel.

3) Change the size and location of the speedometer and tachometer needles to match the gauge graphics on your front cockpit panel, by editing the powerbig.

4) Replace, move or remove the mirror frame as needed, just make a new raw file and edit the powerbig. Edit the powerbig and adjust the 3D mirror window to fit your front cockpit panel or mirror frame location as needed.

5) Replace, move or remove the shift light as needed, just make a new raw file and edit the powerbig.

6) Replace or move the steering wheel if you like, generating aai files as needed, just make new raw files and edit the powerbig, changing the erase window to match the new size and location.

7) Replace or move the shifter, if you like, just make new raw files and edit the powerbig.

8) Build a pod containing your new and changed files, mount it above the stock cockpit.pod in the pod.ini and then test it in the game.



The cockpit configuration file
"powerbig.480" explained:


Menu:
  
001 ; Background image file
  002 ; 3D Window coordinate and size
  003 ; Speedometer center
  004 ; Speedometer radius
  005 ; Speedometer needle model
  006 ; Speedometer zero angle
  007 ; Speedometer degrees per mph
  008 ; Speedometer face redraw
  009 ; Tachometer center
  010 ; Tachometer radius
  011 ; Tachometer needle model
  012 ; Tachometer zero angle
  013 ; Tachometer degrees per rpm
  014 ; Tachometer face redraw
  015 ; Steering wheel coordinate & size
  016 ; Erase window
  017 ; Steering wheel base filename
  018 ; Number of mirrors
  019 ; Mirror Location, size
  020 ; Angles
  021 ; Translation
  022 ; Zoom
  023 ; Bitmap position and size
  024 ; Bitmap name
  025 ; Shifter name
  026 ; Shifter position and size
  027 ; Shift light bitmap
  028 ; Shift light position and size


; Background image file
pbig480.raw
pbigl480.raw
pbigr480.raw
pbigb480.raw

These raw files are the front, left, right and back panels of the cockpit, respectively and in that order. You can use any name you like for each file but they must be listed in the proper order. The images are painted black wherever the 3D display and mirror is to show through, pure black is transparent. NOTE: All custom cockpit panels MUST have new .aai files generated for them! (info)


; 3D Window coordinate and size
0,88,640,240

The first two numbers are x/y coordinates of upper left corner of the 3D display, used to fit the display into the "window" of the cockpit image. The second number, which is the only value that applies in MTM2, is the number of pixels down from the top of the screen, which sets the top edge of the 3D window in place.

The last two numbers should be the width and height of the display itself, but changing them does nothing, the cockpit window is locked into the strange screen resolution of 640x285 pixels and cannot be changed. The full view within this resolution is much like that seen in the cab without the cockpit, only it's a bit squashed and some vertical space is cropped off both the top and bottom of the view.

The maximum height of the 3D window is almost exactly 3/5 of the screen, which can be raised or lowered vertically to any position within the total 480 height, leaving at least 2/5 of the screen to fill in with the background image. The vertical positioning value does not seem to match the exact pixel coordinates like everything else in the powerbig, so you may find yourself experimenting a bit in order to get the height you want. As a point of reference, a value of 23 will place the top edge of the 3D window at the very top edge of the screen, if you use a smaller number you will begin to lose window height.

The top edge of the 3D window should probably lie below the bottom edge of the finder because the finder itself floats on a black "re-draw" square that will always be rendered on top of the 3D and mirror windows. The coordinates of the finder square are 574,7 for the upper left corner and 635,67 for the lower right corner, which is to say that the top of the 3D window should be at least 67 pixels below the top edge of the screen.


; Speedometer center
153,319

This sets the center point of the cockpit speedometer needle. The first number is the number of pixels in from the left side of the screen. The second number is the number of pixels down from the top of the screen


; Speedometer radius
32

This sets the radius of the speedometer, presumably in pixels, changing the size of the needle. While the needle is the only thing visible on top of the dashboard raw, there is in fact a black square in which the needle floats, which seems to be about five pixels larger than the value you specify. You will need to make your speedometer graphic large enough to accomodate the edges of this black square, lest it overhang the edge of the visible dash instrumentation.


; Speedometer needle model
needle.bin

The "needle.bin" exists in both the cockpit and ui pods, it is a small, strange bin without any raw file assigned to it in the normal fashion. No replacement seems possible.


; Speedometer zero angle (was 315.0)
304.5

The angle at which the speedometer needle rests at zero miles per hour. This value is to be coordinated with the speedometer graphic. This is one value that applies to BOTH the in-truck cockpit speedometer as well as the dashboard overlay seen in the chase cam views.


; Speedometer degrees per mph : 238.5 / 90 = 2.65 (was 2.6)
2.65

Sets the number of degrees the needle moves for every MPH of speed. This value is to be coordinated with the cockpit speedometer graphic. Theoretically, if you set it to 90 degrees the needle would spin completely around for every 4 MPH of speed you gained (4x90=360). This is one value applies to BOTH the in-truck cockpit speedometer as well as the dashboard overlay seen in the chase cam views. The numbers and graduated lines in the chase view display will rotate and scale in relation to this value. It seems best not to change this at all in order to keep the chase view overlay looking it's best.


; Speedometer face redraw coordinate and size
124,296,19,47

This is an invisible rectangular area that defines any solid texture surfaces "above" the needle, in the stock cockpit this face is a black panel with a switch and lights on it. The first two numbers are x/y coordinates of the upper left corner of the face, the last two numbers are the pixel width and height of the face itself, sized to match any panel floating above the needle. The defined area will be rendered "on top of" the rotating needle in the game. If no such faces are needed you may supply zero values (0,0,0,0).


; Tachometer center
435,307

This sets the center point of the cockpit tachometer needle.The first number is the number of pixels in from the left side of the screen.The second number is the number of pixels down from the top of the screen


; Tachometer radius
24

This defines the radius of the tachometer, presumably in pixels, changing the size of the needle itself. While the needle is the only thing visible on top of the dashboard raw, there is in fact a black square in which the needle floats, which seems to be about five pixels larger than the value you specify. You will need to make your tachometer graphic large enough to accomodate the edges of this black square, lest it overhang the edge of the visible dash instrumentation.


; Tachometer needle model
needle.bin

The "needle.bin" exists in both the cockpit and ui pods, it is a small, strange bin without any raw file assigned to it in the normal fashion. No replacement seems possible.


; Tachometer zero angle (was 157.5)
153.0

The angle at which the tachometer rests at zero RPM. This value is to be coordinated with the tachometer graphic. This is one value that applies to BOTH the in-truck cockpit tachometer as well as the dashboard overlay seen in the chase cam views.


; Tachometer degrees per rpm : 235 / 9000 = 0.0261 (was 0.0257)
0.0261

The number of degrees the needle moves for every RPM. This value is to be coordinated with the tachometer graphic. This is one value that applies to BOTH the in-truck cockpit tachometer as well as the dashboard overlay seen in the chase cam views. Presumably you divide the number of degrees your tachometer graphic spans by 9000. The numbers and graduated lines in the chase view display will rotate and scale in relation to this value. It seems best not to change this at all in order to keep the chase view overlay looking it's best.


; Tachometer face redraw coordinate and size
438,287,12,45

This is an invisible rectangular area that defines any solid texture surfaces "above" the needle, in the stock cockpit this face is a black panel with a switch and lights on it. The first two numbers are x/y coordinates of the upper left corner of the face, the last two numbers are the pixel width and height of the face itself, sized to match any panel floating above the needle. The defined area will be rendered "on top of" the rotating needle in the game.


; Steering wheel coordinate and size
145,330,350,150

The first two numbers are x/y coordinates of upper left corner of the "steering wheel" display. The first number is the number of pixels in from the left side of the screen. The second number is the number of pixels down from the top of the screen. The third and fourth numbers represent the size of the steering wheel raw files (350x150 pixels in the example). If you create custom "steering wheel" graphics you must supply the size here. As for the display coordinates, do NOT position it so that it overlaps the screen edge, as a game crash may result.


; Erase window
174,362,466,480

These numbers are x/y screen coordinates that define the area behind the steering wheel that gets re-drawn as the wheel turns. Without these coordinates the area behind the wheel may not get redrawn properly and will look bad or even cause the same kind effect seen with incomplete backdrops. The first number in the example defines a point 174 pixels in from the left side of the screen and the second number defines a point 362 pixels down from the top of the screen, together these define a single point which is the upper left corner of the "redraw" square. Likewise, the third number defines a point 466 pixels in from the left side of the screen and the second number defines a point 480 pixels down from the top of the screen, together these define a single point which is the lower right corner of the "redraw" square. This area covers the interior portion of the stock steering wheel. Apparently this "erase window" is only needed for the "steering wheel" animation. This window may not be strictly necessary if the raw files contain no obvious animation or transparent sections, in such cases a value of 0,0,0,0 might render it invisible.


; Steering wheel base filename
PW480

The basename of the series of steering wheel raw files. You may use any basename you like and the files may be any size you like, but they must all be the same size. I believe you have to match the number of stock files exactly, and you certainly have to name them using the proper suffix. There must be one center "wheel" (c00), then seven increments to the right (r05 to r35) and seven to the left (l05 to l35), the images are designed to change in five degree increments, from 05 to 35. I do not know if more increments are possible.

The naming scheme:

   "nameC00.raw" (center)

   "nameL05.raw" (left five degrees)
   "nameL10.raw"
   "nameL15.raw"
   "nameL20.raw"
   "nameL25.raw"
   "nameL30.raw"
   "nameL35.raw"

   "nameR05.raw" (right five degrees)
   "nameR10.raw"
   "nameR15.raw"
   "nameR20.raw"
   "nameR25.raw"
   "nameR30.raw"
   "nameR35.raw"

NOTE: all custom steering wheel raw files MUST have custom .aai files generated to match them. (info)

The "steering wheel" is series of raw files in the form of an animation, with or without transparency, that will be an overlay on top of the cockpit background as well as the 3D window. The series of raw files need not be a steering wheel at all, bearing in mind that black areas are transparent, and that the .aai will provide anti-aliased edges if needed, you can make any sort of of screen animation you like, which will change in relation to the angle of the wheel. In such an instance keyboard users are likely to see the center and extreme right and left images most of the time. You could use lights or guages to indicate wheel position, or even flash images or messages on a display screen just for kicks, in tandem with an actual wheel if you like.


; Number of mirrors
1

The number of rear view mirrors. Is more than one possible? I tried to add more but I didn't manage to do it. So, who knows for sure?


; Mirror Location, size
535,120,105,48

The first two numbers are x/y coordinates of upper left corner of the rear view mirror display. The last two numbers are the pixel width and height of the mirror display itself, which can be sized at will. Do not let the mirror overlap the screen edge. If you want your mirror to have a perfectly scaled down ratio of the 640x285 cockpit 3D window just multiply "2.245614" by the height of the window to get the proper width (round the number). If you want your mirror to have a perfectly scaled down ratio of the full screen 640x480 window just multiply "1.333333" by the height of the window to get the proper width (round the number).


; Angles
0,0,32768

I dunno, but I guessed it was the angle of the view, which is pretty well horizontal by default. After guessing that I tried all kinds of values but noticed no changes at all, unless there are magic values to use I would say this doesn't do anything in MTM2. I haven't tested it yet, but I'd bet this does work in MTM1.


; Translation
0,0,0

I dunno, but I guessed this is the 3D x/y/z coordinates of the viewpoint in the mirror. Theoretically, if you translated (or moved) the viewpoint of the mirror you could look at things far away or from a different perspective. For example, if you could translate the view forward you might be able to look at the front of your own truck, or you might even be able to see a blimp cam type view and note truck positions relative to your own (if the angle value up above could be brought into play). After guessing this I tried all kinds of values but noticed no changes at all, unless there are magic values to use I would say this doesn't do anything in MTM2. My second guess is that this is a leftover from MTM1, in which it probably works as described, I know the game itself had arenas with large "live" viewscreens with properties I just described.


; Zoom
49152

I guessed this was the zoom value of the rear view mirror, akin to the "Z-mode" zooming available in GOLD mode. After guessing that I tried all kinds of values but accomplished nothing, unless there are magic numbers to use I have to assume this does nothing at all in MTM2. In fact, in MTM2, the mirror automatically matches the zoom level of the standard view, while in MTM1 the zoom works independent of the mirror, thus I believe this is another remnant from MTM1 that doesn't apply in MTM2.


; Bitmap position and size
532,115,108,56

The first two numbers define the screen position of the upper left corner of the mirror frame raw file. The second two numbers represent the dimensions of the raw file used (108x56 pixels in the example). Do not let it overlap the screen edge.


; Bitmap name
fordm480.raw

The name of the mirror frame raw file, any name may be used and the image can be any size. If you wish to have no frame just use a small pure black raw file, which will be totally transparent and invisible. This part does not use an .aai so try not to use any jagged pixel edges.


; Shifter name
ps480

The base name of the series of six shifter raw files. You may use any basename you like and the files may be any size you like, but they must all be the same size and be named using the proper suffixes of P, N, R, 1, 2 and 3, as follows:

"nameP.raw" (park)
"nameN.raw" (neutral)
"nameR.raw" (reverse)
"name1.raw" (1st gear)
"name2.raw" (2nd gear)
"name3.raw" (3rd gear)

These files do not use an .aai, and like the "steering wheel" the animation can be anything you'd like it to be. The sequence can be placed anywhere on the screen and doesn't require the "erase/redraw" box that the steering wheel does. In use the images will repeatedly flash on screen for a moment or two, depending on the condition of your gears, then change or disappear. Transparency does not work here so whatever you make must be rectangular in nature.


; Shifter position and size
496,272,128,192

The first two numbers define the position of the upper left corner of the shifter raws. The second two numbers represent the dimensions of the raw files used (128x192 pixels in the example).


; Shift light bitmap
pl480.raw

The name of the "on" shifter light raw file, any name may be used. When the RPM reaches a certain speed this shift "light" texture is flashed on the screen automatically. You can make this texture any shape and any size, and place it anywhere you like. This part does not use an .aai so try not to use any jagged pixel edges.


; Shift light position and size
378,261,18,19

The first two numbers define the screen position of the upper left corner of the shifter light raw file. The second two numbers represent the dimensions of the shifter light raw file (18x19 pixels in the example).



Cockpit creation notes:

- If you create a custom cockpit you MUST generate all new .aai files for your new graphics, see the .AAI page for relevant information.

- The "finder", "gauges" and the "erase window" (used for the steering wheel) are all bounded by black squares, these squares define areas of the screen that get re-drawn as the parts move, in order to prevent any visual glitches (tracers). These squares are always rendered below the cockpit textures but are always rendered on top of the 3D and mirror windows, you must therefore plan to cover them effectively with textures where they might overlap those 3D views, being especially mindful of the finder since it cannot be moved.

- The whole cockpit can be thought of as a seven layer construct where each layer is always rendered on top of the previous one. The bottom layer is a black background, the next layer up is the 3D window, the third layer is the mirror window, the fourth one is the "redraw" layer where the black squares lay, the fifth layer is the cockpit panel, the sixth layer is the steering wheel and the seventh and topmost layer is where the finder, shifter and shift light appear (the sixth and seventh layer may well be the same layer).

- The small gear readout near the bottom of the screen is hard coded and virtually unchangable, it is always on top and covers an area of 54x9 pixels. The upper left corner of this static gauge is at coordinate 292,418, while the bottom right corner is at coordinate 346,427. Do not forget this when you design the cockpit.

- The cockpit colors are affected by track palettes, it is therefore best to use as simple a palette as possible. Palettes like "metalcr2", greyscale or mostly greyscale ones will offer the best overall results since textures with these palettes are always track palette friendly. For example, the palette of the stock steering wheel raw files is very nearly perfect greyscale, the stock shifter uses the "metalcr2" palette, which is the default palette for all raw files that do not have an .act palette of their own, and while the cockpit panels use a custom color palette it is mostly greyscale as well.

- Please note that I have not provided files or size information related to the 320x400 and 320x200 screen resolutions. To create a cockpit pod that accomodates those resolutions you will have to determine the file dimensions as well as edit all three powerbig files independently, using the proper screen coordinates and file references. Since virtually everyone uses the 640x480 screen resolution creating complete cockpits for the lesser resolutions may not be worth bothering with.

- There is no reason to name custom cockpit files using stock names, use custom names for all custom parts to avoid conflicts. The "finder" is a different matter however, while it is in cockpit.pod it is not really a cockpit item and it's parts must always be named using the stock filenames in order to effectively replace them.

- When you create a custom cockpit pod you can put only the files you've customized in it or you can include all cockpit files. The first option will force people to mount both your pod and the the stock cockpit.pod, while the second option will eliminate the need for both pods to be mounted.

- The size of the graduated marks and the size of the needle on the chase view gauges are hard coded, so there is little that can be done with those gauge overlays apart from changing fonts in monster.ini, as discussed here: forum.mtm2.com

- I believe the only values in powerbig that apply to the chase view gauges are the "degrees per mph/rpm" and "zero angle" settings, which will change all gauge increments simultaneously.

- The "Instrument Cluster" line in truck (.trk) files calls upon the stock "powerbig" cockpit configuration file, I tried changing this line in a truck file to see if the cockpit could be changed to a custom one on a per-truck basis but it did not work. Therefore it is only possible to have one cockpit in use at a time. All custom cockpits and finders must be mounted above the stock cockpit.pod in the pod.ini in order to work.

- While the 3D window is 285 pixels tall, the maximum "visible height" of the stock dashboard view is 234 pixels, you are therefore advised to display as much height as possible when you center the display in your texture's "window". In a fantasy cockpit the top-of-the-screen slack space could well be a panel unrelated to the scene below it, one that floats above the active game window in the classic video game pattern, as a status window, which can hold the gauges and possibly the mirror, and whatever else you can imagine.