Vehicle Layouts
Vehicle layouts define the structural skeleton and bone configuration of your custom vehicle.
Understanding Bones
Bones are the skeletal structure of a vehicle. They define:
- Seat positions
- Door mechanisms
- Light positions
- Customization part attachment points
- Deformable body parts
Layout Structure
Vehicle layouts are typically defined in a layout XML file or within vehiclelayouts.xml:
<Layout>
<Name>STANDARD_SEDAN</Name>
<Bones>
<Bone index="0" name="chassis" />
<Bone index="1" name="door_fl" /> <!-- Front left door -->
<Bone index="2" name="door_fr" /> <!-- Front right door -->
<Bone index="3" name="door_rl" /> <!-- Rear left door -->
<Bone index="4" name="door_rr" /> <!-- Rear right door -->
<Bone index="5" name="hood" /> <!-- Engine hood -->
<Bone index="6" name="trunk" /> <!-- Trunk/boot -->
<Bone index="7" name="seat_driver" />
<Bone index="8" name="seat_passenger" />
</Bones>
<Seats>
<Seat index="0" bone="seat_driver" />
<Seat index="1" bone="seat_passenger" />
</Seats>
</Layout>
Common Bones
Structure Bones
| Bone | Purpose |
|---|---|
| chassis | Main vehicle body |
| door_fl | Front left door |
| door_fr | Front right door |
| door_rl | Rear left door |
| door_rr | Rear right door |
| hood | Engine hood (bonnet) |
| trunk | Trunk/boot |
| windshield | Windshield glass |
| window_fl | Front left window |
| window_fr | Front right window |
Seat Configuration
<Seats>
<Seat index="0" bone="seat_driver" x="0.0" y="0.0" z="0.0" />
<Seat index="1" bone="seat_passenger" x="1.0" y="0.0" z="0.0" />
<Seat index="2" bone="seat_rl" x="-0.5" y="-1.5" z="0.0" />
<Seat index="3" bone="seat_rr" x="0.5" y="-1.5" z="0.0" />
</Seats>
Light Positions
<Lights>
<Light index="0" type="headlight_l" bone="light_l_front" />
<Light index="1" type="headlight_r" bone="light_r_front" />
<Light index="2" type="taillight_l" bone="light_l_rear" />
<Light index="3" type="taillight_r" bone="light_r_rear" />
</Lights>
Deformable Parts
Define which bones can be damaged and repaired:
<DeformableParts>
<Part bone="door_fl" health="100.0" />
<Part bone="door_fr" health="100.0" />
<Part bone="hood" health="150.0" />
<Part bone="trunk" health="150.0" />
<Part bone="window_fl" health="30.0" />
<Part bone="windshield" health="50.0" />
</DeformableParts>
Customization Attachment Points
Define where modifications attach:
<AttachmentPoints>
<Attachment type="spoiler" bone="trunk_ext" />
<Attachment type="bumper_f" bone="bumper_front" />
<Attachment type="bumper_r" bone="bumper_rear" />
<Attachment type="skirt_l" bone="skirt_left" />
<Attachment type="skirt_r" bone="skirt_right" />
<Attachment type="exhaust" bone="exhaust" />
</AttachmentPoints>
Door Configuration
<Doors>
<Door index="0" bone="door_fl" type="NORMAL" />
<Door index="1" bone="door_fr" type="NORMAL" />
<Door index="2" bone="door_rl" type="NORMAL" />
<Door index="3" bone="door_rr" type="NORMAL" />
<Door index="4" bone="hood" type="BONNET" />
<Door index="5" bone="trunk" type="BOOT" />
</Doors>
Door Types
- NORMAL - Standard hinged door
- BONNET - Hood/engine cover
- BOOT - Trunk/boot
- SLIDING - Sliding door (vans)
- GULLWING - Upward-opening door
Complete Layout Example
<?xml version="1.0" encoding="UTF-8"?>
<VehicleLayout>
<Name>CUSTOM_SEDAN</Name>
<Bones>
<Bone index="0" name="chassis" />
<Bone index="1" name="door_fl" />
<Bone index="2" name="door_fr" />
<Bone index="3" name="hood" />
<Bone index="4" name="trunk" />
<Bone index="5" name="seat_driver" />
</Bones>
<Seats>
<Seat index="0" bone="seat_driver" />
<Seat index="1" bone="seat_passenger" />
</Seats>
<Doors>
<Door index="0" bone="door_fl" type="NORMAL" />
<Door index="1" bone="door_fr" type="NORMAL" />
<Door index="4" bone="hood" type="BONNET" />
<Door index="5" bone="trunk" type="BOOT" />
</Doors>
<Lights>
<Light index="0" type="headlight_l" bone="light_l_front" />
<Light index="1" type="headlight_r" bone="light_r_front" />
</Lights>
<DeformableParts>
<Part bone="door_fl" health="100.0" />
<Part bone="hood" health="150.0" />
</DeformableParts>
</VehicleLayout>
Best Practices
- Use consistent naming - door_fl = front left, etc.
- Set proper bone indices - Sequential numbering
- Define all doors - Hood, trunk, doors needed for functionality
- Position seats carefully - Affects camera view
- Test deformable parts - Ensure all damageable parts work
- Reference existing vehicles - Use as layout templates
Bone Index Reference
| Index | Typical Bone |
|---|---|
| 0 | chassis |
| 1-4 | doors (fl, fr, rl, rr) |
| 5 | hood |
| 6 | trunk |
| 7+ | seats and accessories |
Testing Layouts
- Define all critical bones (doors, hood, trunk)
- Set seat positions for proper camera view
- Test door opening/closing
- Verify damage states work
- Check all lights illuminate correctly
- Test customization attachments
Common Issues
- Seats in wrong position - Adjust bone coordinates
- Doors won't open - Verify door bones and types
- Missing lights - Check light bone references
- Invisible parts - Ensure bones are defined in model
- Camera issues - Wrong seat positioning bone