Car Body Mods: Difference between revisions

From Automation Game Wiki
 
(7 intermediate revisions by the same user not shown)
Line 48: Line 48:
* Use quads as much as possible, as they shade and reflect better than triangles.
* Use quads as much as possible, as they shade and reflect better than triangles.
* The body must be single-sided and must not have backfaces. It is made double-sided by materials in UE4.
* The body must be single-sided and must not have backfaces. It is made double-sided by materials in UE4.
<gallery>
<gallery mode="nolines" widths="300" heights="240">
File:NewCarTopView.jpg
File:NewCarTopView.jpg
File:NewCarSideView.jpg
File:NewCarSideView.jpg
Line 467: Line 467:


Next we need to orient the unwrap so that the centre of the car in the UV sits on the centre-line of the Y axis, and scale the unwrap up so that it covers as much of the UV space as possible:
Next we need to orient the unwrap so that the centre of the car in the UV sits on the centre-line of the Y axis, and scale the unwrap up so that it covers as much of the UV space as possible:
[[File:Car_unwrap_step_2.png|alt=|none|thumb|360x360px|It is ''vital'' that the top and bottom halves of the unwrap here are perfectly symmetrical, and that the centre line of the car is perfectly straight along the middle.]]


[[File:Car_unwrap_step_2.png|alt=|frameless|360x360px]]
* Make sure this unwrap exists on both the first ''and'' second UV channels. The first channel will be used to calculate the normals, and the second channel will be used to calculate the fixture cutouts.
* Make sure this unwrap exists on both the first ''and'' second UV channels. The first channel will be used to calculate the normals, and the second channel will be used to calculate the fixture cutouts.
* make sure the car's center line is exactly in the middle of the UV layout.
* make sure the car's center line is exactly in the middle of the UV layout.
Line 479: Line 479:
# If you've already unwrapped your mesh without mirroring the UV maps via modifier setitngs, select the mirrored half, and flip the UV of that half along the Y axis:
# If you've already unwrapped your mesh without mirroring the UV maps via modifier setitngs, select the mirrored half, and flip the UV of that half along the Y axis:
# Duplicate the bones for the wheel flares on the opposite side, matching the distance from the centreline.  Set the name of the mirrored half to the same as the un-mirrored half with "_opposite" at the end of the name of the bone.  Duplicate the bone weighting from the non-mirrored half, rename it to match the mirrored bone, and clear the weighting for each on the opposing side so that the weighting for each wheel flare only includes the respective wheel:
# Duplicate the bones for the wheel flares on the opposite side, matching the distance from the centreline.  Set the name of the mirrored half to the same as the un-mirrored half with "_opposite" at the end of the name of the bone.  Duplicate the bone weighting from the non-mirrored half, rename it to match the mirrored bone, and clear the weighting for each on the opposing side so that the weighting for each wheel flare only includes the respective wheel:
[[File:Flip UVs part 1.png|thumb|alt=|A mirrored mesh before mirroring the unwrap.|300x300px|none]][[File:Flip uv part 2.png|thumb|alt=|A mirrored mesh after mirroring the unwrap.|300x300px|none]]
[[File:Flip_UVs_part_1.png|alt=|frameless|300x300px]]
 
[[File:Flip_uv_part_2.png|alt=|frameless|300x300px]]


[[File:Mirror_weighting.png|frameless|240x240px]]
[[File:Mirror_weighting.png|frameless|240x240px]]
Line 554: Line 556:


3: Make sure your export settings look like this image:
3: Make sure your export settings look like this image:
[[File:3dsmax_exportsettings_01.gif|alt=|none|thumb|374x374px|Occasionally, you may get warnings on exporting the .FBX that the matrials are not compatible with the chosen format and objects may appear grey.  This warning can be ignored, as we use our own materials.]]
 
[[File:3dsmax_exportsettings_01.gif|alt=|frameless|374x374px]]


=== In Blender ===
=== In Blender ===

Latest revision as of 16:38, 19 January 2023

Overview

A car body is a collection of files, of which a Body Variant Preview Data file is the parent.

The Body Variant Preview Data contains the settings and applicable options for the car body, as well as a reference to the car body mesh.

The car body mesh itself is a skeletal mesh in UE4, which is set up in a specific way. The mesh needs a set of placeholder materials assigned to it, as well as needing a certain orientation and size and specific UV layouts, along with highly specialised modelling and rigging.

Workflow

  1. In a 3D modelling package:
    1. Create a car body mesh.
    2. Set up the skinning/rigging and morph targets.
    3. Create the UV maps.
  2. In UE4:
    1. Set up a mod.
    2. Import the car body to the mod folder.
    3. Ensure that the placeholder materials are properly assigned to the body.
    4. Create and fill out a body variant preview file.
    5. Generate the car thumbnail and preview info.
    6. Cook the mod.
  3. In the Automation Workshop Publishing Tool:
    1. Set up a workshop item.
    2. Share your mod.

Creating the Car Body Mesh

Overview

Prior experience with modelling (particularly with subdivision surfaces) is required to make good Automation car bodies. Should you lack said experience, the links below are some good places to start:

Automation car bodies in particular should be created as a half, and then mirrored at or near completion to ensure symmetry and minimise the amount of work required to tweak them. Which half of a body you decide to model is irrelevant.

For an overview of how a vanilla body is modelled, Hard Rooster has made a video series covering the modelling of a body from start to finish in Blender.

