A mod that allows for real-time streaming of data via websockets to a server which forwards them to one or more observers.
- Download the client and install it using the Unity Mod Manager
- Download the server
- Open the reference controller site to see the data
Multiple clients and observers can connect to a single server
- Inputs like throttle, clutch, breaks etc.
- Position, Rotation, Velocity
- Car state & hidden stats like RPM, current gear, wheel tire velocity, etc.
- Timer state
- Level Loading
- Event Starting this is under construction
- Level data
- Car data
- Event Over this is under construction
- Final time
This is under construction
Every controller has to connect to the server
This mod uses socket.io
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
Emitted when a user joined
data: undefined
Emitted when a user left
data: undefined
Emitted when a level is loaded
data: number
(level ID)
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
When the level has loaded, a list of all waypoints in that level will be sent
type waypoints = Vector3[]; // float
interface EventOverData {
terminalDamage: boolean;
finalTime: number; // seconds fraction
penalties: number; // int
}
data: takes whatever raw data there is in memory and serializes it to JSON.
data: takes whatever raw data there is in memory and serializes it to JSON.