Spalah Vehicle Plugin

Official Documentation & Quick Start Guide

Developed for the Fab platform (Unreal Engine). Copyright © 2026 ZOAZ. All Rights Reserved.

1. Overview

Spalah is a modular, performance-friendly vehicle physics plugin for Unreal Engine. It bypasses the standard Chaos vehicle implementation to provide a stable, highly customizable raycast/spherecast wheel setup. The plugin is designed with multiplayer in mind (native replication) and supports modular add-ons, such as the Thermal Brake Module.

2. Quick Start Guide

  1. Create a Blueprint: Create a new Blueprint Class and select SpalahVehicleCore as the parent class.
  2. Setup the Mesh: Open your new Blueprint, select the VehicleMesh component, and assign your vehicle's Static Mesh. Ensure Simulate Physics is enabled.
  3. Add Wheels: Add 4 SpalahWheelComponents to your Blueprint. Position them where the wheels should be.
    • Set bIsSteerable = true for the front wheels.
    • Set bIsDriven = true for the rear wheels (or all 4 for AWD).
  4. Add Modules (Optional): To add advanced logic, add the SpalahBrakeThermalModule component to your Blueprint. It will automatically register itself with the Vehicle Core.
  5. Setup Inputs: In your Event Graph, route your Enhanced Input actions to the built-in functions: SetThrottleInput, SetBrakeInput, and SetSteeringInput.

3. Programming Architecture

ASpalahVehicleCore

The central brain of the vehicle. It manages the main physical forces, inputs, and coordinates all modules.

  • Multiplayer Ready: Built-in Server RPCs (ServerSetSteeringInput, etc.) and replicated variables.
  • Adaptive Steering: Automatically reduces maximum steering angle at high speeds for better control.
  • Speed Governor: Strict MaxSpeedKmh enforcer to prevent chaotic physics flying.

USpalahWheelComponent

A SphereComponent that acts as the suspension and contact patch.

  • Uses Hooke's law (Spring Stiffness + Damping) for suspension calculations.
  • Calculates strict lateral friction (TireMaxLateralGrip) to prevent jitter and allow smooth drifting.

USpalahBrakeThermalModule

An example of the powerful module system. It calculates brake temperatures.

  • Heating: Based on current speed and brake pressure.
  • Cooling: Passive air cooling that scales with vehicle speed. Includes extreme water cooling logic (triggers Steam VFX logic).
  • Brake Fade: If temps exceed MaxOptimalTemperature, brake efficiency smoothly drops down to 20%.

Note: All physics are calculated purely on the server (or standalone) to prevent desync. Clients interpolate visual changes like steering angles locally for a smooth experience.

Українська Версія

Плагін Spalah Vehicle

Офіційна Документація та Посібник для швидкого старту

Розроблено для платформи Fab (Unreal Engine). Copyright © 2026 ZOAZ. Всі права захищені.

1. Огляд

Spalah — це модульний, оптимізований плагін фізики транспорту для Unreal Engine. Він обходить стандартну реалізацію Chaos vehicle, пропонуючи стабільну та гнучку систему коліс на основі рейкастів/сферкастів (raycast/spherecast). Плагін створено з урахуванням мультиплеєра (вбудована реплікація) та підтримує модульні доповнення, такі як Термальний модуль гальм.

2. Посібник для швидкого старту

  1. Створіть Blueprint: Створіть новий клас Blueprint і виберіть SpalahVehicleCore як батьківський клас.
  2. Налаштуйте Mesh: Відкрийте новий Blueprint, виберіть компонент VehicleMesh та призначте ваш Static Mesh автомобіля. Переконайтеся, що увімкнено Simulate Physics.
  3. Додайте Колеса: Додайте 4 компоненти SpalahWheelComponent у ваш Blueprint. Розмістіть їх там, де мають бути колеса.
    • Встановіть bIsSteerable = true для передніх коліс.
    • Встановіть bIsDriven = true для задніх коліс (або для всіх 4, якщо це повний привід).
  4. Додайте Модулі (Опціонально): Для додавання просунутої логіки додайте компонент SpalahBrakeThermalModule у Blueprint. Він автоматично зареєструється в Ядрі машини.
  5. Налаштуйте Інпут (Керування): В Event Graph підключіть ваші екшени Enhanced Input до вбудованих функцій: SetThrottleInput, SetBrakeInput, та SetSteeringInput.

3. Архітектура та Програмування

ASpalahVehicleCore

Центральний мозок машини. Керує основними фізичними силами, вводом та координує всі модулі.

  • Готовий до Мультиплеєра: Вбудовані серверні RPC (ServerSetSteeringInput тощо) та репліковані змінні.
  • Адаптивне Кермування: Автоматично зменшує максимальний кут повороту на високих швидкостях для кращого контролю.
  • Губернатор Швидкості: Суворий контроль MaxSpeedKmh, щоб запобігти нереалістичним польотам машини.

USpalahWheelComponent

Компонент-сфера (SphereComponent), що працює як підвіска та пляма контакту.

  • Використовує закон Гука (Жорсткість пружини + Демпфування) для розрахунку підвіски.
  • Розраховує суворе бокове тертя (TireMaxLateralGrip), щоб запобігти смиканню та дозволити плавний дрифт.

USpalahBrakeThermalModule

Приклад потужної системи модулів. Розраховує температуру гальм.

  • Нагрівання: Базується на поточній швидкості та силі натискання на гальмо.
  • Охолодження: Пасивне охолодження повітрям, що масштабується зі швидкістю. Включає екстремальне охолодження у воді (викликає візуальний ефект пари).
  • Втрата ефективності (Brake Fade): Якщо температура перевищує MaxOptimalTemperature, ефективність гальм плавно падає до 20%.

Примітка: Уся фізика розраховується суто на сервері (або в одиночній грі) для уникнення розсинхронізації. Клієнти інтерполюють візуальні зміни, такі як кут повороту коліс, локально для плавності.