DrivingRangeTheater
Turns the driving-range leaderboard TV into a video player. Content mods drop video files into a Videos folder and next/back buttons cycle between them.
| Date uploaded | a month ago |
| Version | 0.1.0 |
| Download link | Cray-DrivingRangeTheater-0.1.0.zip |
| Downloads | 69 |
| Dependency string | Cray-DrivingRangeTheater-0.1.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2305README
DrivingRangeTheater
Turns the driving-range leaderboard TV into a video player. Hit the cycle buttons (forward / back) to flip between clips; each client controls their own playback volume from the pause menu.
This mod is a framework. It does not ship with any videos. Pair it with content mods, or drop
your own files into Videos/ under any plugin folder.
Install
Via r2modman or Thunderstore Mod Manager: search for Cray-DrivingRangeTheater and install, plus any content packs you want.
Manual install: drop DrivingRangeTheater.dll into
<r2modman profile>/BepInEx/plugins/Cray-DrivingRangeTheater/.
Requires BepInExPack 5.4.2305. Every player in a lobby needs the same mods installed, including the same video content, because cycle state is server-authoritative and replicated via Mirror.
Usage
- Original button: next video.
- Cloned button beside it: previous video.
- Pause menu while on the driving range: client-local
Screen res,Theater volume, andScreen fitcontrols. - If the screen trims the edges of a clip, adjust
OverscanCompensationinBepInEx/config/cray.drivingrangetheater.cfg.
Adding videos
Drop video files into the Videos/ folder of any plugin package. The framework scans
<r2modman profile>/BepInEx/plugins/*/Videos/ at startup and sorts the files alphabetically.
Video
Recommended format: MP4 (H.264 8-bit / yuv420p). This is the safest format for Unity's
VideoPlayer backend on Windows. Also accepted by extension: .webm, .mov, .ogv, .mkv,
.m4v, but decode support varies. H.264 10-bit (High 10, yuv420p10le) will fail with
VideoPlayer cannot play url.
Transcode problematic files with:
ffmpeg -y -i input.mp4 -c:v libx264 -profile:v high -pix_fmt yuv420p -crf 22 -preset veryfast \
-c:a copy output.mp4
Audio
Super Battle Golf has Unity's native audio disabled project-wide, so the VideoPlayer's built-in
audio paths are silent. The framework plays audio from a sidecar file next to each video through
FMOD.
Ship an audio file alongside every video with the same basename, for example
1 Gwimbly.mp4 -> 1 Gwimbly.ogg. Accepted extensions, first match wins:
.ogg, .wav, .mp3, .m4a, .aac, .flac. If no sidecar is found, the video still plays
silently.
Extract .ogg audio from an existing mp4 with:
ffmpeg -y -i input.mp4 -vn -c:a libvorbis -q:a 4 input.ogg
Audio is played as a 3D FMOD sound positioned at the theater screen, not as a global 2D mix.
Sync is maintained by a 2-second drift check against VideoPlayer.time; the framework corrects
mismatches greater than 250 ms with channel.setPosition().
Prefix filenames with 01-, 02-, and so on to control playback order.
Authoring a content mod
Ship a Thunderstore package depending on Cray-DrivingRangeTheater:
Cray-MyVideos/
|-- manifest.json
|-- icon.png
|-- README.md
`-- Videos/
|-- 01-intro.mp4
|-- 02-highlights.mp4
`-- ...
The framework scans your Videos/ folder on next startup. No code is needed.
How it works
- Video scan: at plugin
Awake, walksBepInEx/plugins/*/Videos/*for supported formats. - Screen takeover: a Harmony prefix on
DrivingRangeStaticCameraManager.ApplyCurrentCameraIndexsuppresses vanilla camera activation and drives the theater manually. Active video decodes into an offscreen RT, then gets composited into the vanilla driving-range screen RT with a configurable overscan-safe margin so the existing in-scene display path keeps working. - Screen resolution: the mod upgrades the original shared
match_setup_camera_render_texturein place and rebuilds the six vanilla driving-range camera caches against the chosen size. Supported client-local options are1024,1536, and2048. This keeps the hidden screen binding intact while improving final display sharpness. - Forward button: the vanilla
nextCameraButtonremains wired toCmdCycleNextCameraForAllClients. The SyncVarcurrentCameraIndexstill drives playback; the mod just reinterprets the index against the video list instead of the camera list. - Back button: at scene-start time the mod clones the forward button's GameObject, offsets it, and
swaps its
DrivingRangeNextCameraButtoncomponent forDrivingRangeBackCameraButton, which sendsTheaterCycleMsg { direction = -1 }. A server handler updates the SyncVar accordingly. - Volume slider: a small pause-menu child panel shown while the pause menu is open and the theater
is active. The sliders write to BepInEx
ConfigEntry<float>values so volume and screen-fit changes persist. - Audio playback: FMOD sidecar audio starts when the active clip actually begins video playback,
then stays synced against the
VideoPlayerclock with periodic drift correction.
Building from source
Requirements: .NET SDK 7.0+, a Super Battle Golf install.
git clone https://github.com/Calen-Ray/SBG-driving-range-theater.git
cd SBG-driving-range-theater
dotnet build -c Release
The build copies the DLL into your r2modman Default profile automatically.
Packaging for Thunderstore
pwsh tools/package.ps1
Produces artifacts/Cray-DrivingRangeTheater-<version>.zip ready to upload.
License
MIT, see LICENSE.
CHANGELOG
Changelog
v0.1.2
- Audio drop-off extended from 32 m to 45 m. Full volume still starts at 6 m from the screen and falls off linearly to silent at 45 m — you can now hear the clip from further out on the range without it bleeding across the whole course.
v0.1.1
- Scan both
Videos/andVideo/subfolders under each plugin package. - Also accept videos placed directly in a plugin's root folder, provided each has a
same-basename audio sidecar (
.ogg/.wav/.mp3/.m4a/.aac/.flac). The sidecar requirement keeps the scanner from picking up unrelated mp4s shipped by other plugins. - Dedupe by path so a mod with both a
Videos/dir and root-level sidecared videos doesn't produce duplicate playlist entries.
v0.1.0
- Initial release.
- Replaces the driving-range leaderboard TV with a video player.
- Next / back / volume slider UI.
- Content mods drop video files into a sibling
Videos/folder to extend the playlist.