This is the main code repository for racetime-obs, a plugin to add realtime information from racetime.gg to your stream in OBS.
- Co-op mode: Co-op races will automatically calculate the average finish time of your team when you finish. You can also specify another pair of players as your opponent/rivals. Their average time will automatically calculated and displayed. If one team has finished, the other team's timer will count down how much time they have to still win. If it's too late to still win, it'll count up the average time if the last player finished now.
- Qualifier mode: Calculate the par time and your score when the top 3 have finished using the formula score = 2 - (par time / your time)
- Media player: Automatically play a sound (either on stream, to your speakers, or both) based on race events, such as when the race updates, a chat message is posted, when the race starts counting down, or when you finish. Right now, this just has options for playing a sound when you finish or when a bot posts in the channel.
- ALTTPR Ladder mode: Support for timer started by ALTTPR
The general goal for this is to enable you to do fun things on your stream with the information from racetime.gg. Informational features that are boring will probably be prioritized behind features that are fun 😁
- Friends: Announce or list specified friends' finish times if they're in the same race as you.
- Automatically select a layout or scene depending on what game or mode you are racing.
- Restreamers: Make setup for restreaming easier by pulling the racers' information from the race room.
- Race history: List information from your race history, like current win streak or head-to-head record against current opponent.
- Your idea here!
In this demo, you can see two of the features. The timer has turned bronze, indicating that I finished third, and also that the average time of Julloninja and myself is lower than GanonsGoneWild (who finished second) and ZekeHighwind's average time if they finished immediately. Therefore, our winning time is colored green while GGW and Zeke's time is red and counts up to show what average time they would have now.
Example output when using tournament qualifier mode.
-
Install the correct version of Python for your system. On Windows, this is Python 3.6. Note on Windows whether you are using the 64-bit or 32-bit version of OBS, as you'll need to use the same version of Python which you can find at those links. On macOS, this is Python 3.7. Note on macOS, you also need to run this script in the Python Applications Directory.
-
Download and unzip the latest release archive to any folder
-
Install the correct python requirements with
python -m pip install -r requirements.txt
-
Start OBS and create a Text Source to use as a timer. You can customize the font and style as much as you please. Note that if you enable Podium Colors, whatever color you choose for your text source will get overwritten.
-
From the OBS menu, select
Tools
->Scripts
. Click the Python Settings tab, and click the Browse button. Navigate to and select the folder where you installed Python. -
Switch back to the Scripts tab and press the
+
button, and addracetime_obs.py
-
Enable the
Initial Setup
checkbox and select the text source you created in step 4 from the script properties drop down and type in your racetime.gg username (in the formusername#0000
) -
(optional) Check the "Use custom color for podium finishes" box to have your timer change color depending on what phase the race is in and what place you finished in.
-
Join a racetime.gg race, and select your race room from the drop down. You can select a category to only show races in that category as well.
-
(optional) Choose settings for coop mode or qualifier mode if relevant by setting up 2 text sources for each.
You can find me on Discord, oro#7777.
Also, follow me on Twitch! Generally, if I'm racing ALTTPR, then I'm probably using or testing out this plugin and new features in some way.
This project is unaffiliated with racetime.gg and OBS Studio, but wouldn't be possible without the wonderful racetime.gg API and usable OBS scripting support.
Thank you to bfxdev and upgradeQ, whose OBS scripting tutorials and code I referenced heavily when learning how to integrate with OBS.