# Race Config

This guide configures live race behavior in `config/racing.lua`, which controls race limits, anti-cheat checks, and runtime performance.

## Before You Start

* VibesEZ-Race installed and running.
* Access to edit `config/racing.lua`.
* At least one test account for in-game race validation.

## Configure Race Runtime Limits

1. Open `config/racing.lua`.
2. Set the core race limits in `Racing`.

```lua
-- File: config/racing.lua
Racing = {
	maxActiveRaces = 6,     -- EDIT THIS
	dnfTimeoutMs = 120000,  -- EDIT THIS
	rewardCleanupMs = 10000 -- EDIT THIS
	-- ...
}
```

> **Note:** Keep values aligned with your server population and map size to avoid abandoned race sessions.

## Configure Anti-Cheat Behavior

1. Open `config/racing.lua`.
2. Set anti-cheat enforcement in `Racing.antiCheat`.

```lua
-- File: config/racing.lua
antiCheat = {
	enabled = true,         -- EDIT THIS
	violationLimit = 2,     -- EDIT THIS
	action = 'dnf',         -- EDIT THIS: dnf | kick | log
	speedCap = {
		enabled = true,     -- EDIT THIS
		speedLeewayKmh = 25 -- EDIT THIS
	}
}
```

> **Warning:** Setting `action = 'kick'` can remove players from active races after repeated violations.

## Configure Performance Controls

1. Open `config/racing.lua`.
2. Set cache and rate-limit values in `Performance`.

```lua
-- File: config/racing.lua
Performance = {
	debugLogs = false, -- EDIT THIS
	rateLimit = {
		enabled = true -- EDIT THIS
	},
	profiler = {
		enabled = false -- EDIT THIS
	}
}
```

> **Tip:** Enable profiler only during diagnostics, then disable it for normal production runtime.

## Verify

1. Restart the `VibesEZ-Race` resource.
2. Host one public race.
3. Complete one race from start to payout.
4. Confirm the console shows no anti-cheat false positives.

## See Also

* [Configuration Overview](/vibesez/docs/configuration/overview.md)
* [Initial Setup](https://github.com/VibesEZ/VibesEZ-Race/blob/claude-docs/docs/getting-started/initial-setup.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vibesez.gitbook.io/vibesez/docs/configuration/race-config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
