Car Body Mods: Difference between revisions

From Automation Game Wiki
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Overview ==
== Overview ==
a Car body is a collection of files, of which the <code>Body Variant Preview File</code> is the parent.
A car body is a collection of files, of which a <code>Body Variant Preview Data</code> file is the parent.


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


The car body mesh 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.
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 ==
== Workflow ==


# In a 3D modeling package:
# In a 3D modelling package:
## Create a car body mesh
## Create a car body mesh.
## set up the skin / rig / morph targets
## Set up the skinning/rigging and morph targets.
## create the UVs
## Create the UV maps.
# in UE4:
# In UE4:
## set up a mod
## Set up a mod.
## import the car body to the mod folder
## Import the car body to the mod folder.
## fill the car body with the placeholder materials
## Ensure that the placeholder materials are properly assigned to the body.
## create and fill out a body variant preview file
## Create and fill out a body variant preview file.
## generate the car thumbnail and preview info
## Generate the car thumbnail and preview info.
## cooking your mod
## Cook the mod.
# in the Workshop Publishing Tool
# In the Automation Workshop Publishing Tool:
## set up a workshop item
## Set up a workshop item.
## share your mod
## Share your mod.


== Creating the Car Body Mesh ==
== Creating the Car Body Mesh ==
Line 38: Line 38:


=== Notes ===
=== Notes ===
* UE4's units are in centimetres
* 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 7000 and 30000 triangles.
*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).
**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.
*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.
**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 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.
*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.
**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 tris.
* 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 mode="nolines" widths="300" heights="240">
<br /><gallery mode="packed" widths="200" heights="180">
File:NewCarTopView.jpg
File:Topview2.jpg|Top view
File:NewCarSideView.jpg
File:SideView2.jpg|Side view
File:NewCarFrontView.jpg
File:3dview.jpg|3D view
</gallery><br />
</gallery>
 
==== Coordinates ====
==== Coordinates ====


