3D Custom Cockpits

Tutorial: www.mtm2.com/~mtmg/repaint/index.shtml
Post Reply
User avatar
Fila
Member
Posts: 2223
Joined: Mon Jul 02, 2001 2:01 pm
Location: Lost in Translation
Contact:

3D Custom Cockpits

Post by Fila »

With the latest game version, the game supports 3D cockpits. The game will come with a default one that every truck will fall back to HOWEVER, one can easily build a custom made 3D Cockpit. The engine handles them, the new .trk files handles them AND BinEdit truck editor also handles them to make the assembly easier.

The easiest way to get around is to start with the default one.

A cockpit is an assembly of different 3D models and the files are found in 3 folders.

My explanation will be based as if you are creating one from scratch in BinEdit.

First up, BinEdit has a new option: New>Cockpit Part. The reason for this is it's going to keep the naming conventions correct + it won't ask you to align the objects vertically when you save them, which can lead to misalignment in the game (some of the objects have to be off center). The important things to note here is that the you want to give the cockpit a name, such as EXAMPLE and then every part of the cockpit will be saved with an underline EXAMPLE_PART.BIN and based on that part is how the game knows what is what. Remember to make sure you keep the same cockpit name.

Once you finish all your models, in the cockpit editor you click on the empty box next to CAB, SPEEDOMETER, TACHOMETER, WHEEL, LEVER, GEAR LAMP etc etc to load the models. Then when you save, the cockpit editor will save an EXAMPLE_CP.CPT layout file. It will also rename the bins with the correct name (all the <stem> names have to match to work correctly) in case the names differ. So you will end up with the following items:

ART folder - this is where your textures go, as normal. Remember, everything here is a normal .bin model so all the normal model rules apply
DATA folder - this is new, this has to be a file that ends with a _CP.CPT extension. This is a regular text file that holds information for all the models that the cockpit is assembled out of and has the 3D world placement of the moving objects (such as the wheel, the shifter and the needles).
MODELS folder - the regular BINS. However, each bin model has to have a specific name:

EXAMPLE_CPL3, 2, 1, N, R, P - these are Cockpit Lights and they are meant for the shifter, highlighting what gear you are in. This one is a little tricky to create in BinEdit. In Blender, once you are done with the cockpit model (which includes the base of the shifter), you make an overlay that is higher by 1 or 2 pixel of the part that you want to light up and save it with the coordinates as they are. The automatic blender converter knows how to export this correctly. Then during the game, based on what gear you are in, that gear lights up.
EXAMPLE_CPLS - this is also a Cockpit Lights and works the same as the above, but it is the light that points out you are in high RPM and you should shift.
EXAMPLE_CPS - this is the shifter model, it is separate from the cockpit because it moves. The cockpit editor allows you to place it around as you see fit and that information is saved into the CPT file
EXAMPLE_CPN1 and CPN2 - these are the two needles for the meters. Placement adjustable in the cockpit editor
EXAMPLE_CPW - this is the wheel - placement adjustable in the cockpit editor
EXAMPLE_CP - the main cockpit model. This is basically the main model that is static. Everything else above is either moveable (needles, wheels, shifter) or lights that come and go

In theory you can edit all of this by hand but the BinEdit Cockpit Editor allows you to visually see the changes in real time.

One thing that is important with this, when you save the files do not vertically align them as BinEdit warns you. Especially for the lights as they are in exact coordinates in order to appear where they should. But if you use the New>Cockpit part it should avoid such issues. Aligning the lamps when you build them from scratch in BinEdit is a bit harder, in Blender you just duplicate the area and move it a pixel or two higher and give it a different texture. That same concept should work in Blender too.


Download template: https://www.mtm2.com/~mtmg/downloads/mt ... ockpit.zip
Companion piece: https://www.mtm2.com/~mtmg/downloads/mt ... 0.21.0.zip <--- this is the blender export plugin that already knows about the cockpits

The above is the current work in progress default 3d cockpit and a perfect starting point to understand how it works. It has both the files needed to load into BinEdit's cockpit editor straight away AND also has the blender file for you to see how it looks. When you assemble a truck, all you need to do is point the .trk file (which BinEdit now supports) to the .cpl and it will load all the different parts correctly.
Post Reply