# Inside Track

**Inside Track** is a virtual horse-racing betting game inside the casino.

Players place bets on horses, watch the race result, and win chips if their horse finishes first.

<div data-full-width="false"><figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-4a569ca8109d2e91aa6be8aaca25cf7a28ba98b1%2Fcapt_it.png?alt=media" alt="Inside Track"><figcaption></figcaption></figure></div>

## What game is it?

Inside Track is a betting mini-game with two race modes:

* **Single Event (Local Race)**: a quick race for an individual terminal/chair.
* **Main Event**: a shared race for players in the same Inside Track room.

Both modes use horse odds and bet amount to calculate potential winnings.

## How to play

1. Sit at an Inside Track terminal/chair.
2. Choose race mode:
   * Local/Single Event, or
   * Main Event.
3. Pick a horse.
4. Enter bet amount (or use horse ticket bonus if supported).
5. Confirm ticket before betting timer ends.
6. Watch race result.
7. If your horse wins, collect the payout.

## Bet types

<table data-full-width="false"><thead><tr><th>Type</th><th>Description</th><th>Typical use</th></tr></thead><tbody><tr><td><code>Single Event</code></td><td>Per-chair local race with fast repeat rounds.</td><td>Solo/quick betting sessions</td></tr><tr><td><code>Main Event</code></td><td>Shared room race with pre-race countdown and common winner board.</td><td>Group play / social betting</td></tr></tbody></table>

## Horse odds

Horse odds are multipliers that affect potential winnings.

* Lower odds (example: `2`) = lower payout, usually safer pick.
* Higher odds (example: `15` or `30`) = higher payout, usually riskier pick.

Odds ranges are configured per mode in `HorseGamingRooms`:

* `MainEventHorseOdds`
* `LocalRaceHorseOdds`

## How winning money is calculated

Payout logic uses the horse odds multiplier:

```lua
winnings = bet * horse_odds
```

Example A:

* Bet: `500`
* Odds: `6`
* Winnings: `500 * 6 = 3000`

Example B:

* Bet: `1000`
* Odds: `15`
* Winnings: `15000`

If the selected horse does not win, the bet is lost.

## Where to configure Inside Track

Main config file:

* `rcore_casino/configs/insidetrack.lua`
* table: `HorseGamingRooms`

Important sections to tune:

* Main Event timing/limits (`MainEvent*`)
* Local race timing/limits (`LocalRace*`)
* Odds ranges (`MainEventHorseOdds`, `LocalRaceHorseOdds`)
* Cooldowns (`MainEventCooldown`, `LocalRaceCooldown`)
* Big screen setup (`BigScreen*`)
* Chair list (`ComputerChairs`)

## Example HorseGamingRooms config

```lua
HorseGamingRooms = {
  ["casinoit"] = {
    name = "Inside Track",
    societyEnabled = true,
    societyName = "society_casino",
    proximity = 5.0,
    loadInInterior = true,

    -- Main Event
    MainEventEnabled = true,
    MainEventStartingSoonTime = 1,
    MainEventMinPlayers = 1,
    MainEventBettingTime = 5,
    MainEventRaceDuration = 5,
    MainEventHorseOdds = {2, 5, 6, 15, 16, 30},
    MainEventMinBet = 10,
    MainEventMaxBet = 10000,
    MainEventCooldown = 0,
    MainEventWinChance = 50,

    -- Single Event (Local)
    LocalRaceDuration = 5,
    LocalRaceHorseOdds = {2, 5, 6, 15, 16, 30},
    LocalRaceMinBet = 10,
    LocalRaceMaxBet = 10000,
    LocalRaceCooldown = 0,
    LocalRaceWinChance = 50,

    -- Screen / room
    coords = vec3(951.582275, 76.532051, 70.958191),
    BigScreenModel = "vw_vwint01_betting_screen",
    BigScreenTextureName = "casinoscreen_02"
  }
}
```