* The front of the car body should face towards the negative Y (front to back) axis
* 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 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).
* 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).
Line 79: Line 77:
!Material Name
!Material Name
!Area Used
!Area Used
!Category  
!Paint Category  
!Colourable  
!Colourable  
!Location in UE4
!Location in UE4
!Notes
!Notes
|-
|-
|Bonnet
|<code>Bonnet</code>
|The bonnet
|The bonnet
|Body
|Body
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Bonnet
|Content/Cars/Meshes/Bodies/Bonnet
|General paintable material.
|General paintable material. Has its own visibility toggle in-game.
|-
|-
|BonnetCam
|<code>BonnetCam</code>
|The location of the bonnet camera
|Above the bonnet; determines the default location of the bonnet camera
|N/A
|N/A
|No
|No
Line 99: Line 97:
for the Exporter, the bounding box origin of the geometry which uses this material defines where the bonnet camera will be.
for the Exporter, the bounding box origin of the geometry which uses this material defines where the bonnet camera will be.
|-
|-
|Bumper_Front
|<code>Bumper_Front</code>
|The front bumper
|The front bumper
|Body
|Body
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Bumper_Front
|Content/Cars/Meshes/Bodies/Bumper_Front
|At the moment, front and rear bumper colours cannot be chosen independently in-game, but having two separate materials is good practice for futureproofing.
|Prior to the Light Campaign 4.2 update, front and rear bumpers could not be painted separately.
|-
|-
|Bumper_Rear
|<code>Bumper_Rear</code>
|The rear bumper
|The rear bumper
|Body
|Body
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Bumper_Rear
|Content/Cars/Meshes/Bodies/Bumper_Rear
|At the moment, front and rear bumper colours cannot be chosen independently in-game, but having two separate materials is good practice for futureproofing.
|Prior to the Light Campaign 4.2 update, front and rear bumpers could not be painted separately.
|-
|-
|CabinBounds
|<code>CabinBounds</code>
|DEPRECIATED
|Deprecated
|N/A
|N/A
|No
|No
|Content/Cars/Meshes/Bodies/CabinBounds
|Content/Cars/Meshes/Bodies/CabinBounds
|This material is no longer used for defining a bounding box for car calculations. These car calculations are instead calculated dynamically.
|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 is listed for legacy purposes only.
(This material was previously used to determine cabin size.)
|-
|-
|CargoBounds
|<code>CargoBounds</code>
|DEPRECIATED
|Deprecated
|N/A
|N/A
|No
|No
|Content/Cars/Meshes/Bodies/CargoBounds
|Content/Cars/Meshes/Bodies/CargoBounds
|This material is no longer used for defining a bounding box for car calculations. These car calculations are instead calculated dynamically.
|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 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.)
|-
|<code>Car_Roof</code> (formerly <code>Soft_Top</code>)
|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
|<code>Chrome</code>
|Areas that must remain chrome
|Areas that must remain chrome
|N/A
|N/A
Line 138: Line 143:
This material cannot be changed in-game.
This material cannot be changed in-game.
|-
|-
|DriverCam
|<code>DriverCam</code>
|The location of the driver camera(s)
|Inside the cabin; determines the default location of the driver camera(s)
|N/A
|N/A
|No
|No
|Content/Cars/Meshes/Bodies/DriverCam
|Content/Cars/Meshes/Bodies/DriverCam
|This material is invisible in-game and has no effect on aesthetics.
|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.  
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 split the geometry across both sides of the car, allowing for a left and right driver position.
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 ray-cast to from a position at the front of the car, and the collision position to any vertex/face will become the driver camera position. Effectively, this means the Driver Cam position is just in front of the windshield of the position of this bounding box origin.
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
|<code>FrontBounds</code>
|DEPRECIATED
|Deprecated
|N/A
|N/A
|No
|No
|Content/Cars/Meshes/Bodies/FrontBounds
|Content/Cars/Meshes/Bodies/FrontBounds
|This material is no longer used for defining a bounding box for car calculations. These car calculations are instead calculated dynamically.
|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 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
|<code>LipPlacement</code>
|panel gaps, wheel wells, undertray
|Around undertray, over panel gaps, and over wheel wells
|N/A
|N/A
|No
|No
|Content/Cars/Meshes/Bodies/LipPlacement
|Content/Cars/Meshes/Bodies/LipPlacement
|Used to cover panel gaps, wheel wells, and undertrays.
|Used to cover panel gaps, wheel wells, and undertrays so that fixtures can conform to them.
This material is invisible in-game.
This material is invisible in-game.
|-
|-
|LowerBounds
|<code>LowerBounds</code>
|DEPRECIATED
|Deprecated
|N/A
|N/A
|No
|No
|Content/Cars/Meshes/Bodies/LowerBounds
|Content/Cars/Meshes/Bodies/LowerBounds
|This material is no longer used for defining a bounding box for car calculations. These car calculations are instead calculated dynamically.
|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 is listed for legacy purposes only.
(This material was previously used to determine a car's engine bay size and general weight.)
|-
|-
|Paint
|<code>Paint</code>
|The primary paint colour
|The primary paint colour
|Body
|Body
Line 183: Line 188:
|General paintable material.
|General paintable material.
|-
|-
|Paint_Two_Tone
|<code>Paint_Two_Tone</code>
|The secondary paint colour
|The secondary paint colour
|Body
|Body
Line 190: Line 195:
|General paintable material.
|General paintable material.
|-
|-
|Paint Misc 1
|<code>Paint_Misc_1</code>
|Misc paint
|Misc. paint
|Body
|Body
|Yes
|Yes
Line 197: Line 202:
|General paintable material.
|General paintable material.
|-
|-
|Paint Misc 2
|<code>Paint_Misc_2</code>
|Misc paint
|Misc. paint
|Body
|Body
|Yes
|Yes
Line 204: Line 209:
|General paintable material.
|General paintable material.
|-
|-
|Paint Misc 3
|<code>Paint_Misc_3</code>
|Misc paint
|Misc. paint
|Body
|Body
|Yes
|Yes
Line 211: Line 216:
|General paintable material.
|General paintable material.
|-
|-
|Trim
|<code>Trim</code>
|The general trim colour
|The general trim
|Trim
|Trim
|Yes
|Yes
Line 218: Line 223:
|General paintable material.
|General paintable material.
|-
|-
|Trim Misc 1
|<code>Trim_Misc_1</code>
|Misc trim
|Misc. trim
|Body
|Trim
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Trim_Misc_1
|Content/Cars/Meshes/Bodies/Trim_Misc_1
|General paintable material.
|General paintable material.
|-
|-
|Trim Misc 2
|<code>Trim_Misc_2</code>
|Misc trim
|Misc. trim
|Body
|Trim
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Trim_Misc_2
|Content/Cars/Meshes/Bodies/Trim_Misc_2
|General paintable material.
|General paintable material.
|-
|-
|Trim Misc 3
|<code>Trim_Misc_3</code>
|Misc trim
|Misc. trim
|Body
|Trim
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Trim_Misc_3
|Content/Cars/Meshes/Bodies/Trim_Misc_3
|General paintable material.
|General paintable material.
|-
|-
|Plastic
|<code>Plastic</code>
|Areas that must remain plastic
|Underbody
|N/A
|Trim
|No
|Yes
|Content/Cars/Meshes/Bodies/Plastic
|Content/Cars/Meshes/Bodies/Plastic
|Used for underbodies and wheel wells.
|Used for underbodies and wheel wells.
This material cannot be changed in-game.
|-
|-
|Reflective_Mirror
|<code>Reflective_Mirror</code>
|Deprecated
|Deprecated
|N/A
|N/A
Line 254: Line 258:
|Used for reflective mirror glass, back when mirrors were modelled into car bodies.
|Used for reflective mirror glass, back when mirrors were modelled into car bodies.
|-
|-
|Soft_Top
|<code>Steel</code>
|The cloth roof of a softtop convertible
|Body
|Yes
|Content/Cars/Meshes/Bodies/Soft_Top
|General paintable material.
|-
|Steel
|Areas that must remain steel
|Areas that must remain steel
|N/A
|N/A
Line 269: Line 266:
This material cannot be changed in-game.
This material cannot be changed in-game.
|-
|-
|Tray
|<code>Tray</code>
|The bed of a pickup truck or ute
|The bed of a pickup truck or ute
|Body
|Body
Line 276: Line 273:
|Fixtures cannot be placed on this material.  
|Fixtures cannot be placed on this material.  
|-
|-
|Window_Pillar
|<code>Window_Pillar</code>
|The pillar trim colour
|The pillar trim
|Window pillar
|Trim
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Window_Pillar
|Content/Cars/Meshes/Bodies/Window_Pillar
|General paintable material.
|General paintable material.
|-
|-
|Window_Trim
|<code>Window_Trim</code>
|The window trim colour
|The window trim
|Window Trim
|Trim
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Window_Trim
|Content/Cars/Meshes/Bodies/Window_Trim
|General paintable material.
|General paintable material.
|-
|-
|Windows
|<code>Windows</code>
|The car's windows
|The car's windows
|N/A
|Body
|Yes
|Yes
|Content/Cars/Meshes/Bodies/Windows
|Content/Cars/Meshes/Bodies/Windows
|General paintable material.
|General paintable material.
Window transparency can be adjusted in-game.
Using the default Adjustable Window material, window transparency can be adjusted in-game.
|-
|-
|Wing_Mirror_Trim
|<code>Wing_Mirror_Trim</code>
|DEPRECIATED
|Deprecated
|Trim
|Trim
|Yes
|Yes
Line 312: Line 309:
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.
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 weighting of the selected face/vertex.
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 a maximum weight of 0.3 for the vertices that move the most, and multiply down to 0 for vertices that do not move at all for the morph.
* 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/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
** 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 a maximum weight on a skin should be about 0.3
* 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 also, or if your morph targets do not overlap a particular set of skin weights
** 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 authoring your skin to use values as a multiple of 1/256 is important. as a rough estimate, values that are a multiple of 0.004 work fine.
** 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 ===
=== Creating morphs with skinning ===
Line 339: Line 336:
Bones should float freely around the area which they will deform. All bones should be parented to the origin of the car called <code>Bone Root</code>.  The naming and hierarchy is important.   
Bones should float freely around the area which they will deform. All bones should be parented to the origin of the car called <code>Bone Root</code>.  The naming and hierarchy is important.   


It is a ''requirement'' for the root bone to be named <code>Bone Root</code>. otherwise, the body will not work correctly!   
It is a ''requirement'' for the root bone to be named <code>Bone Root</code>; 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:  
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:  
Line 347: Line 344:
* Rear window rake angle
* Rear window rake angle
* Boot/rear length or angle
* Boot/rear length or angle
*Front and rear bumper length
*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 can only be skinned to 4 different bones, 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.
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, the morphing will not work if the bones' origin is off-screen while trying to morph an area in-game. try to keep the bones relatively close to the areas they're morphing.
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:
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:
Line 360: Line 357:
*<code>L.<Name></code>
*<code>L.<Name></code>
*<code>R.<Name></code>
*<code>R.<Name></code>
where <code><Name></code> is the name of the bone/morph.<br />
In this case, <code><Name></code> is the name of the bone/morph.<br />


[[File:BoneLayout2.jpg|frameless]]
[[File:BoneLayout2.jpg|frameless]]
Line 381: Line 378:
====Weighting the skin====
====Weighting the skin====


Now comes the complex bit. Weighting skins is a difficult and creative proccess 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.  
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.
* 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.
Line 403: Line 400:


=== Creating morphs with morph targets ===
=== 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, and only in one direction. 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. It is up to you to decide which method you would prefer to use. Morph targets are generally easier to set up.
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 ====
==== In Blender ====
Line 411: Line 408:
</gallery>You can now edit the mesh to be in the new position you want it to be in for that morph.
</gallery>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, you will have a very laggy car body!
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 ====
==== In 3ds Max ====
I do not recommend this, but you can do it if you really want to.
We do not recommend this, but you can do it if you really want to.


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


=== Morphing tips ===
=== 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). If I had the time, I'd go back and fix that one... 😉
* 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.
* 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.
Line 437: Line 436:


