5.8 KiB
Vehicle System - Dubai Metaverse
Overview
This document describes the vehicle system implementation using Chaos Physics for the Dubai Metaverse project.
Chaos Vehicle System
Overview
Chaos Vehicle is Unreal Engine 5's physics-based vehicle simulation system. It provides realistic vehicle physics and handling.
Setup
-
Enable Chaos Physics:
- Project Settings > Physics > Chaos Physics
- Enable Chaos Vehicle
-
Vehicle Blueprint:
- Create vehicle blueprint
- Add Chaos Vehicle components
- Configure physics settings
Vehicle Assets
Dubai Supercars
Lamborghini
- Model: SM_Vehicle_Lamborghini
- Blueprint: BP_Vehicle_Lamborghini
- Type: Supercar
- Characteristics:
- High speed
- High acceleration
- Sporty handling
G-Wagon
- Model: SM_Vehicle_GWagon
- Blueprint: BP_Vehicle_GWagon
- Type: Luxury SUV
- Characteristics:
- High ground clearance
- Stable handling
- Luxury aesthetic
Ferrari
- Model: SM_Vehicle_Ferrari
- Blueprint: BP_Vehicle_Ferrari
- Type: Supercar
- Characteristics:
- High speed
- High acceleration
- Sporty handling
Vehicle Blueprint Setup
BP_VehicleBase
Base class for all vehicles
Components
-
Chaos Vehicle Movement Component:
- Main vehicle physics component
- Handles acceleration, braking, steering
- Configures vehicle dynamics
-
Mesh Component:
- Vehicle static mesh
- Visual representation
-
Camera Component (optional):
- Third-person camera
- First-person camera (if needed)
-
Audio Component:
- Engine sounds
- Tire sounds
- Other vehicle sounds
Physics Settings
Engine
- Max RPM: 6000-8000
- Torque: High for supercars
- Gear Ratios: Configure for vehicle type
Transmission
- Type: Automatic or Manual
- Gear Count: 6-8 gears
- Shift Points: Configure shift points
Suspension
- Spring Rate: Adjust for vehicle type
- Damping: Adjust for handling
- Travel: Suspension travel distance
Tires
- Friction: Tire friction coefficient
- Pressure: Tire pressure
- Radius: Tire radius
Vehicle Controller
BP_VehicleController
Purpose: Handle player input and vehicle control
Input Mapping
- Throttle: W key / Gamepad trigger
- Brake: S key / Gamepad trigger
- Steering: A/D keys / Gamepad stick
- Handbrake: Space key / Gamepad button
Implementation
-
Input Handling:
- Capture player input
- Convert to vehicle commands
- Send to vehicle movement component
-
Camera Control:
- Third-person camera follow
- Camera smoothing
- Camera offset
-
UI:
- Speedometer (optional)
- Gear indicator (optional)
AI Traffic System
PCG_Traffic Graph
Purpose: Generate AI traffic on roads
Implementation
-
Spline System:
- Create road splines
- Define traffic paths
- Set traffic direction
-
Vehicle Spawning:
- Spawn vehicles at intersections
- Spawn vehicles at entry points
- Vary vehicle types
-
AI Movement:
- Follow spline paths
- Maintain speed
- Avoid collisions
AI Vehicle Controller
-
Spline Following:
- Follow road splines
- Maintain lane position
- Adjust speed
-
Traffic Behavior:
- Stop at intersections (optional)
- Yield to other vehicles
- Maintain safe distance
Vehicle Materials
Paint Materials
- M_Vehicle_Paint: Base paint material
- Variations: Different colors per vehicle
- Properties:
- High reflectivity
- Low roughness
- Metallic (for some colors)
Material Instances
- MI_Vehicle_Lamborghini_Yellow: Yellow paint
- MI_Vehicle_Lamborghini_Orange: Orange paint
- MI_Vehicle_GWagon_Black: Black paint
- MI_Vehicle_Ferrari_Red: Red paint
Vehicle Audio
Engine Sounds
- A_Vehicle_Engine_Lamborghini: Lamborghini engine
- A_Vehicle_Engine_GWagon: G-Wagon engine
- A_Vehicle_Engine_Ferrari: Ferrari engine
Implementation
-
Audio Component:
- Attach to vehicle
- Play engine sound
- Adjust pitch based on RPM
-
Tire Sounds:
- Tire screech on hard braking
- Tire squeal on sharp turns
Performance Optimization
Vehicle Optimization
- LODs: Use LODs for distant vehicles
- Culling: Cull vehicles outside view
- Instancing: Use instanced meshes for traffic
Physics Optimization
- Update Frequency: Optimize physics update rate
- Collision: Optimize collision shapes
- Simulation: Limit physics simulation distance
Testing
Vehicle Testing
- Handling: Test vehicle handling
- Physics: Verify physics are realistic
- Performance: Test performance with vehicles
- Audio: Test vehicle audio
Traffic Testing
- Spawn Rate: Test vehicle spawn rate
- AI Behavior: Test AI traffic behavior
- Performance: Test performance with traffic
- Collisions: Test collision avoidance
Troubleshooting
Common Issues
Issue: Vehicle handling too sensitive/loose
- Solution: Adjust suspension settings
- Solution: Adjust tire friction
Issue: Vehicle not accelerating
- Solution: Check engine torque settings
- Solution: Check transmission settings
Issue: AI traffic not moving
- Solution: Check AI controller setup
- Solution: Verify spline paths
Issue: Performance issues
- Solution: Reduce vehicle count
- Solution: Optimize vehicle meshes
- Solution: Use LODs
Documentation
Vehicle Specifications
Document each vehicle:
- Model name
- Blueprint name
- Physics settings
- Material settings
- Audio settings
Controls
Document vehicle controls:
- Input mapping
- Camera controls
- Special features
Version: 1.0 Last Updated: [Current Date]