Skip to content

Lua sections need revision: This page contains removed v5 APIs or old runtime examples. Do not use its Lua examples for current development. Start with Platform v1.

Vehicles & Parts Manual

This manual details the rigid-body vehicle physics simulation, powertrain calculations, and modular part systems in Cataclysm: Cleanwater Bomb (CCB).


1. Rigid-Body Vehicle Physics

Vehicles in CCB operate as multi-part 2D rigid bodies:

  • Center of Mass & Weight Distribution: Parts (engines, armor plates, water tanks) dynamically shift vehicle mass and inertia tensors, directly governing roll-over tendencies during sharp turns.
  • Powertrain & Aerodynamics: Combines engine horsepower, torque curves, tire rolling resistance, and frontal aerodynamic drag.
  • Traction & Ground Conditions: Differentiates off-road vs highway tires across mud, deep water, and asphalt.

2. Modular Part Architecture (vpart_reference)

  • Frames & Chassis: Structural foundation.
  • Powertrain: Diesel/gasoline engines, electric motors, batteries, solar panels.
  • Storage & Tanks: Cargo trunks, vehicle freezers, and integrated fluid reservoirs.
  • Armor & Weapon Mounts: Composite ballistic armor and autonomous automated turrets.

3. Core APIs

vehicle:get_speed() -> integer

Returns real-time vehicle velocity.

vehicle:fuel_left(fuel_type) -> integer

Queries total remaining fuel or stored electrical charge.