=== Unwrapping fundamentals ===
=== Unwrapping fundamentals ===
UV unwrapping is the process of unfolding the mesh onto a flat 2d plane that 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 [https://i.pinimg.com/736x/36/b3/0e/36b30ecf06c7127270612ed37e693a16--toyota-land-cruiser-doll-party.jpg 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.  
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 [https://i.pinimg.com/736x/36/b3/0e/36b30ecf06c7127270612ed37e693a16--toyota-land-cruiser-doll-party.jpg 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".
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".
Line 451: Line 450:
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.
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.


This only applies to the car itself, not to the bounds boxes. The bounds boxes do not need to be correctly unwrapped, as they are invisible and do not contribute to the fixture stamping. Any lip placement areas, however, must still be properly unwrapped despite the material being invisible; otherwise, tearing across the body can occur.
Any lip placement areas must be properly unwrapped despite the material being invisible; otherwise, tearing across the body can occur.


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.<gallery mode="nolines" widths="420" heights="240">
===== 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.<gallery mode="nolines" widths="420" heights="240">
File:Car body is not one mesh.png|If your selection ends up looking like this, your car is not one element, and has unjoined faces between the selection and the rest of the mesh. This will not work. Join your mesh together properly.
File:Car body is not one mesh.png|If your selection ends up looking like this, your car is not one element, and has unjoined faces between the selection and the rest of the mesh. This will not work. Join your mesh together properly.
File:Car body selection correct.png|If your selection looks like this, with the entirety of the mesh selected, then you have done it correctly and there are no un-joined elements. Good job!
File:Car body selection correct.png|If your selection looks like this, with the entirety of the mesh selected, then you have done it correctly and there are no un-joined elements. Good job!
Line 464: 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.]]
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.
=== Unwrapping a car with the 3ds Max unwrap script ===
From the Car Body Export Helper utility (located on the Utilities tab, with the hammer icon, in the top right of 3ds Max), press the "Unwrap Car Body" button. If you don't see this menu, go to utilities, then click on MAXScript, which will bring up the Car Body Export Helper option; then, click on the name. 
[[File:3DS-Max-Car-Unwrap-Script 01.gif|none|thumb]]The UV unwrap should now be complete, and with the UVTESTING map applied, the result should look something like this:
[[File:Checker.jpg|frameless|360x360px]]
===== Note for finished bodies made via the 3ds Max script =====
If you've finished your body and have it running in game, and it looks like this whenever you add fixtures...
[[File:WeirdFixtures.png|frameless|360x360px]]
...then the UV maps are broken. You need to follow the steps below to fix the UV maps.
Start off with your un-mirrored, but complete body.
[[File:WeirdStep1.png|frameless|360x360px]]
Apply the UV Test material and unwrap your body (which at this point is only half) with the Car Body Export Helper Tool.
[[File:WeirdStep3.png|frameless|360x360px]]
Add the Unwrap UVW modifier. Under the Channel panel, navigate to the Map Channel box and change the "1" to "2".
There should be a pop up. Click Move.
[[File:WeirdStep4.png|frameless|240x240px]]
Now move your Unwrap UVW modifier so that it sits below the Skin modifier.
[[File:WeirdStep5.png|frameless|267x267px]]
Select your car object and mirror it using the Car Body Export Helper Tool. After mirroring you will notice that your Unwrap UVW modifier has disappeared.
In conclusion: unwrap the body and apply the Unwrap UVW modifier. Change the Map Channel to "2" and then click Move, after which you will move the Unwrap UVW modifier below the Skin modifier.


