RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Drag Race DebugDrag Tree DisplayDrag Race APIDrag Racing ManagerDrag Strip Save SystemDrag Race TimingDrag Race Phases
Bracket Drag RaceDrag Practice RaceHeads-Up Drag Race

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE ExtensionsgameplaydragdragTypes

Bracket Drag Race

Reference for `gameplay_drag_dragTypes_bracketRace`, which implements the bracket-style drag race where racers have a dial-in time and staggered starts.

Reference for gameplay_drag_dragTypes_bracketRace, which implements the bracket-style drag race where racers have a dial-in time and staggered starts.


Overview

In a bracket race, each racer has a dial-in (predicted) quarter-mile time. The slower racer launches first by the difference in dials, giving both an equal chance. The winner is whoever gets closest to their dial without going under ("breaking out"). This extension manages phase progression with dependency-based synchronisation.


Dependencies

gameplay_drag_general, gameplay_drag_utils


Exports

| Function | Signature | Description | |------ | M.dependencies | table | {"gameplay_drag_general", "gameplay_drag_utils"} |----|-----------|-------------| | onExtensionLoaded | () | Caches references to general and utils | | onUpdate | (dtReal, dtSim, dtRaw) | Main loop - updates racers, runs phase logic | | startDebugPhase | (pIndex, dData) | Jump all racers to a specific phase for testing | | startActivity | () | Begin the race; sets dials from racer timer data | | resetDragRace | () | Delegates to general reset, clears local flags |


Internals

SymbolPurpose
hasActivityStartedGate for the onUpdate loop
debugStartFlag for debug-phase jumping
minDistance0.8 m - unused distance threshold
minVelToStop15 m/s - unused velocity threshold

How It Works

-- startActivity fetches dragData and builds dials with actual dial values
gameplay_drag_dragTypes_bracketRace.startActivity()

-- Each frame, onUpdate iterates all racers:
-- 1. updateRacer(racer) - refresh position, speed, wheel positions
-- 2. Execute current phase function: dUtils[phase.name](phase, racer, dtSim)
-- 3. If phase completed and no dependency → advance racer
-- 4. If all racers' current phase completed (dependency phase) → advance all

Phase progression uses a dependency system:

  • Dependent phases (e.g. stage, countdown) require ALL racers to complete before advancing
  • Independent phases (e.g. race, stop) let each racer advance individually

The dial offset creates the staggered start - the slower racer's tree starts first, calculated by dUtils.setDialsData().


Key Behaviors

  • Dials are sourced from racer.timers.dial.value (set during setupRacer)
  • Phase functions (stage, countdown, race, stop) live in gameplay_drag_utils
  • isActivityFinished is true when every racer has isFinished == true
  • dragData.isCompleted is set when the activity finishes

Module Variables

VariableTypeDescription
M.dependenciestable{"gameplay_drag_general", "gameplay_drag_utils"}
M.onExtensionLoaded()-
M.onUpdate(dtReal, dtSim, dtRaw)-
M.resetDragRace()-
M.startActivity()-
M.startDebugPhase(pIndex, dData)-

See Also

  • drag/dragTypes/dragPracticeRace - Solo Practice Drag Race - Related reference
  • drag/dragTypes/headsUpDrag - Heads-Up Drag Race - Related reference
  • Gameplay Systems Guide - Guide

Drag Race Phases

Reference for `gameplay_drag_utils`, which provides all phase functions (`stage`, `countdown`, `race`, `stop`, `emergencyStop`), racer position tracking, tree light processing, win conditions, and bou

Drag Practice Race

Reference for `gameplay_drag_dragTypes_dragPracticeRace`, which implements a single-player practice drag race with automatic cleanup.

On this page

OverviewDependenciesExportsInternalsHow It WorksKey BehaviorsModule VariablesSee Also