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
Rally Audio ManagerRally Camera Path PlayerRally ClientRally Cut CaptureRally EnumsRally Extension HelperRally GeometryRally ManagerRecce ManagerRecce AppRecce SettingsRally Settings ManagerSnap-to-RoadTraffic Exclusion ZonesRally UtilityRally Vehicle CaptureRally Vehicle Tracker

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 Extensionsgameplayrally

Rally Geometry

Early work-in-progress rally co-driver system. Generates pacenotes from a route by analyzing road geometry - computing turn radius, velocity, severity, and direction for each node, then splitting and

Early work-in-progress rally co-driver system. Generates pacenotes from a route by analyzing road geometry - computing turn radius, velocity, severity, and direction for each node, then splitting and simplifying into human-readable pacenote calls (e.g., "3 left long"). Renders pacenotes as colored 3D overlays in the world.


Public API

FunctionSignatureReturnsDescription
M.onUpdate(dt, dtSim)nilPer-frame update: generates/loads pacenotes, renders them based on vehicle state

Internals

Key Local Functions

FunctionDescription
circleDist1Dist2CenterAngleFromPoints(p1,p2,p3)Fits a circle through 3 points; returns distances, center, and arc angle
getTurnVelocityWithSlickTires(radius)Calculates max cornering speed from radius using v = sqrt(μ·g·r) with μ=1.7
computeNodeData(route)Annotates each route node with center, radius, velocity, severity, direction, angle
computePacenoteData(pacenote)Aggregates node data into a pacenote (time, length, angle, name)
splitRouteIntoPacenotes(route)Splits route at direction changes into raw pacenote segments
simplifyPacenotes(pacenotes)Iteratively merges straights by extending next/prev and combining consecutive
getPacenotesFromRoute(route)Full pipeline: computeNodeData → split → simplify
renderNode(node, renderLine, renderText)Debug-draws a single route node with sphere, cylinder, and text
renderPacenote(pacenote, txt)Draws a pacenote as colored cylinders with label at the start
renderNextPacenotes(...)Shows upcoming pacenotes based on time/distance prediction
renderAllPacenotes(pacenotes, showNodes)Draws all pacenotes; optionally shows individual nodes
getPacenoteText(pacenote)Formats pacenote into text like "3 left long tightens"
getPacenoteCall(txt, pacenote, pacenoteNext)Appends link text ("into", distance) between consecutive pacenotes

Severity Table

Pacenotes are classified by max cornering velocity:

NameMax Velocity (km/h)Color
Hairpin / K50dark violet
280dark red
3110dark orange
4150dark green
5200dark cyan
6300dark blue
(straight)∞white

Route Sources

  • Ground markers: Uses core_groundMarkers.routePlanner.path to get A→B route, optimized via map.optimizePath
  • File cache: Falls back to temp/rally_route_{level}.json encoded with lpack

Pacenote Name Logic

  • Hairpin: angle < 60° → "Slow", < 120° → "K", else "Hairpin"
  • Straight: length < 10m → "into", < 20m → "then", else rounded distance (e.g., "50")
  • Modifiers: "long" (>3s), "short" (<0.7s), "tightens" (60%+ speed drop), "opens" (inverse)

How It Works

  1. On update, checks if ground markers target exists
  2. Generates route from A→B using map.getGraphpath + map.optimizePath
  3. Computes per-node geometry (circle fitting, radius, velocity, severity)
  4. Splits into pacenotes at direction changes, then simplifies by merging straights
  5. At standstill: renders all pacenotes; while moving: renders upcoming pacenotes by predicted time window (4 seconds ahead)
  6. Displays current pacenote call via ScenarioRealtimeDisplay GUI hook

Usage Example

-- This module runs automatically via onUpdate when ground markers are active
-- No direct API calls needed; pacenotes appear as 3D overlays on the route

See Also

  • Rally Audio Manager - Related reference
  • Rally Camera Path Player - Related reference
  • Rally Client - Related reference
  • Gameplay Systems Guide - Guide

Rally Extension Helper

Stub extension for rally gameplay. Provides empty `load` and `unload` lifecycle hooks. Currently contains no functional logic - serves as a placeholder for future rally extension management.

Rally Manager

Central runtime manager for a rally stage. Coordinates the notebook, driveline route, audio manager, vehicle tracker, and pacenote queue during gameplay.

On this page

Public APIInternalsKey Local FunctionsSeverity TableRoute SourcesPacenote Name LogicHow It WorksUsage ExampleSee Also