You can now follow the export steps to re-export!
[[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 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 ==
== Mirror the Half Body ==


=== The traditional method ===
=== The traditional method ===
[[File:Flip UVs part 1.png|thumb|alt=|A mirrored mesh before mirroring the unwrap.|300x300px]][[File:Flip uv part 2.png|thumb|alt=|A mirrored mesh after mirroring the unwrap.|300x300px]]
# Mirror your mesh.
# Mirror your mesh.
# 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|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 518: Line 488:


[[File:Mirror_weights_2.png|frameless|273x273px]]
[[File:Mirror_weights_2.png|frameless|273x273px]]
=== If you're using the optional 3ds Max script ===
Mirroring is simple; from the Car Body Export Tools utility, just press "Mirror Car Body". This will mirror the mesh, mirror the UV unwrap, and duplicate the required bones.
[[File:3DS-Max-Car-Unwrap-Script_02.gif|frameless|221x221px]]


== Fix Everything You Just Broke Mirroring the Body ==
== Fix Everything You Just Broke Mirroring the Body ==
=== If you're using the 3ds Max script ===
===='''Check wheel arch bones have their opposite counterparts created'''====
Wheel arch bones require an opposite bone. This is to allow the game to morph the wheel arch on the other side of the body to the same length, but in an opposite direction to that which you have moved. (The same applies to any other bone that moves along the X axis, e.g. a running board morph). 
When the mirror script is run, it determines which bones require an opposite by checking all the vertices on the zero X axis for each bone. If none of these vertices have a weight value, the script will create an opposite bone.
If, after running the script, your double-sided body does not have the expected opposite bones, then you will need to go back to your original half body and check that none of the vertices for that bone on the zero X Axis has any weight applied to it. Remember that ''zero weighted bones still count as having a value'', and you should use the Remove Zero Weights button to remove these.
[[File:Centre_verts.png|alt=|thumb|420x420px|Selecting all centre vertices.]]
One method to check for weights on the zero X axis is as follows:
[[File:Weight_table_view.png|alt=|thumb|420x420px|The weight table.]]
#Ensure that all vertices of your mesh are visible.
#Select all the vertices along the zero X axis.
#Open the weight table (found in the weight properties rollout).
#Set the weight table view to selected vertices.
#Scroll down the list of weight for the bones in question. Any weighted verts should be easy to spot, as there should not be any. These can be zeroed by right clicking the weight value.  (You may want to make note of any weight values for other bones (excluding the root bone) on that vertex, as these may alter as a result of the above and you will want to correct them.
#Once all erroneous weights have been zeroed, use the Remove Zero Weights button.
These steps should ensure your opposite bone is created when the mirror script is run again.


====Ensure other bones do not have opposite bones when not required====
====Ensure other bones do not have opposite bones when not required====
Line 606: Line 551:
This step is easy!   
This step is easy!   


1: Select the car body, then go to File > Export > Export Selected
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.
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:
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 ===
Line 621: Line 567:
File:Blender-export-settings-02.gif|2. Under Geometry, set smoothing to Normals Only, and tick Tangent Space.
File:Blender-export-settings-02.gif|2. Under Geometry, set smoothing to Normals Only, and tick Tangent Space.
File:Blender-export-settings-04.gif|3. Under Armatures, untick Add Leaf Bones.
File:Blender-export-settings-04.gif|3. Under Armatures, untick Add Leaf Bones.
</gallery>The animation tab doesn't matter, as we don't use animations. You are now ready to import your body to Unreal Engine!
</gallery>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 ==
== Import Car Body to Unreal Engine ==
Line 640: Line 588:
[[File:UE4ModCreation_02.gif|frameless|240x240px]]
[[File:UE4ModCreation_02.gif|frameless|240x240px]]


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 file. 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 are within the one plugin folder you want to release.
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.


[[File:UE4ModCreation_03.gif|frameless|267x267px]]
[[File:UE4ModCreation_03.gif|frameless|267x267px]]
Line 704: Line 652:
[[File:UE4ModCreation_19.gif|frameless|240x240px]]
[[File:UE4ModCreation_19.gif|frameless|240x240px]]


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.
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 ===
=== Loading a Car For Editing ===
Open the <code>ThumbnailGeneratorLevel_Car</code> level.
Open the <code>ThumbnailGeneratorLevel_Car</code> level.


[[File:UE4ModCreation_13.gif|frameless|240x240px]]
[[File:ModTools ThumbnailLevelCar.jpg|frameless|303x303px]]


On the top bar, select the drop-down menu next to the <code>Play</code> button, and select <code>Simulate</code>.
On the top bar, select the drop-down menu next to the <code>Play</code> button, and select <code>Simulate</code>.
Line 749: Line 701:


*'''<u>Skeletal Mesh</u>''' is the physical mesh of your body.
*'''<u>Skeletal Mesh</u>''' is the physical mesh of your body.
*'''<u>Car Material Settings</u>''' are the default materials that should be applied to your body when a player loads it in-game.
*'''<u>Car Material Settings</u>''' 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.
*'''<u>Mesh Data</u>''' is a generated file that you dont need to worry about. We'll make one of these in the [[Car Body Mods#Generate Thumbnails|thumbnail generation]] stage.
*'''<u>Mesh Data</u>''' is a generated file that you dont need to worry about. We'll make one of these in the [[Car Body Mods#Generate Thumbnails|thumbnail generation]] stage.
*'''<u>Bone Constraints</u>''' 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 [[Car Body Mods#Set Bone Limits|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.''
*'''<u>Bone Constraints</u>''' 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 [[Car Body Mods#Set Bone Limits|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.''
Line 760: Line 712:
==== <u>Preview</u> ====
==== <u>Preview</u> ====


* You shouldn't have to set anything here. These will be populated in the [[Car Body Mods#Generate Thumbnails|thumbnail generation]] stage.
* You shouldn't have to set anything here. These fields will be populated in the [[Car Body Mods#Generate Thumbnails|thumbnail generation]] stage.


==== <u>Settings</u> ====
==== <u>Settings</u> ====


*'''<u>Variant Body Type</u>''' determines the category of the body in-game. Different categories have different advantages and disadvantages.
*'''<u>Variant Body Type</u>''' determines the category of the body in-game. Different categories have different advantages and disadvantages.
*'''<u>Year</u>''' 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.
*'''<u>Year</u>''' 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.
*'''<u>Doors</u>''' determines the number of doors on this body, which affects some demographics' statistics.
*'''<u>Doors</u>''' determines the number of doors on this body, which affects some demographics' statistics.
*'''<u>Maximum Seat Rows</u>''' determines the maximum number of seat rows your body can have. This affects some demographics' statistics.
*'''<u>Maximum Seat Rows</u>''' 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.
*'''<u>Is Release Ready</u>''' 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.
*'''<u>Is Release Ready</u>''' 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.
*'''<u>Seat Options</u>''' is a legacy option that is no longer used.
*'''<u>Seat Options</u>''' is a legacy option that is no longer used.
*'''<u>Front Suspension To Disable</u>''' 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, and you cannot solve it elsewhere.
*'''<u>Front Suspension To Disable</u>''' 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.
*'''<u>Rear Suspension To Disable</u>''' 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, and you cannot solve it elsewhere.
*'''<u>Rear Suspension To Disable</u>''' 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.
*'''<u>Chassis Type</u>''' sets the body to the selected chassis for thumbnail purposes and has no effect in-game.
*'''<u>Is Softtop Convert</u>''' will set this body as a convertible with a soft top. This is for demographic calculations.
*'''<u>Is Softtop Convert</u>''' will set this body as a convertible with a soft top. This is for demographic calculations.
*'''<u>Is Hardtop Convert</u>''' will set this body as a convertible with a hard top. This is for demographic calculations.
*'''<u>Is Hardtop Convert</u>''' will set this body as a convertible with a hard top. This is for demographic calculations.
*'''<u>Cargo Subtracts</u>''' 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.
*'''<u>Cargo Subtracts</u>''' 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 '''<u>Seats</u>''' 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".


==== <u>Engine</u> ====
==== <u>Engine</u> ====
Line 785: Line 739:


* '''<u>Wheelbase</u>''' is the wheelbase of the body in centimetres. Set this before setting anything else for best results.
* '''<u>Wheelbase</u>''' is the wheelbase of the body in centimetres. Set this before setting anything else for best results.
* '''<u>Track Width</u>''' 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 sit correctly in the mesh (with 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.
* '''<u>Track Width</u>''' 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.
* '''<u>Y Offset</u>''' 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 recentre your mesh.
*'''<u>Pan Width</u>''' 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.
* '''<u>Y Offset</u>''' 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.
*'''<u>Arch Width</u>''' [missing info]


===== <u>Vertical Position</u> =====
===== <u>Vertical Position</u> =====
Line 795: Line 751:
=====<u>Front</u>=====
=====<u>Front</u>=====


* '''<u>Firewall Y</u>''' is a 0-100 setting of how far forward the firewall is. Easiest to set in side view in Wireframe mode. Set to match your mesh's firewall. Important for engine bay size.
* '''<u>Firewall Y</u>''' 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.
* '''<u>Nose Length</u>''' is used to set how far forward the engine bay goes. 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.
*'''<u>Firewall Z</u>''' is a setting for how tall the front firewall is. It's easiest to set this in side view in Wireframe mode.
* '''<u>Cab Over</u>''' is a tick box to say whether the engine goes under the front seats of your car body. Affects some statistics. Used for vans, etc.
*'''<u>Firewall Lean</u>''' is a setting for how far forward the front firewall leans.
* '''<u>Nose Length</u>''' 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.
* '''<u>Cab Over</u>''' 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.


=====<u>Rear</u>=====
=====<u>Rear</u>=====


* '''<u>Rear Wall Y</u>''' is the firewall position for rear/mid engine cars. Ignore this value for front-engine-only cars.
* '''<u>Rear Wall Y</u>''' 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.
*'''<u>Rear Wall Z</u>''' 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.
* '''<u>Tail Length</u>''' 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.
* '''<u>Tail Length</u>''' 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.


Line 811: Line 770:
* '''<u>Default Rim Diameter</u>''' 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.
* '''<u>Default Rim Diameter</u>''' 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.
* '''<u>Default Wheel Width</u>''' sets what tyre width is loaded on the car by default. Set it to something within reason for the car type.
* '''<u>Default Wheel Width</u>''' sets what tyre width is loaded on the car by default. Set it to something within reason for the car type.
====<u>Aero</u>====
* '''<u>Cd</u>''': Drag Coefficient (''not including cooling drag'') - You can use this calculator to estimate https://docs.google.com/spreadsheets/d/1eIZKdCemwtb8KQJK4aQzicIyN80ESoDY2FN7UPR7JV0/edit#gid=588180347
*'''<u>Cl Front</u>''': Front Lift Coeeficient - You can use this calculator to estimate https://docs.google.com/spreadsheets/d/1eIZKdCemwtb8KQJK4aQzicIyN80ESoDY2FN7UPR7JV0/edit#gid=588180347
*'''<u>Cl Rear</u>''': Rear Lift Coeeficient - You can use this calculator to estimate https://docs.google.com/spreadsheets/d/1eIZKdCemwtb8KQJK4aQzicIyN80ESoDY2FN7UPR7JV0/edit#gid=588180347


====<u>Path (Legacy Class)</u>====
====<u>Path (Legacy Class)</u>====
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.


* 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.
====<u>Body Boxes</u>====
This contains all the sizes and positions of the body boxes, and are generated automatically in the [[Car Body Mods#Generate Thumbnails|thumbnail generation]] stage.


====<u>Body Boxes</u>====
===== 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.


* This contains all the sizes and positions of the body boxes, and are generated automatically in the [[Car Body Mods#Generate Thumbnails|thumbnail generation]] stage.
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 ====
==== A note on convertibles ====
Convertibles should have their body tag set to the type of body they are aside from being convertibles, and to set the 'soft top' or 'hard top' convertible values separately.  The 'convertible' body type is no longer used.
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 ==
== Set Bone Limits ==

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.