Notes

  • UE4's units are in centimetres. For example, 100 units in UE4 are equivalent to 1 metre.
  • A finished car body mesh is made of between 7,000 and 30,000 triangles (though a common upper limit is 15,000 triangles).
    • This varies depending on things like the curvature of the body (compare a 1980s van to a 1950s sports car, for example), morphs that may require special topology, and the size of the body (as insufficient triangle density on a larger body may result in fixture tearing).
  • Panel gaps (including door seams) are modelled into the car.
    • A transparent mesh is often added over the panel seam to make fixtures conform more smoothly.
  • The entire car should be one object/element.
  • The body must not contain integrated mirrors, grilles, lights, badges, vents, door handles, aerials, fuel caps etc. Those should be made separately as fixtures.
    • An exception may be made for sculpted vents (without the actual vent area, such as those on the LD Dodge Charger) or character lines, if they can be morphed flat and/or don't interfere with the versatility of the body.
  • Use quads as much as possible, as they shade and reflect better than triangles.
  • The body must be single-sided and must not have backfaces. It is made double-sided by materials in UE4.


Coordinates

  • The front of the car body should face towards the negative Y (front to back) axis.
  • the center of the body should be roughly at 0 on the Y axis, and exactly 0 on the X axis.
  • The bottom edge of the car should roughly sit at 0 on the Z axis, with the top facing towards positive Z (ie: it should not be upside-down).
    • Remember that the Y axis in 3ds Max and Blender runs forwards and backwards, whereas the Z axis runs up and down. This may not be consistent across all 3D packages.
  • All vertices at the centre of the car (where it's cut in half) should be exactly at 0 on the X (left to right) axis.

Applying Materials

Automation uses a set of placeholder materials applied to the mesh to define different paintable parts of the car.

Only one of each material is supported.

  • If you need more materials to assign, consider adjusting your mesh, because there are no more materials to assign than those listed here, and you can only have one of each. 😉
  • These will be replaced with the correct materials (if you've assigned the material slots correctly), informing the game what various areas of the car are used for, and what materials they require.
  • These materials are colour-coded to represent the different areas of the car, and are replaced with the proper in-game materials dynamically. Make sure to assign these placeholders correctly!

List of car body materials

The following materials are used on car bodies:

Material Name Area Used Paint Category Colourable Location in UE4 Notes
Bonnet The bonnet Body Yes Content/Cars/Meshes/Bodies/Bonnet General paintable material. Has its own visibility toggle in-game.
BonnetCam Above the bonnet; determines the default location of the bonnet camera N/A No Content/Cars/Meshes/Bodies/BonnetCam This material is invisible in-game and has no effect on aesthetics.

for the Exporter, the bounding box origin of the geometry which uses this material defines where the bonnet camera will be.

Bumper_Front The front bumper Body Yes Content/Cars/Meshes/Bodies/Bumper_Front Prior to the Light Campaign 4.2 update, front and rear bumpers could not be painted separately.
Bumper_Rear The rear bumper Body Yes Content/Cars/Meshes/Bodies/Bumper_Rear Prior to the Light Campaign 4.2 update, front and rear bumpers could not be painted separately.
CabinBounds Deprecated N/A No Content/Cars/Meshes/Bodies/CabinBounds Since bounding boxes for car calculations are now done dynamically since the Light Campaign 4.2 update, this material is listed for legacy purposes only.

(This material was previously used to determine cabin size.)

CargoBounds Deprecated N/A No Content/Cars/Meshes/Bodies/CargoBounds Since bounding boxes for car calculations are now done dynamically since the Light Campaign 4.2 update, this material is listed for legacy purposes only.

(This material was previously used to determine trunk size, as well as front trunk size for mid- and rear-engine-only bodies.)

Car_Roof (formerly Soft_Top) General car roof slot Body Yes Content/Cars/Meshes/Bodies/Car_Roof General paintable material. Was previously exclusive to softtop convertibles until the Light Campaign 4.2 update.
Chrome Areas that must remain chrome N/A No Content/Cars/Meshes/Bodies/ChromeBUS For parts of the car that should always be chrome, use this material.

This material cannot be changed in-game.

DriverCam Inside the cabin; determines the default location of the driver camera(s) N/A No Content/Cars/Meshes/Bodies/DriverCam This material is invisible in-game and has no effect on aesthetics.

For the Exporter, the bounding box origin of the geometry which uses this material defines where the driver camera will be.

Optionally, this material can be split across boxes on either side of the car, allowing for different left- and right-hand driver positions.

For the BeamNG exporter, this position is then raycast forward, with any resulting collision with a vertex or face becoming the driver camera position. Effectively, this means the default driver camera position is just in front of the windshield, but aligned with the bounding box origin on the X and Z axes.

FrontBounds Deprecated N/A No Content/Cars/Meshes/Bodies/FrontBounds Since bounding boxes for car calculations are now done dynamically since the Light Campaign 4.2 update, this material is listed for legacy purposes only.

(This material was previously used to determine front trunk volume in rear-engined cars with a front engine option.)

LipPlacement Around undertray, over panel gaps, and over wheel wells N/A No Content/Cars/Meshes/Bodies/LipPlacement Used to cover panel gaps, wheel wells, and undertrays so that fixtures can conform to them.

This material is invisible in-game.

LowerBounds Deprecated N/A No Content/Cars/Meshes/Bodies/LowerBounds Since bounding boxes for car calculations are now done dynamically since the Light Campaign 4.2 update, this material is listed for legacy purposes only.

(This material was previously used to determine a car's engine bay size and general weight.)

Paint The primary paint colour Body Yes Content/Cars/Meshes/Bodies/Paint General paintable material.
Paint_Two_Tone The secondary paint colour Body Yes Content/Cars/Meshes/Bodies/Paint_Two_Tone General paintable material.
Paint_Misc_1 Misc. paint Body Yes Content/Cars/Meshes/Bodies/Paint_Misc_1 General paintable material.
Paint_Misc_2 Misc. paint Body Yes Content/Cars/Meshes/Bodies/Paint_Misc_2 General paintable material.
Paint_Misc_3 Misc. paint Body Yes Content/Cars/Meshes/Bodies/Paint_Misc_3 General paintable material.
Trim The general trim Trim Yes Content/Cars/Meshes/Bodies/Trim General paintable material.
Trim_Misc_1 Misc. trim Trim Yes Content/Cars/Meshes/Bodies/Trim_Misc_1 General paintable material.
Trim_Misc_2 Misc. trim Trim Yes Content/Cars/Meshes/Bodies/Trim_Misc_2 General paintable material.
Trim_Misc_3 Misc. trim Trim Yes Content/Cars/Meshes/Bodies/Trim_Misc_3 General paintable material.
Plastic Underbody Trim Yes Content/Cars/Meshes/Bodies/Plastic Used for underbodies and wheel wells.
Reflective_Mirror Deprecated N/A No Content/Cars/Meshes/Bodies/Reflective_Mirror Used for reflective mirror glass, back when mirrors were modelled into car bodies.
Steel Areas that must remain steel N/A No Content/Cars/Meshes/Bodies/Steel For parts of the car that should always be steel, use this material.

This material cannot be changed in-game.

Tray The bed of a pickup truck or ute Body Yes Content/Cars/Meshes/Bodies/Tray Fixtures cannot be placed on this material.
Window_Pillar The pillar trim Trim Yes Content/Cars/Meshes/Bodies/Window_Pillar General paintable material.
Window_Trim The window trim Trim Yes Content/Cars/Meshes/Bodies/Window_Trim General paintable material.
Windows The car's windows Body Yes Content/Cars/Meshes/Bodies/Windows General paintable material.

Using the default Adjustable Window material, window transparency can be adjusted in-game.

Wing_Mirror_Trim Deprecated Trim Yes Content/Cars/Meshes/Bodies/Wing_Mirror_Trim


Used for mirror trim, back when mirrors were modelled into car bodies.

This material is listed for legacy purposes only.

Creating Body Morphs

Automation car bodies support both morph targets (shape keys), and skinning (rigging) for morphing parts of a car body. You can mix and match as many of each as you want, but be careful with overlapping morphs.

In-game, the morph which is selected is defined as the morph with the highest weight of the selected face/vertex.

  • Morph targets are treated as having a maximum skin weight of 0.3 for the vertices that move the most, and multiply down to 0 for vertices that the morph doesn't move at all.
    • For instance, a morph target which tilts the window pillar forward or backward would have a maximum weight of 0.3 at the top, and 0 at the bottom, with the vertex weighting blending down through the vertices like a gradient.
  • Skin weights should be weighted roughly similarly to morph targets, so the maximum weight of a skin morph should be about 0.3.
    • You can go as high as 1 if you are not using morph targets, or if your morph targets do not overlap a particular area of skin weights.
    • Skin weights should be defined in 8-bit intervals only. UE4's skeletal meshes only support 8-bit weights, so having your skin use values as a multiple of 1/256 is important. As a rough estimate, values that are a multiple of 0.004 work fine, but be aware that values of less than 0.012 may be ignored.

Creating morphs with skinning

Skinning is the main system used to allow the player to drag around and deform a car body in Automation. It's done via weighting specific vertices to various "bones" that are a representation of what the player is dragging in-game when deforming the body.

It's also probably the single most confusing step of car creation in Automation, as it's done in a way that doesn't have a great deal in common with any other widely used game art process. It uses the same tools as skinning a character in a 3D modelling application, so referring to some character skinning tutorials may give you useful insights into the tools used, but the way Automation uses it is quite unique.

Basic skinning overview

In Automation, bones are used to define which part of the morph moves, but are non-hierarchical. The bones float in space around the car without any connection to each other, with only a Root bone as their parent.

  • Every vertex on a skinned model has a skin weight to at least one bone, and at most four bones.
    • This weighting will be a number between 0 and 1, defining how much a vertex follows the movement of a bone.
    • The weighting is an 8-bit bit value, ie; all values are rounded to the nearest 1/256th
    • For vertices that do not use a bone and instead are morphed with morph targets, they must still be weighted to the Root bone. all vertices must have a weight, and all weights must add up to 1.
    • for vertices with weights that add up to above 1, you will get errors. do not do this. all weights must add up to 1.
    • All vertices must have a weight, and all weights must add up to 1.
  • When you morph the car in-game, your mouse movements move the bone, and the vertices follow the bone.

Setting up bones for morphs

Bones should float freely around the area which they will deform. All bones should be parented to the origin of the car called Bone Root. The naming and hierarchy is important.

It is a requirement for the root bone to be named Bone Root; otherwise, the body will not work correctly!

The morphs you create are up to you, and vary depending on the shape of the car and which parts can be deformed attractively, but almost every car will have bones for:

  • Front and rear wheel arch flares
  • Windscreen rake angle
  • Rear window rake angle
  • Boot/rear length or angle
  • Front and rear bumper length (or front and rear overhang in general)

There is no real limit to how many bones you can have, but each vertex should only be skinned to 4 different bones before issues occur (i.e. vertices may not move how they should), and it can be very difficult in-game to select and deform an area that's skinned to more than 2 bones. This is because in-game, when you hover over the car, the bone weighted the most to the vertex under your cursor is the bone that you will be moving.

Bones should be created floating near the part of the car they deform. Their location isn't really important to how they function in-game, but having them placed correctly makes it much easier to understand what each bone is for adjusting their limits in later stages of the modding process. Also, a morph will not work if its bone's origin is off-screen while trying to move the morph in-game. Try to keep the bones relatively close to the areas they're morphing.

Note that if you are using the 3ds Max script, you do not need to create bones for anything on the opposite side of the car (e.g wheel arches on the other side), as they will automatically be mirrored when you mirror the car body. If you are not using the script, or you are using Maya or Blender, all bones that should mirror their actions on the other side of the car (such as wheel arches) should have the correct naming nomenclature so they work correctly in-game. The following suffixes work for mirrored bones in Automation:

  • <Name>_opposite
  • <Name>_R
  • <Name>_L
  • L.<Name>
  • R.<Name>

In this case, <Name> is the name of the bone/morph.

BoneLayout2.jpg

ArmatureNaming 01.gif

Adding bones in 3ds Max

Adding bones in Blender

Weighting the skin

Now comes the complex bit. Weighting skins is a difficult and creative process that's almost like remodeling the car into different shapes, but with only skin weights to do it with. Wheel arches are often the easiest place to start on a new model, and a good way to start is to move a bone a reasonably large distance in the direction you want it to move (say, 25 to 50 cm) and then start weighting to that bone's new position.

  • Remember that the higher you set the weight, the farther that area will move with mouse input, and the less weight will be available to assign to other bones. This isn't too important on wheel arches, but can be an issue on other parts of the car which may share more bones.
  • all weights on a vertex need to add up to 1, and if the current bone is the only bone assigned to that vertex, it can't have a weight less than 1. By adding the root bone as a second bone, you can now adjust the weight of the bone you want, and the bone root will take the remaining weight.
  • Bones in Blender affect vertex groups of their same name. To skin a mesh, you assign vertices of that mesh to the vertex group (of the same name as the bone you want them to be affected by), and then adjust the weight of that vertex (as a value from 0 to 1) to that vertex group.
  • Keep in mind that Unreal Engine rounds bone weights to the nearest 1/256 (with intervals of roughly 0.004). This minimum weight interval isn't 100% reliable in some cases—instead, a minimum of 0.008, 0.012, or 0.016 may be used.
  • You may also use weight painting as per Hard Rooster's video tutorial series, which requires more setup but is generally faster and more convenient.

Effectively, what you're doing here is using weighting to remodel the car into the shape you want it to be at the furthest extremes of bone movement. If you can make it the correct shape with the bone moved to its maximum position and with the bone back in its normal position, everything in between should take care of itself, and any bone position in between should look good too.

MoveBone2.gif

Windscreens are also a good place to learn to skin, as you can basically move the windscreen bone forwards, and then try your best to use skin weights to make an almost vertical windscreen. If you can get that working correctly, then you should have a bone that lets you smoothly change the angle of the windscreen.

MoveWindscreenBone2.gif

Creating morphs with morph targets

For Automation, we support using morph targets and shape keys for morphing a car body. This is done by storing a default value (the base car) and a morph to morph to (the morph target/shape key), and interpolating between those two shapes for every morph. The game supports morph values between 0 and 1 only. This is why skinning is better for the corners of a car body, because that allows for a full two (or even three) dimensions of movement for every morph, and in both directions. It is up to you to decide which method you would prefer to use. Morph targets are generally easier to set up.

In Blender

You can now edit the mesh to be in the new position you want it to be in for that morph.

Repeat for as many morphs as you would like, taking into consideration that every vertex that each morph affects will add to the total polygon count for that body. If you have too many morphs on a body with too many polygons, the game will take longer to load fixtures onto it!

In 3ds Max

We do not recommend this, but you can do it if you really want to.

  1. Duplicate your mesh.
  2. Adjust your mesh, without adding or removing any polygons, to create your morph target.
  3. Create a Morpher modifier, and put it above the Edit Poly modifier, and below the Skin modifier (if you're using one).
  4. Pick the duplicate mesh as one of the morphs.
  5. Repeat for all morphs.
  6. Yes, it's that tedious. We hate 3ds Max.

Morphing tips

  • Look carefully for any strange deformations in panels when moving your bones. It's very important that panels remain as smooth as possible when deforming, as reflections will very obviously show any kinks. The above example of the windscreen is a great example of a morph that deforms the overall shape of the body too much (look at how the top of the windshield becomes a curve and then eventually a kink—this is bad).
  • Test out what happens if you move two nearby bones at the same time. Sometimes, two bones' movement combined can cause strange polygon overlaps, though this can often be avoided with careful skinning and a smooth falloff of weights between the two bones.
  • Don't try and make too many different skinned areas. 10 or 12 is a sensible maximum, and try and avoid more than one bone affecting the exact same area (some overlap is okay though), as this may make them hard to select in-game.
  • Sometimes you'll have to make changes to the mesh to make your car deform nicely in an area. Poly flow is very important for good deformation.
  • Don't forget that any weighting you give a vertex to a bone will be taken from another bone to keep a total weight of 1. This can get very confusing and cause you to chase your own tail a bit. You have been warned! This isn't so much an issue in Blender (since vertex groups can be locked), but in 3ds Max, ohhhh boy I almost tore my hair out on more than one occasion.

UV Unwrapping

If you're planning to do a pelt unwrap as described here, please swap this unwrap step with the mirroring step, and perform your mesh mirroring first. If you plan to use the 3ds Max script for unwrapping, please perform this step first and then move on to mirroring.

Unwrapping fundamentals

UV unwrapping is the process of unfolding the mesh onto a flat 2d plane which describes which part of a texture is applied to which part of a mesh. Think of it like taking a completed papercraft model of a car and unfolding it back to a flat sheet. In most games, UV mapping is important for how the actual visible textures on objects appear, but in Automation, it's mostly important for how the fixture system works. When you place certain fixtures (such as lights, a grille, or door handles) onto the car, it projects a fixture-shaped hole onto the alpha (transparency) channel of the car body.

For the holes to be projected correctly, you must unwrap the car as one complete piece, without any separate islands of polygons. Otherwise, fixtures can project across multiple parts of the car and give you holes in unwanted places. The UV unwrap must also give a fairly even amount of texture space to each area of the car, as any low-resolution areas will cause jagged holes around the outside of fixtures; this is called "tearing".

It is for all of these reasons that the unwrap of a car mod has to be what's called a "pelt" unwrap (named for its resemblance to a flat animal pelt). For Automation cars, it looks like this:

Unwrapping a car with a pelt unwrap

Make sure your car is one element

This part is important, as it defines how the pelt unwrap works, which in turn determines how the fixture system cuts holes in the car. If parts of the car are not connected in both the 3D viewport and the UV viewport, the fixture will cut out an incorrect hole.

Any lip placement areas must be properly unwrapped despite the material being invisible; otherwise, tearing across the body can occur.

to see if your mesh is one element:

In 3ds Max, enter the Edit Poly modifier and click Element mode. Select one face of the car, and hide unselected faces.

In Blender, select one face of the car and press Ctrl+L to select linked faces, and Shift+H to hide unselected faces.

Doing the pelt unwrap

However it's done in your choice of 3D application, perform a pelt unwrap on your car. In Blender, it looks like this:

Pelt unwrap step 1.png

Next we need to orient the unwrap so that the centre of the car in the UV sits on the centre-line of the Y axis, and scale the unwrap up so that it covers as much of the UV space as possible:

  • Make sure this unwrap exists on both the first and second UV channels. The first channel will be used to calculate the normals, and the second channel will be used to calculate the fixture cutouts.
  • make sure the car's center line is exactly in the middle of the UV layout.
  • make sure that the top and bottom halves of the car are perfectly symmetrical.

Mirror the Half Body

The traditional method

  1. Mirror your mesh.
  2. If you've already unwrapped your mesh without mirroring the UV maps via modifier setitngs, select the mirrored half, and flip the UV of that half along the Y axis:
  3. Duplicate the bones for the wheel flares on the opposite side, matching the distance from the centreline. Set the name of the mirrored half to the same as the un-mirrored half with "_opposite" at the end of the name of the bone. Duplicate the bone weighting from the non-mirrored half, rename it to match the mirrored bone, and clear the weighting for each on the opposing side so that the weighting for each wheel flare only includes the respective wheel:

Mirror weighting.png

Mirror weights values.png

Mirror weights 2.png

Fix Everything You Just Broke Mirroring the Body

Ensure other bones do not have opposite bones when not required

In some cases, your body may have bones that are purposely designed to morph vertices on the outside of the body that are not intended to move along the X axis (e.g. The "Hofmeister kink" found on the 10sSedan02 series of bodies). The mirror script may create an unwanted opposite bone for these.

This can be avoided by temporarily weighting a vertex on the zero X axis to the bone in question. Ideally, pick a vertex that is weighted only to the root bone so as not disturb the weights of other bones. Once the mirror script has been run, you can remove the temporary weight applied to that vertex.

Check that both halves of the body are welded together

The mirror body script should weld both halves of your body together, but for reasons (3ds Max is spaghetti), this does not always occur. This can be seen by your body having an unexpected crease or seam down the centre.

Once you have welded the two halves together, perform a visual check to ensure that no unintentional welds have taken place. e.g. top and bottom vertices on a window frames. If this happens, undo your weld command and select the centreline vertices in smaller chunks, and avoid selecting the vertices in question at the same time.

Check skin for distortion along the centreline vertices

When two skinned vertices are welded together, either automatically via the script or manually, 3ds Max will attempt to combine the weights of both the old vertices into one. Unfortunately, it's not very good at it, and many of the welded vertices on the centreline end up with odd weights. This results in a distorted skin (see below). This isn't an issue with Blender.

Distorted Skin.png

To correct the distortion, you will need to check and correct the centreline vertices. The most methodical way is to start from one end of the body and work your way to the other end as follows:

  1. Expand the skin modifier and select Envelope.
  2. Open the weight table and set to selected vertices.
  3. Select the central 3 vertices at one end of the body and view the weight values in the table.
  4. Where the mesh is distorted, you will usually see one vertex in the weight table that's the odd one out.
  5. Amend the values of this vertex to match those on either side of it. (For vertices with more than 2 bones, you may need to untick normalize to stop Max from altering your amendments—remember to re-enable it once completed).
  6. Repeat the above steps, working along the body until you reach the other end.

Check that the same UV maps exist on the first two UV channels

In 3ds Max

To Check the maps:

  1. Under the utilities tab click on the More... button.
  2. Select "Channel Info" from the list and click OK.
  3. Click the newly available Channel Info Button and review the channel info.

Channel inf.png

The bottom 3 lines of the above screenshot represent the 3 UVW maps. In this case, the maps are identical, as they should be. If, however, there is a mismatch between the three maps (from either null data or different numbers of vertices), they will need to be be corrected. If your body does not have 3 maps, see here.

In most cases, 1:map is the correct one. One method of correcting the maps is as follows:

  1. In the Channel Info box, select the line representing the correct map.
  2. Select Copy.
  3. Select one of the incorrect lines.
  4. Select Paste.
  5. Repeat for the other map if it's also incorrect.
  6. Close the channel info box and click on the modifier stack tab.
  7. Move the UVW Mapping Paste modifier(s) to between the skin and the mesh.
  8. Collapse the modifiers into the mesh.

In Blender

Open the Object Data menu and select the UV Maps submenu. Open a UV editor and check that the UVs look correct in the first two UV channels.

Uvs still there.png

If one of these is not correct, delete it and simply duplicate the correct one.

Export Car Body to .FBX File

In 3ds Max

This step is easy!

1: Select the car body mesh, then go to File > Export > Export Selected

2: Save the FBX file somewhere. It won't actually be distributed with the mod when complete, but name it well, and put it somewhere in a properly named folder, where it'll never need to be moved or renamed. If you move it, UE4 will get confused if you try and reimport it, which you'll need to do if everything isn't perfect, and nothing is ever perfect.

3: Make sure your export settings look like this image:

In Blender

  1. Select the armature, and then the mesh, and then go to File > Export > FBX.
  2. Save the FBX file somewhere. It won't actually be distributed with the mod when complete, but name it well, and put it somewhere in a properly named folder, where it'll never need to be moved or renamed. If you move it, UE4 will get confused if you try and reimport it, which you'll need to do if everything isn't perfect, and nothing is ever perfect. Make sure your export settings match like so:

The animation tab doesn't matter, as we don't use animations.

You are now ready to import your body to Unreal Engine!

Import Car Body to Unreal Engine

Now it's time to bring all your hard work into Unreal Engine.

Follow the Modding page for installing and opening the Automation Modding SDK.

If you've never used Unreal Engine before, now is a great time to watch this introduction to UE4 playlist from Epic. It's for a fairly old version, but most of it still applies.

Creating your Car Body Mod

Press the Create Mod button in the top bar of the UE4 Editor.

UE4ModCreation 01.gif

Select the Blank Project, and fill the wizard out with all of your details, such as your name and a short description of the mod you're making. Then, click Create Mod to generate your plugin files.

UE4ModCreation 02.gif

The Content Browser window should now show your plugin content. This is where you'll put all of your mod files. Never modify any files outside of your plugin folder. you can copy materials and such from the main content folder, but only if those files are copied to your mod folder. The end result of your mod should be a default content folder that is identical to the default state of the SDK, and all of your own modified files within the one plugin folder you want to release. Do not edit or modify files within the root content folder, and do not reference any files within any other mod folder.

UE4ModCreation 03.gif

You should now have an empty content folder:

UE4ModCreation 04.gif

Importing your car body to the mod folder

Press the Import button in the Content Browser with your mod content folder selected to import your car body FBX file.

UE4ModCreation 05.gif

In the following pop-up import options, make sure the following settings are exactly as described:

UE4ModCreation 06.gif

  1. Skeletal Mesh should be set to True
  2. Import Mesh should be set to True
  3. Skeleton should be set to None
  4. Import Meshes in Bone Hierarchy should be set to False
  5. Import Morph Targets should be set to True
  6. Normal Import Method should be set to Import Normals and Tangents
  7. Material Search Location should be set to All Assets
  8. Material Import Method should be set to Do Not Create Material

Once you have configured the import dialog correctly, press Import, or if you are importing multiple car bodies, press Import All.

You should now have a Skeletal Mesh (pink icon), a Physics Asset (yellow/brownish icon), and a Skeleton (light blue icon) in your mod content folder:

UE4ModCreation 07.gif

Check the Materials

The materials applied to the car body denote what part of the car that is. They aren't so much placeholder materials as they are identifier materials; the materials that are applied to the car determine the category of paint on that material slot in-game.

Double click on the Skeletal Mesh for your car. You should then see a screen like this:

UE4ModCreation 09.gif

If instead, when you import a car, you see something more like this, then you will have to apply your materials manually:

UE4ModCreation 08.gif

The materials to apply to the correct slots on your car body are located in Content/Cars/Meshes/Bodies.

Descriptions of the materials to apply are found in the Car Body Material Options step.

Set Car & Chassis Data

Create car body variant data

This is the file that will contain all the stats about your car; how many seats it can hold, how many doors it has, what the wheelbase is, etc..

Create a Body Variant Preview Data object in your mod folder from the Add New menu.

UE4ModCreation 11.gif

Name your Body Variant Preview Data file correctly. The name of this file will determine the name of the body in-game.

UE4ModCreation 12.gif

Open the Body Variant Preview Data file. In the top field, drag and drop, or use the arrow button, to put your skeletal mesh file into the Skeletal Mesh data field.

UE4ModCreation 19.gif

The data inside the Body Variant Preview Data file determines the stats of your car design.

The data is set within the file, but updates in real-time in the body edit scene, which you should open first.

Opening the body edit scene and loading your car will help you visualise what all the data in this file translates to in-game.

Loading a Car For Editing

Open the ThumbnailGeneratorLevel_Car level.

ModTools ThumbnailLevelCar.jpg

On the top bar, select the drop-down menu next to the Play button, and select Simulate.

UE4ModCreation 15.gif

This will start simulating the "game" (in this case, the thumbnail generator level). It is important that everything you do in this level is done while you are simulating the level.

In the World Outliner, search for the BodyEditSceneBluetility. This utility will be the interface between the level, which will have your car loaded in it, and your Car Body Variant file.

UE4ModCreation 14.gif

In the Details panel of the BodyEditSceneBluetility, you will find buttons and options for loading your car body.

UE4ModCreation 16.gif

The Load Body and Unload Body menu options will do just that—load and unload your body—but you have to specify the body you want to load first, which is done in the Variant Asset menu.

Select your Body Variant file from the content browser, and put it in the Variant Asset list by either dragging and dropping it in to the icon, or by pressing the arrow button next to the icon.

UE4ModCreation 17.gif

Press Load Body, making sure that you are Simulating.

UE4ModCreation 18.gif

You should now see your car loaded into the scene. You can begin to edit the data within the Body Variant file and see it update in real time in the scene, which is really helpful for setting chassis data.

Annotation 2020-03-16 171445.png

What all the Body Variant settings mean

Mesh

  • Skeletal Mesh is the physical mesh of your body.
  • Car Material Settings are the default materials that should be applied to certain slots when a player loads it in-game. For instance, you may find it useful to set the window trim on an older body to chrome by default.
  • Mesh Data is a generated file that you dont need to worry about. We'll make one of these in the thumbnail generation stage.
  • Bone Constraints are the physical limits of where bone morphs can be affected. This is an advanced menu for if you want to enter these manually. For most poeple, we have an easy system for assigning these bone limits in the bone limit setting stage. If a bone does not have limits, the player will be able to drag the bones around in any direction they want, as far as they want, and this almost never ends well. Note that morph targets don't need to have their limits set.

UID

  • Family GUID is an unique identifier that is shared between all variants of the same body family. If you are making more than one car body in the same family, they should all share the same family GUID.
  • Variant GUID is an unique identifier that is unique for this body. Every body in Automation needs to have an unique GUID. If you, by chance, happen to generate or use the same Variant GUID as another body, when you try and select one the game may instead chose the other for you. If this happens, generate a new Variant GUID.

Preview

  • You shouldn't have to set anything here. These fields will be populated in the thumbnail generation stage.

Settings

  • Variant Body Type determines the category of the body in-game. Different categories have different advantages and disadvantages.
  • Year is the year that this body unlocks in Campaign. Bodies that are closer to the current year (and thus more recent) score better in some categories, but having a body unlock the same year as its real-life inspiration or counterpart is ill-advised due to the time it takes to engineer cars in the campaign. Generally, Automation bodies are 3 to 10 years older than the cars they're based on.
  • Doors determines the number of doors on this body, which affects some demographics' statistics.
  • Maximum Seat Rows is a legacy value that determines the maximum number of seat rows your body can have (which affects some demographics' statistics). This value has been superseded by the Seats section below, which allows different maximum seat row values for different engine placements.
  • Is Release Ready is a dev feature we use to allow us to configure and adjust bodies that are not ready to be in-game. If this box is unticked, you will not be able to see it in-game.
  • Seat Options is a legacy option that is no longer used.
  • Front Suspension To Disable will disable those suspension options for this body. This is useful if your body is shaped such that certain suspension types clip through the body in a way that cannot be fixed with height offsets.
  • Rear Suspension To Disable will disable those suspension options for this body. This is useful if your body is shaped such that certain suspension types clip through the body in a way that cannot be fixed with height offsets.
  • Chassis Type sets the body to the selected chassis for thumbnail purposes and has no effect in-game.
  • Is Softtop Convert will set this body as a convertible with a soft top. This is for demographic calculations.
  • Is Hardtop Convert will set this body as a convertible with a hard top. This is for demographic calculations.
  • Cargo Subtracts will subtract the cargo volume from the cabin space in vehicles with a shared passenger and cargo area (wagons, MPVs, and such). This is useful for making cars where the more seat rows a body has, the less cargo space it has.
  • The Seats section determines the maximum seat rows per applicable engine placement. For engine placements that aren't supported by the body as per the Engine Placement array below, their maximum seat values can be left as "None".

Engine

  • Engine Placement is an array containing all the available engine positions for this body.

Chassis

Footprint
  • Wheelbase is the wheelbase of the body in centimetres. Set this before setting anything else for best results.
  • Track Width is supposedly track width in centimetres, but isn't actually measured accurately. Don't try and match it to real figures; just make sure the wheels are correctly positioned (with the correct tyres) and that there is enough room left in the wheel arches to make the tyres as wide as makes sense for the car (which might include having to use arch flare morphs). If you need room for wider tyres, set this a little narrower.
  • Pan Width determines how wide the floor of the chassis is. This value must be set larger than the track width for it to have an effect.
  • Y Offset is used to shuffle the mesh back and forwards to sit correctly in the middle of the chassis. If you're putting big numbers in here (more than 15, perhaps), you probably need to realign your mesh on the Y axis.
  • Arch Width [missing info]
Vertical Position
  • Default Suspension Height is used to set the default position of the ride height slider. Makes sure that supercars start off set low, SUVs start high, etc.
  • Height Offset moves the car model up and down as compared to the chassis/wheels etc. This should usually be set so that with appropriate sized tyres, and Default Suspension Height set to 0, the wheels are nearly touching the top of the arches. Some cars might want to be set a bit higher (SUVs and the like), but remember that when a car is set to a ride height of 0, it has very little suspension travel, so you should be setting height offset on the basis of the lowest the car could possibly ever sit.
Front
  • Firewall Y is a setting for how far forward the front firewall is. It's easiest to set this in side view in Wireframe mode. Set to match your mesh's firewall. This value is important for engine bay size.
  • Firewall Z is a setting for how tall the front firewall is. It's easiest to set this in side view in Wireframe mode.
  • Firewall Lean is a setting for how far forward the front firewall leans.
  • Nose Length is used to set how far forward the engine bay goes. This is important for engine bay size. Make sure the chassis doesn't stick out of the car, even when you've moved morphs around on the nose.
  • Cab Over is a tick box to say whether the engine goes under the front seats of your car body. Affects some statistics. Used for flat-nose vans and similar vehicles that lack bonnets.
Rear
  • Rear Wall Y is a setting for how far backward the rear firewall is. It's easiest to set this in side view in Wireframe mode. Ignore this value for front-engine-only cars.
  • Rear Wall Z is a setting for how tall the rear firewall is. It's easiest to set this in side view in Wireframe mode. Ignore this value for front-engine-only cars.
  • Tail Length is how far the back of the chassis goes. Important for rear engine bay size, but not very important for front-engine cars. Be careful that it doesn't stick out of the car.

Wheels

  • Max Wheel Diameter is the maximum wheel & tyre diameter in centimetres. Set this by adjusting the default tyre size to work out what the biggest practical tyre size would be, then putting that number here.
  • Min Wheel Diameter is the minimum wheel & tyre diameter in centimetres. Set this by adjusting the default tyre size to work out what the smallest practical tyre size would be, then putting that number here.
  • Default Wheel Diameter sets what tyre diameter is loaded on the car by default. Set it to something within reason for the car type.
  • Default Rim Diameter sets what rim diameter is loaded on the car by default. Set it to something within reason for the car type. Remember to set it correctly for a tyre profile that makes sense for the type and age of the car. Older cars need high-ish-profile tyres, due to in-game restrictions on using low-profile tyres in early eras.
  • Default Wheel Width sets what tyre width is loaded on the car by default. Set it to something within reason for the car type.

Path (Legacy Class)

This is a legacy option for older bodies. You shouldn't need to touch anything in here unless you are converting a pre-UE4.24 mod.

Body Boxes

This contains all the sizes and positions of the body boxes, and are generated automatically in the thumbnail generation stage.

Manually enlarging engine bays

Engine bay bounds are determined by four points on one side of the car that form a rectangle. These points are then mirrored to form a box representing the engine bay.

For more adventurous mod bodies such as open-wheelers, you may find that the engine bay isn't long or tall enough to fit a suitably-sized engine. This can be fixed by increasing the two larger Y or Z values to the desired amount after you've generated the thumbnail, body boxes, and mesh data. Keep in mind that when you regenerate the thumbnail and mesh data, your modified engine bay values will be overwritten, so it may help to store them in a text file somewhere.

A note on convertibles

Convertibles should have their body tag set to the type of body they are aside from being convertibles, with the 'soft top' or 'hard top' convertible values being set separately. The 'convertible' body type is no longer used.

Set Bone Limits

Once you've set all the other car body settings, you'll need to set the limits for bone movement.

While simulating in the car body scene, make sure your car is loaded and select it.

Annotation 2020-03-17 155800.png

You should now see a set of blue squares at the locations of your bones as you set them in your modelling program. Click on one of these blue squares, and start to move it along an axis to see how it affects the body. You can set the current position of the bone as the new limit of that bone by right clicking on it and selecting "Add to limits".

UE4ModCreation 20.gif

Right-click on a bone and select "Move all bones to bind pose" to move the bones back to their default location.

Note that if you accidently set a bone's limits too far, there are two ways to fix it: you can either right-click "Reset Limits" and then set the limit again, or (if you know what you're doing) type a new limit into the appropriate axis of the corresponding bone in the Bone Constraints array.

The following other options on right-clicking a bone are as follows:

  • "Move all bones to max" will move a bone as far as possible in the positive axes it can move.
  • "Move all bones to min" will move a bone as far as possible in the negative axes it can move.
  • "Reset limits" will remove all limits from a selected bone.
  • "Move all bones to bind pose" will move all bones back to their default positions.

Bones that appear red are bones that exist as part of the skeleton but aren't weighted to any vertices on the car.

Generate Thumbnails

While simulating, load your car body.

In the Body Edit Scene Bluetility, click Generate Thumbnail.

UE4ModCreation 21.gif

You should now have two more files in your mod content folder, but don't let their lack of an "unsaved" asterisk icon fool you: these files do indeed need to be saved. Right-click the files and save them manually; otherwise, they will indeed stop existing.

UE4ModCreation 23.gif

You are now done creating all the files and settings you need! You can now export your mod body.

For additional body variants

For additional variants, repeat the same process for each CPP. If you copied the CPP from one variant and edited it for a new one, this will replace the original thumbnail. To avoid this problem, clear the thumbnail (and mesh data) from "Variant Preview Texture" on each additional variant before generating their thumbnails.

Export Your Car Body

  1. In Unreal Editor, at the top toolbar, select "Share Mod" and then click on the name of your car body.
  2. Select a path where there are no spaces in the file path. As an example, C:\Users\Name\Documents\Unreal Projects\AutomationGame will not work, since the phrase Unreal Projects contains a space. C:\Users\Name\Documents\ModExport will work, because there are no spaces in the file path.
  3. Once your build is successful, you need to launch the "Automation - The Car Company Tycoon Game Workshop Tool" from your "Tools", which can be accessed by hovering over "Library" in Steam.
  4. Enjoy your new car body!

FAQ

Q: I get a Max Script error running the script to unwrap my body like so:

Maxscript Err Unwrap.png

A: Car bodies in UE use 3 UVW maps and your mesh currently has less. To ensure you have enough maps, take the following steps.

Q: I get a Max Script error running the script to mirror my body like so:

Vertex index error.png

A: Save the body file as is, close 3ds Max, and then reopen the file. This fixes most instances of this error.

Q: Unreal won't open the SDK project files.

A: Make sure you're running the correct version of Unreal Editor. It should be version 4.24.3.

Q: I got my body in the game, but it looks weird whenever I apply fixtures.

A: Refer back to the UV unwrapping section, where this problem is addressed.