Author Topic: Robertsmania Replay - iRacing Replay Plugin  (Read 3646 times)

Robertsmania

  • Newbie
  • *
  • Posts: 46
Robertsmania Replay - iRacing Replay Plugin
« on: August 29, 2023, 11:37:35 PM »
Robertsmania Replay - iRacing Replay System

https://github.com/Robertsmania/RobertsmaniaReplay

This project presents a plugin for VoiceAttack that integrates with the iRacing SDK to monitor race events and build a list of event markers to be used for replay review.

The iRacing telemetry data is monitored constantly and markers are recorded when any driver has an offtrack incident, overtake, undertake, or radio broadcast.  The race start and driver finishes are also entered as markers.

The replay marker data can be reviewed and filtered by car and/or marker type.  This makes it easy to go through the replay seeing all the events that were recorded for a specific car, all the events of a particular marker type for any car, or any marker type for any car.

For example:
  • "Filter markers by the current car" Then stepping forward or backward through the next/previous markers will keep the focus on the current car. 
    This alone is an improvement over the native iRacing next/previous incident review.
  • "Filter markers by overtakes" Then only overtake markers will be presented, and still focus will be on the current car.
  • "Clear the marker filters" Return to the default state where all marker types for all cars will be presented.

The provided profile has commands that can be used with speech, but is also intended to work with a gamepad/controller so the use of speech recognition is not required.

Controller
This is the controller configuration I use, and what is in the provided VoiceAttack profile.  The goal is to make it easy to use the controller to review the replay data.  If you are not using voice commands, you will still need to interact with the standard iRacing UI to change cameras.  Also note that NUMLOCK on your keyboard will interfere with some of the controls, if things do not appear to be working try toggling NUMLOCK.



The analog stick and trigger inputs are not assigned.  You might experiment with mapping those to control the iRacing camera position/orientation to be able to fly the camera around as well. I've tried this with some success but your mileage may vary.

Of course you do not have to use a controller at all.  You can bind keyboard/mouse/speech to any command and configure your system however you like.

Profile Commands
These are the high level commands in the provided profile:

