/aorc-client

Primary LanguageC#MIT LicenseMIT

Art Of Rally Championship Mod

GitHub license

A mod that allows for real-time streaming of data via websockets to a server which forwards them to one or more observers.

Discord

Art Or Rally Discord

Launcher Support

Platform Support

Usage

Website

  1. Download the client and install it using the Unity Mod Manager
  2. Download the server
  3. Open the reference controller site to see the data

Features

Multiple clients and observers can connect to a single server

Streaming of real-time data

  • Inputs like throttle, clutch, breaks etc.
  • Position, Rotation, Velocity
  • Car state & hidden stats like RPM, current gear, wheel tire velocity, etc.
  • Timer state

Game State Updates

  • Level Loading
  • Event Starting this is under construction
    • Level data
    • Car data
  • Event Over this is under construction
    • Final time

Remote Control

This is under construction

Controller Development

Every controller has to connect to the server

This mod uses socket.io

NuGet

This gives you an overview of the protocol you can use from a controller

Route fragment: /controllers

All events have the following format:

interface ClientData<T> {
  user: string;
  data: T;
}

type Vector3 = [number, number, number]; // float

Events

userJoined

Emitted when a user joined

data: undefined

userLeft

Emitted when a user left

data: undefined

loadLevel

Emitted when a level is loaded

data: number (level ID)

stageUpdate

Emitted when the in-game timer changes

data:

export interface PositionData {
  position: Vector3
  rotation: Vector3
  velocity: Vector3
}

export interface AssistanceData {
  absTriggered: number // float
  tcsTriggered: number // float
  espTriggered: number // float
}

export interface InputData {
  throttleInput: number // float
  steeringInput: number // float
  brakeInput: number // float
  handbrakeInput: number // float
  clutchInput: number // float
}

export interface CarData {
  positionData?: PositionData
  inputData?: InputData
  brakeData?: BrakeData
  drivetrain?: DrivetrainData
  assistance?: AssistanceData
}

export interface BrakeData {
  temperatureBack: number // float
  temperatureFront: number // float
}

export interface DrivetrainData {
  clutch: number // float
  rpm: number // float
  torque: number // float
  gear: number // int
  wheelTireVelocity: number // float
  canStall: boolean
  throttle: number // float
  shiftTriggered: boolean
  canShiftAgain: boolean
  currentPower: number // float
  currentGearRatio: number // float
  isChangingGear: boolean
  velocity: number // float
  isStalli

waypointsGathered

When the level has loaded, a list of all waypoints in that level will be sent

type waypoints = Vector3[]; // float

eventStart

eventOver

interface EventOverData {
  terminalDamage: boolean;
  finalTime: number; // seconds fraction
  penalties: number; // int
}

carsInfo

data: takes whatever raw data there is in memory and serializes it to JSON.

stagesInfo

data: takes whatever raw data there is in memory and serializes it to JSON.

Actions