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.
setExternalLeader. ACC cruise speed is set slightly above the predecessor speed so gap control closes the formation.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.leaderId, followerId, vehicleId — numeric simulation object IDsplatoonId — platoon incrementing ID returned by createleaderMode — leader driving mode on launch:
0 — manual1 — span2 — traffic3 — ACCspeed — commanded platoon speed in m/sindex — optional 0-based insertion index for join (0 = before the current leader, 1 = before the first follower, omit to append at the tail)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.
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.
launch API documents leader modes 0–2. Mode 3 (ACC leader) is available through the Lua API.Was this article helpful?