Spoken CommandButtonCategory
Car aheadJoystick 1 Button 10A1 Replay Controller
Car behindJoystick 1 Button 9A1 Replay Controller
Cycle Marker [Type] FilterJoystick 1 Button 2A1 Replay Controller
End of recordingA1 Replay Controller
Fast forwardJoystick 1 POV 2A1 Replay Controller
Frame backwardA1 Replay Controller
Frame forwardA1 Replay Controller
Next cameraA1 Replay Controller
Next iRacing incidentA1 Replay Controller
Next lapJoystick 1 Button 6A1 Replay Controller
Next markerJoystick 1 Button 3A1 Replay Controller
Play PauseJoystick 1 POV 1A1 Replay Controller
Previous cameraA1 Replay Controller
Previous iRacing incidentA1 Replay Controller
Previous lapJoystick 1 Button 5A1 Replay Controller
Previous markerJoystick 1 Button 1A1 Replay Controller
Race StartJoystick 1 Button 7A1 Replay Controller
RewindJoystick 1 POV 4A1 Replay Controller
Show my carJoystick 1 Button 9 + Button 10A1 Replay Controller
Slow motionJoystick 1 POV 3A1 Replay Controller
Toggle Car [Marker] FilterJoystick 1 Button 4A1 Replay Controller
Clear [the;] Marker Car [Filter;]A2 Markers
Clear [the;] Marker [Filters; filter]Joystick 1 Button 8A2 Markers
Clear [the;] Marker Type [Filter;]A2 Markers
Filter markers [by; for; with;] car numberA2 Markers
Filter Markers [by; for; with;] IncidentsA2 Markers
Filter Markers [by; for; with;] manualA2 Markers
Filter markers [by; for; with;] [my car; me]A2 Markers
Filter Markers [by; for; with;] OvertakesA2 Markers
Filter Markers [by; for; with;] Radio [broadcasts; salt; chatter; talk; transmissions;]A2 Markers
Filter markers [by; for; with;] [the;] [current; this] [car; driver]A2 Markers
Filter Markers [by; for; with;] UndertakesA2 Markers
[Marker summary; Summarize markers]A2 Markers
Set [a; new;] markerA2 Markers
[change; set;] [camera;] [to;] blimp [camera;]A3 Cameras
[change; set;] [camera;] [to;] chase [camera;]A3 Cameras
[change; set;] [camera;] [to;] cockpit [camera;]A3 Cameras
[change; set;] [camera;] [to;] far chase [camera;]A3 Cameras
[change; set;] [camera;] [to;] gearbox [camera;]A3 Cameras
[change; set;] [camera;] [to;] gyro [camera;]A3 Cameras
[change; set;] [camera;] [to;] left front [suspension;] [camera;]A3 Cameras
[change; set;] [camera;] [to;] left rear [suspension;] [camera;]A3 Cameras
[change; set;] [camera;] [to;] nose [camera;]A3 Cameras
[change; set;] [camera;] [to;] pit lane 2 [camera;]A3 Cameras
[change; set;] [camera;] [to;] pit lane [camera;]A3 Cameras
[change; set;] [camera;] [to;] rear chase [camera;]A3 Cameras
[change; set;] [camera;] [to;] right front [suspension;] [camera;]A3 Cameras
[change; set;] [camera;] [to;] right rear [suspension;] [camera;]A3 Cameras
[change; set;] [camera;] [to;] [rollbar; roll bar] [camera;]A3 Cameras
[change; set;] [camera;] [to;] scenic [camera;]A3 Cameras
[change; set;] [camera;] [to;] [the;] chopper [camera;]A3 Cameras
[change; set;] [camera;] [to;] [tv 1; tv1] [camera;]A3 Cameras
[change; set;] [camera;] [to;] [tv 2; tv2] [camera;]A3 Cameras
[change; set;] [camera;] [to;] [tv 3; tv3] [camera;]A3 Cameras
[change; set;] [camera;] [to;] TV mixed [camera;]A3 Cameras
[change; set;] [camera;] [to;] TV static [camera;]A3 Cameras
[jump; go; switch; watch; return; show] [to;] [the;] [race;] [start; beginning]A4 Focus
[jump;go;switch;watch;return;show] [to;] [whats happening;] [live;real time;now;the present moment]A4 Focus
[show; watch] most excitingA4 Focus
Watch car numberA4 Focus
Watch car positionA4 Focus
Watch [my car; me]A4 Focus
Watch [the;] car aheadA4 Focus
Watch [the;] car behindA4 Focus
Toggle [say soething; say nothing; speech]A5 Speech
Toggle [say;] announcementsA5 Speech
Print CamerasB1 Debug
Print DriversB1 Debug
Print InfoB1 Debug
Toggle num lockC1 iRacing Keypress
[Initialize; reset; re-initialize] [Pit Girl;] [plugin; data;]RobertsmaniaReplay Plugin Commands


This is a basic set of commands that demonstrates the features of the plugin.  Feel free to create your own, modify these or start from scratch.

Speech
The provided profile does have the commands setup for speech recognition and it will have the system confirm things like camera changes with speech synthesis.

There are two boolean variables set on initialization that control the speech synthesis.  Both of those get set to true by default, but you can esaily change that in the Initialize command.

  • SayAnything - Controls whether anything is said.  If this is true, the system will speak.  If it is false it will not say anything.
  • SayAnnouncements - Secondary value to determine whether announcements like "Kris Roberts had an Overtake" are made when replay markers are played.
    If SayAnything is false, then SayAnnouncements has no effect.

In the default logic of [Next Marker] and [Previous Marker], announcements are made when there is no marker car filter and no marker type filter - it announces the driver and the marker type.  If the marker car filter is set but the maker types are on wildcard, it will announce the marker type.  If the marker type filter is set, it does not announce anything since that seems like it would get annoying to just call out driver names.  Feel free to modify the logic for speech to suit your taste.

Listening - the way I use the system, I have VoiceAttack set to not listen by default.  That makes it so I can talk on stream about whatever and have no fear that it will accidently execute commands if I say words that would otherwise trigger actions.  In the profile options I specify "Pit Girl" on the Profile General tab as the value to "Override listening if my spoken command begins with:".  I encourage you to consider using a different name or identifier for your system.

