Vehicle Platooning

Overview

Vehicle platooning coordinates multiple vehicles so they move together, in the context of autonomous or semi-autonomous driving. The motivation for this can be to improve road safety, traffic congestion, to reduce fuel consumption, to save time and/or human resources on driving or other. A leader sets the platoon pace, and each follower tracks the vehicle directly ahead using Adaptive Cruise Control (ACC) with an external leader and AI follow mode.

Platoon management runs in the game engine (lua/ge/extensions/tech/platooning.lua). Each vehicle loads a matching vehicle extension (lua/vehicle/extensions/tech/platooning.lua) that publishes kinematics, applies ACC control for followers, and configures the leader’s driving mode on launch.

Multiple Platoons Multiple Platoons

How it works

  1. Formation — A platoon is created with a leader and one follower. Additional vehicles can join at the tail or at a specific index. Each vehicle receives platoon state (role, predecessor, commanded speed, launch status).
  2. Leader control — On launch, the leader is driven in one of four modes: manual, span, traffic, or ACC. It is also given a target speed.
  3. Follower control — Followers run ACC in external-leader mode. The predecessor’s filtered speed and longitudinal acceleration are published through a mailbox each frame and fed into setExternalLeader. ACC cruise speed is set slightly above the predecessor speed so gap control closes the formation.
  4. Departure and recovery — Any vehicle, including the leader, can leave with leave. If the platoon has only two vehicles when leave is called, it is disbanded instead. A follower that loses predecessor kinematics for too long, or that overrides ACC with the brake pedal, leaves automatically. Remaining vehicles are re-indexed and continue following their new predecessor.
  5. Split — A platoon with at least four vehicles can be split into two platoons at a valid index. Both resulting platoons keep the current launch mode and commanded speed.

Usage

Inputs

  • leaderId, followerId, vehicleId — numeric simulation object IDs
  • platoonId — platoon incrementing ID returned by create
  • leaderMode — leader driving mode on launch:
    • 0 — manual
    • 1 — span
    • 2 — traffic
    • 3 — ACC
  • speed — commanded platoon speed in m/s
  • index — optional 0-based insertion index for join (0 = before the current leader, 1 = before the first follower, omit to append at the tail)

Lua

Platoon commands run in the game engine Lua console.

  • extensions.tech_platooning.create(leaderId, followerId) — Creates a two-vehicle platoon and returns a platoonId.

  • extensions.tech_platooning.join(platoonId, followerId, index) — Adds a vehicle to the platoon. Omit index to append at the tail.

  • extensions.tech_platooning.launch(platoonId, leaderMode, speed) — Launches the platoon by setting the leader’s driving mode and target speed.

  • extensions.tech_platooning.changeSpeed(platoonId, speed) — Updates the commanded speed of a launched platoon.

  • extensions.tech_platooning.leave(platoonId, vehicleId) — Removes a vehicle from the platoon and returns it to manual control. Disbands the platoon if it currently has only two vehicles.

  • extensions.tech_platooning.split(platoonId, index) — Splits the platoon into two platoons. index is the number of vehicles kept in the front platoon (1-based, between 2 and n − 2 for a platoon of size n). Requires at least four vehicles. Returns the new rear platoon id.

  • extensions.tech_platooning.disband(platoonId) — Unloads platooning from all vehicles and removes the platoon.

BeamNGpy

Platooning is exposed through the simulator API. For details, see the BeamNGpy documentation .

For a practical example, see the platooning example in the BeamNGpy repository.

Limitations

  • Formation proximity — Vehicles should be close to their intended position in the chain when joining (on the order of ~10 m) so AI follow mode can lock onto the predecessor.
  • Manual leader throttle — In manual leader mode, accelerate gently. Aggressive throttle can temporarily lead to a big gap behind the leader.
  • Tight maneuvers — The platoon is not tuned for demanding maneuvers such as high-speed 180-degree turns.
  • Leader modes in BeamNGpy — The BeamNGpy launch API documents leader modes 02. Mode 3 (ACC leader) is available through the Lua API.
Last modified: August 20, 2026

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.