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
Crawl BoundariesCrawl Flowgraph BridgeCrawl DebugCrawl UI DisplayCrawl Flowgraph BridgeCrawl SystemCrawl Save SystemCrawl Engine

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 Extensionsgameplaycrawl

Crawl Boundaries

Reference for `gameplay_crawl_boundary`, which manages spatial boundaries for rock crawling trails. Spawns animated flag markers along boundaries, checks crawler positions against boundary zones, and

Reference for gameplay_crawl_boundary, which manages spatial boundaries for rock crawling trails. Spawns animated flag markers along boundaries, checks crawler positions against boundary zones, and applies penalties/DNF for violations.


Overview

This extension handles three core responsibilities for crawl boundaries:

  1. Marker spawning - Places flag markers along boundary perimeters with proximity-based show/hide animations
  2. Boundary checking - Determines if crawler vehicle corners are inside the boundary zone
  3. Penalty enforcement - Tracks exit points and applies DNF if a crawler strays 10+ meters outside

Uses a quadtree for efficient proximity queries of boundary markers.


Exports

FunctionSignatureDescription
spawnBoundaryMarkers(boundary, spacing)Place flag markers along a boundary perimeter
cleanupBoundaryMarkers()Remove all spawned markers and reset tracking
checkBoundary(site, crawler, crawlStates)Check if a crawler is within bounds
updateBoundaryAnimations(dtSim)Animate marker visibility based on player proximity
resetBoundaryObjects()Reset all marker states
setVisibilityRadius(radius)Set marker show/hide distance (default 100m)
setAnimationTiming(duration, fadeIn, fadeOut, scaleUp)Configure animation durations
rebuildQuadtree()Rebuild spatial index for markers
getQuadtreeStats()Get debug stats about the quadtree
triggerAppearingAnimation()Force all visible markers to re-animate
clearCrawlerExitPoint(crawlerId)Clear exit tracking for a specific crawler
clearAllExitPoints()Clear all exit tracking data

Boundary Checking Logic

checkBoundary() evaluates all corners of the crawler vehicle:

  1. If all corners inside - crawler is within bounds, exit tracking is cleared
  2. If some corners outside - boundary violation penalty applied (with cooldown)
  3. If all corners outside AND 10+ meters from exit point - DNF penalty applied once

Exit points are tracked per crawler: the first position where the vehicle leaves the boundary is saved, and distance from that point determines DNF.


Marker Animation System

Markers use a proximity-based animation with four states:

  • "hidden" - Object is hidden, scale at minimum
  • "appearing" - Fading in + scaling up over animationDuration
  • "visible" - Fully shown at max scale
  • "disappearing" - Fading out over fadeOutDuration

Default animation timing:

ParameterDefault
animationDuration0.5s
fadeInDuration0.3s
fadeOutDuration0.2s
scaleUpDuration0.4s
visibilityRadius100m
M.checkBoundary(site, crawler, crawlStates)
M.cleanupBoundaryMarkers()
M.clearAllExitPoints()
M.clearCrawlerExitPoint(crawlerId)
M.getQuadtreeStats()
M.rebuildQuadtree()
M.resetBoundaryObjects()
M.setAnimationTiming(duration, fadeIn, fadeOut, scaleUp)
M.setVisibilityRadius(radius)
M.spawnBoundaryMarkers(boundary, spacing)
M.triggerAppearingAnimation()
M.updateBoundaryAnimations(dtSim)

How It Works

-- Spawn markers along a boundary with 5m spacing
gameplay_crawl_boundary.spawnBoundaryMarkers(boundary, 5.0)

-- Per-frame animation update
gameplay_crawl_boundary.updateBoundaryAnimations(dtSim)

-- Check if crawler is in bounds
local inBounds = gameplay_crawl_boundary.checkBoundary(site, crawlerData, crawlStates)

-- Cleanup
gameplay_crawl_boundary.cleanupBoundaryMarkers()

Key Behaviors

  • Markers use TSStatic objects with the /art/shapes/race/flagMarker.dae mesh
  • Markers are grouped under a SimGroup named "BoundaryMarkers"
  • Terrain height and normal are used for proper marker placement
  • Markers on steep terrain (normal dot < 0.5 with world up) are skipped
  • Uses smootherstep interpolation for smooth animations
  • instanceColor alpha channel controls visibility during animations

See Also

  • crawl/crawlFlowgraphBridge - Crawl Flowgraph Bridge (Legacy) - Related reference
  • crawl/debug - Crawl Debug Window - Related reference
  • crawl/display - Crawl UI Messages - Related reference
  • Gameplay Systems Guide - Guide

Crash Test Scenario Manager

Reference for `gameplay_crashTest_scenarioManager`, the main orchestrator for crash test missions. Manages multi-step crash test scenarios including vehicle setup, AI control, crash detection, scoring

Crawl Flowgraph Bridge

Reference for `gameplay_crawl_crawlFlowgraphBridge`, a bridge extension that exposes crawl system functionality to flowgraph nodes. This appears to be a legacy version - see also `gameplay_crawl_flowg

On this page

OverviewExportsBoundary Checking LogicMarker Animation SystemHow It WorksKey BehaviorsSee Also