Plugin Commands
The plugin provides these commands to be used within a VoiceAttack profile:

Code: [Select]
RobertsmaniaReplay commands:

Print_Info
Print_Cameras
Print_Drivers
Set_Camera | {TXT:~~NewCamera}
Get_Camera | {TXT:~~HoldCamera}!
Watch_MyCar
Watch_MostExciting
Watch_CarNumber | {TXT:~~CarNumber}
Watch_CarPosition | {TXT:~~CarPosition}
Check_CarNumber | {TXT:~~CarNumber}!
Check_CarPosition | {TXT:~~CarPosition} {TXT:~~CarNumber}!
Jump_ToLive
Jump_ToBeginning
Marker_Add
PlayMarker_Next | {TXT:MarkerCarFilter} {TXT:MarkerTypeFilter} {INT:~~ReplayBufferSecs}
                | {TXT:~~MarkerDriver}! {TXT:~~MarkerType}!
PlayMarker_Previous | {TXT:MarkerCarFilter} {TXT:MarkerTypeFilter} {INT:~~ReplayBufferSecs}
                    | {TXT:~~MarkerDriver}! {TXT:~~MarkerType}!
PlayMarker_Last
PlayMarker_First
SeekMarker_First
iRacingIncident_Next
iRacingIncident_Previous
Marker_Count | {INT:~~MarkerCount}
Marker_Summary | {TXT:~~MarkerSummary}! {TXT:~~MostOvertakesCarNum}!
                 {TXT:~~MostIncidentsCarNum}! {TXT:~~MostBroadcastsCarNum}!
                 {INT:~~IncidentMarkerCount}! {INT:~~OvertakeMarkerCount}!
                 {INT:~~RadioMarkerCount}! {INT:~~ManualMarkerCount}!
                 {INT:~~UndertakeMarkerCount}!
Marker_Summary_CarNumber | {TXT:~~CarNumber} {INT:~~CarNumberMarkerCount}!
                           {INT:~~CarNumberIncidentMarkerCount}! {INT:~~CarNumberOvertakeMarkerCount}!
                           {INT:~~CarNumberRadioMarkerCount}! {INT:~~CarNumberManualMarkerCount}!
                           {INT:~~CarNumberUndertakeMarkerCount}!

Suggested Use
Start VoiceAttack with the RobertsmaniaReplay profile/plugin setup.

Join an iRacing session.

Participate.

Use the features of the profile/plugin to review the markers of events that happened in the race:
  • Go to the start of the race
  • Set the Marker Car Filter to follow your car
  • Cycle through the race markers showing all the events recorded for your car
  • Go back to the start
  • Clear the Marker Filters
  • Set the Marker Type Filter to something specific like Overtakes
  • Cycle through the markers seeing all the overtakes in the session
  • Or whatever you like...

Leave that session and join another.  Repeat. 

Enjoy.

Installation

You must own a license for VoiceAttack to be able to use this (or any other) plugin: https://voiceattack.com/purchase.aspx

Download the RobertsmaniaReplayReplay.vax file from the GitHub releases page: https://github.com/Robertsmania/RobertsmaniaReplay/releases

In the VoiceAttack options, disable plugin support if it is currently enabled and restart VoiceAttack.

Import the RobertsmaniaReplay.vax.  This will install the plugin and sample profile.

Enable plugin support in the VoiceAttack options.  Restart VoiceAttack.

Select the RobertsmaniaReplay profile.  The plugin should be initialized and the commands in the profile are available.

If you are new to VoiceAttack, be sure to run through the training to get the windows speech recognition to recognize your voice. 

Check out Train your speech engine and the other helpful tips:
VoiceAttack Tips and How-To - https://voiceattack.com/howto.aspx
« Last Edit: September 04, 2023, 04:38:49 PM by Robertsmania »

Robertsmania

  • Newbie
  • *
  • Posts: 46
Re: iRacing Replay - PitGirl Plugin
« Reply #1 on: September 01, 2023, 11:24:18 PM »
Here's a video demonstrating the plugin in action!

https://youtu.be/C0pFp6Jwkww