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
Rally Utility ColorsRally JSONL UtilitiesRally Utility Normalizer

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 Extensionsgameplayrallyutil

Rally JSONL Utilities

Utility module for reading JSON Lines (JSONL) files - line-delimited JSON format used for recce recordings (driveline, cuts, transcripts).

Utility module for reading JSON Lines (JSONL) files - line-delimited JSON format used for recce recordings (driveline, cuts, transcripts).


Public API

FunctionSignatureReturnsDescription
startsWithDoubleSlash(line)boolCheck if line is a // comment
readFileToMemory(fname)string?Read entire file contents via io.open
splitIntoLines(content)tableSplit string into array of lines
parseJsonlFile(fname, processLine, rallyUtil)results, errParse JSONL file with optional transform callback
readJsonlLines(fname, callback)boolSimple line-by-line reader using io.lines
M.parseJsonlFile(fname, processLine, rallyUtil)-processLine(obj) should return the processed object or nil to skip
M.readFileToMemory(fname)-Read entire file into memory
M.readJsonlLines(fname, callback)-Calls callback(obj) for each line
M.splitIntoLines(content)-Split content into lines
M.startsWithDoubleSlash(line)-Check if a line starts with a comment marker

How It Works

parseJsonlFile(fname, processLine, rallyUtil)

  1. Checks file existence via FS:fileExists
  2. Reads entire file into memory
  3. Splits into lines, trims whitespace (using rallyUtil.trimString)
  4. Skips empty lines and // comments
  5. Decodes each line as JSON via jsonDecode
  6. Optionally transforms via processLine(obj) callback
  7. Returns array of parsed objects

readJsonlLines(fname, callback)

Simpler alternative using io.lines iterator. Calls callback(obj) for each decoded line. No comment handling or trimming.

local jsonlUtils = require('gameplay/rally/util/jsonlUtils')
local rallyUtil = require('gameplay/rally/util')

-- Parse a driveline recording
local points, err = jsonlUtils.parseJsonlFile(
  '/path/to/driveline.json',
  function(obj)
    obj.pos = vec3(obj.pos)
    return obj
  end,
  rallyUtil
)

-- Simple read
jsonlUtils.readJsonlLines('/path/to/data.jsonl', function(obj)
  print(obj.ts, obj.pos.x)
end)

Notes

  • JSONL format: one JSON object per line, no wrapping array
  • Comment lines starting with // are supported by parseJsonlFile only
  • readFileToMemory uses raw io.open, not BeamNG's FS API
  • parseJsonlFile uses FS:fileExists for the existence check

See Also

  • Rally Utility Colors - Related reference
  • Rally Utility Normalizer - Related reference
  • Gameplay Systems Guide - Guide

Rally Utility Colors

Constants module defining all color values and visual parameters used throughout the rally editor and pacenote system. Colors are RGB float arrays `{r, g, b}` or ImGui `ImVec4` for UI elements.

Rally Utility Normalizer

Simple text normalization module that applies word-replacement mappings to pacenote strings.

On this page

Public APIHow It WorksparseJsonlFile(fname, processLine, rallyUtil)readJsonlLines(fname, callback)NotesSee Also