Co-op and background streaming #
Rubylight docs › Play together · Background streaming · Features
Rubylight can run a game through Nucleus Co-op, the split-screen launcher. Nucleus Co-op starts a separate instance of the game for each player, and Rubylight streams each instance's window, sound and controller to its own device. This enables two modes:
- Co-op. Up to four devices play the same game together, each in its own instance.
- Background streaming. A device plays its own instance of a game while someone else keeps using the PC. The PC's displays, focus, keyboard and mouse stay with the local user.
Quick start #
- At the PC, as an administrator: download Nucleus Co-op 2.4.2, unblock
the zip (right-click it, Properties, tick Unblock) and unpack it
into a folder under
C:\Program Files(Windows asks once for administrator rights). In the console, open Games, select the game and, under Play together, choose that folder and select Use this folder. Rubylight checks it and downloads nothing itself. - If the game has no Nucleus Co-op handler yet, the panel offers Open Nucleus Co-op on this PC. Search the handler hub for the game there, download the handler and add the game; the panel moves on by itself once the handler is present.
- When the panel shows how many players the game seats, start the game's (Co-op) entry from Nightjar or Moonlight on each device. Each device that starts it joins as the next player.
- Home shows the running session: who plays in which slot, a player who stepped away and keeps the slot for two minutes, and a Let … join button for each paired device that may not join yet.


Co-op and background streams need the host to run as the Windows service (the installer's default), because Nucleus Co-op runs as the signed-in user; a portable host refuses these launches and says why. They accept controllers only. Co-op, hub handlers and games that need administrator rights also need a Windows administrator account that Windows elevates; Without administrator rights lists what runs on other accounts. When a device takes a seat (a background stream or a co-op slot), the PC shows a notice, "<device> started playing <app>.", once per seat: a reconnect to the same seat shows nothing. The sections below describe each step in detail, and the hardware matrix records the tested configurations.
Background streams #
Nucleus Co-op is the only background mode: there is nothing to choose. A
device asks for a background stream as before: Devices → (device) → Play in
the background (background_stream) or Games → (game) → Behavior →
Stream in the background (background-stream). Either one runs the app as a
Nucleus Co-op session of its own with one player, and the host log says once
that background streams run through Nucleus Co-op. Only the device that
started it can return to it; nobody else can join a background stream.
The stream carries only the game's sound (Game-only audio). The game plays on a virtual playback device, so it stays off the PC's speakers even when the device asks to play audio on the PC; that setting still applies to the device's normal streams. Without a virtual playback device the game stays audible on the PC and the stream warns.
Quitting the game on the device ends the background stream, also after its
stream already ended: Moonlight's Quit (/cancel) and Nightjar's Quit (Close
game where the device has host control) stop Nucleus Co-op and the game
instead of keeping its slot for 120 s. A device that returns to a background
stream whose game window doesn't come back within 90 s (the game minimised or
lost it) gets the reason, and the session ends, so the next background launch
isn't refused while the game runs on unseen.
A background launch that Nucleus Co-op cannot run is refused with the reason, for example "Store Game can't stream in the background: Nucleus Co-op starts games by their .exe, and Store Game does not name one: set the app's command to the game's .exe". It never falls back to streaming the PC's monitors.
Games without a handler #
A background stream needs no handler from the hub. A game you added at that
exact path with a hub handler always uses it, and co-op still needs one.
Otherwise, in Nucleus Co-op's folder, the host writes its own
one-player handler into Nucleus Co-op's handlers folder
(Rubylight-<game>-<hash>.js) and adds the game to Nucleus Co-op's game list (content\userprofile.json in its folder, the only
one 2.4.2 reads), as Nucleus' own "add game" would, and to the game list of
the user's own copy when the game runs from there
(Without administrator rights). It does that
only while Nucleus Co-op isn't running, and never over a file it did not write.
Earlier Rubylight versions added the game to
%APPDATA%\Nucleus Coop\userprofile.json instead, which Nucleus Co-op never
reads, so it showed no game and the stream hung at its start (#59); the host
removes those entries, and only those, from that file.
Installing a hub handler for the same .exe doesn't remove the host's handler
right away: the next Nucleus Co-op session of another game removes it and its
entry, so Nucleus Co-op lets you add the game with the hub's handler. That
session also removes a handler the host wrote for you that no game in your
list uses. The handlers folder is shared by every Windows account and each
account's list is its own, so a handler written for another account, or by
an earlier version, stays. The host only ever removes its own files and
entries. One it
can't remove shows as a warning on the stream and is tried again next time;
an entry whose handler is gone does no harm, as Nucleus Co-op leaves it out
when it loads the list. Another game with an .exe of the same name (Portal's
and Half-Life 2's hl2.exe) still streams with the host's handler, written
again for each of its sessions.
The game runs from its own folder: nothing is copied, linked or written there,
and Nucleus Co-op needs no extra tools for it. Its window keeps running and
reading the pad without focus. It doesn't move the PC's cursor, and its
window messages carry no keys, clicks, wheel or cursor positions from the PC's
keyboard and mouse, even when it comes to the front. A game whose .exe
imports DirectInput (dinput8.dll or dinput.dll, read as the signed-in
user), which reads the keyboard through raw input, gets its raw input from
ProtoInput, which passes on only the slot's keyboard and mouse, and a pad's
slot has none. Other games keep their raw input: ProtoInput would pass on no
pad's raw input either, and a game reading its pad that way (SDL, Rewired)
would lose it, so such a game can still see the PC's keyboard through raw
input. The host still keeps the window off the PC's monitors. An Unreal
Engine game (its .exe in <Project>\Binaries\Win64, Win32 or WinGDK)
starts with -windowed at the stream's resolution (-ResX, -ResY, and
-ForceRes so a window larger than the PC's monitor keeps its size), unless
the app's arguments already choose a mode or a resolution, so it stays in its
window beside the desktop instead of covering the PC's monitor and fills the
client's screen. A game window with a title bar or sizing border loses it, so
the stream shows the game alone; a window that doesn't respond keeps it until
it does.
Nucleus Co-op ends a game it can't inject ProtoInput's input hooks into. A
game that refuses them gets them another way at its next start: into the
running game first, then as Nucleus Co-op starts it, then from one of the
game's own threads, and last none at all. Without hooks a keyboard, mouse or
controller on the PC can reach the game too, and the host log says so. The
host keeps which way each game gets in Rubylight-injection-2.json in
Nucleus Co-op's folder; if that file can't be read, the launch says so: delete
it to start over.
- The app names the game's .exe, or is a Steam link. For
steam://rungameid/<id>the host starts the .exe Steam would, with that launch option's arguments (Portal ishl2.exe -game portal), found from the game's install folder and Steam's launch option for Windows, and starts Nucleus Co-op with the game's Steam app id (SteamAppId,SteamGameId), so the game runs without restarting through Steam. Steam must know the game: one that is not installed, or that Steam's app cache does not list yet, is refused with the reason (start it once in Steam). Other launchers' links are refused: set the app's command to the game's .exe. The game gets the arguments the app's command passes it. - Epic games start as their launcher would. For a game the Epic Games
Launcher installed, the host reads the launcher's manifest and adds the
arguments that say which game it is (
-EpicPortal -epicapp=… -epicenv=Prod -epicsandboxid=…), without the launcher's sign-in and without the manifest's own launch options: the app's arguments can add those. Every user on the PC can write those manifests, so only the game's name and namespace are taken from them, from a restricted set of characters; oversized manifests and links are refused, and the game must be an .exe inside the manifest's install folder. A game that insists on the sign-in may still restart through the launcher on the PC's monitor: when its instance exits right after it started, the stream says that may be why. A game's .exe in a Steam library (steamapps\common\<folder>) counts as that Steam game: it gets its app id and Valve Anti-Cheat check the same way. Steam libraries on a network share are skipped. A Steam app's folder in a library Steam doesn't list is refused, and a folder of a listed library that no Steam app installs to too. Where several apps share a folder (Half-Life 2 and its episodes), the one whose launch option matches the .exe and its arguments counts. - The game, not its launcher. A launcher (
steam.exe -applaunch, the Epic Games Launcher, Playnite,Fallout4Launcher.exe,PlayGTAV.exeand the like) is refused. The small .exe at an Unreal game's root starts the one<Project>\Binaries\Win64\*-Win64-Shipping.exeinstead. - On this PC's own drives, and no part of Windows. A game on a network share, or a program in the Windows folder, is refused before the host opens it. Your user folders are fine.
- No anti-cheat. A game that ships anti-cheat, such as Easy Anti-Cheat,
BattlEye or Riot Vanguard, or that Steam lists with Valve Anti-Cheat, is
refused before anything is written: Nucleus Co-op's hooks would look like
cheating. Well-known ones without anti-cheat files in their folder
(Counter-Strike 2, Dota 2, Overwatch and others) are known by name, and a
game Battle.net installed (its
.build.info) has Blizzard's anti-cheat. The host looks only in the game's own folder, never in a folder many games share: for an Unreal Engine 3 game (<Game>\Binaries\Win32) that is<Game>. - The Play together panel says why before you launch: for an app that names its .exe it checks the path, launchers, and anti-cheat by name and in the game's folder. A Steam game's Valve Anti-Cheat flag, for a link or an .exe in a Steam library, is checked when it launches, and the launch says why.
- Controllers only, as for every background stream.
- Some games pause anyway when their window is not in front, despite the focus hooks. Those need a hub handler made for them.
Without administrator rights #
A background stream with Rubylight's own handler runs Nucleus Co-op as the
signed-in user, without administrator rights, unless the game needs them.
That holds on an administrator account too. It runs from the user's own copy
of Nucleus Co-op in a folder below
C:\ProgramData\Butterpollo\nucleus-user\<SID>, which the host copies from
Nucleus Co-op's folder, once Nucleus Co-op is closed, without its settings,
logs, game list and game data, and copies again, into a new folder, when a
program file changes on either side. Only the files of the pinned 2.4.2
release are copied; anything else in that folder stays there. The copy is
needed because the folder Nucleus Co-op runs from elevated may only be
changed by administrators, and the user's Nucleus Co-op writes its settings
and logs next to its program. The copy starts from Nucleus Co-op's own
default settings, never another account's nicknames or Steam IDs. Its
handlers are the elevated one's hub handlers and Rubylight's handler for the
game launched, never Rubylight's handlers for other games or other accounts.
The host starts it only as the account whose copy it checked, and an
elevated Nucleus Co-op only as the signed-in account itself, never as the
separate administrator of Windows' Administrator protection. Everything
Rubylight writes in the copy (its game list, its
Settings.ini and the session's profile) it writes as the user, and the copy
keeps the session's settings: nothing there is put back as SYSTEM. Only
SYSTEM and Administrators can change the folders above it; the user can only
list <SID>, and can change only what is inside their own copy, never move
or delete the copy's folder. While Nucleus Co-op starts, the host holds the
copy's folder and NucleusCoop.exe open so neither can be made a link or
replaced, and starts it only when the program opened in that folder.
A game needs administrator rights when:
- its manifest asks for them (
requireAdministrator), - its compatibility settings run it as administrator,
- Windows treats it as an installer (by its name, such as
setup.exe), or - the signed-in user can't change the files in its folder (Nucleus Co-op clears their attributes before it starts the game). The launch checks this; the Play together panel doesn't.
Such a game runs elevated, as before. So do hub handlers and co-op, always. The Play together panel says which way a background stream of the game runs.
On a standard account, or with Windows' Administrator protection on, a game that needs none of that now streams in the background. A game that needs administrator rights is still refused there, and so is a game with a hub handler, for co-op and background streams alike: the Play together panel says so before you launch. On a standard account it says to sign in to Windows on this PC as an administrator. Under Administrator protection it says that the protection keeps administrator rights from Rubylight, so the game can't run on this PC, and that games Rubylight adds itself still stream if they need no administrator rights. Rubylight never asks you to turn a Windows security feature off. It tells the two apart by the signed-in user's token: Administrator protection elevates an administrator only into a separate account, which Rubylight never starts Nucleus Co-op as. Open Nucleus Co-op on this PC also needs an account Windows elevates; the panel says so before you press it, in the same words.
A background_mode line that an earlier build wrote (auto,
child_session or virtual_display) becomes nucleus, and the host log
says so once. A value that is no mode at all refuses background launches and
says why.
Background streaming in a Windows child session was removed: Windows signs a child session in only with a Windows password, and a Microsoft account that uses only Windows Hello has none. On a PC where a development build set it up, the host puts the Windows settings back at its start and deletes the password that build saved; if that fails, Troubleshoot (under Advanced in the console's sidebar) says why and offers Restore again.
Installing Nucleus Co-op #
Rubylight downloads nothing. Download Nucleus Co-op 2.4.2 (NucleusApp.zip)
from its release page, which a game's Play together panel and
the Nucleus Co-op panel under Advanced → Troubleshoot link to. Setting it up needs an
administrator at the PC:
- Unblock the zip before extracting it: right-click
NucleusApp.zip, choose Properties, tick Unblock and select OK. Files unpacked from a zip that still carries the browser's Mark of the Web are refused. - Unpack it into a folder under
C:\Program Files. Windows asks once for administrator rights (one UAC prompt) to write there. - Choose that folder on either panel (type it or Browse) and select Use this folder.
The host checks the folder before it keeps it as nucleus_path, and refuses
it with the reason, saving nothing, when:
- it isn't a full path, doesn't exist or holds no
NucleusCoop.exe(Not found); - a program file in it isn't 2.4.2's, by each file's size and SHA-256 against the release's file list (Wrong version; 2.4.2's file version reads 2.3.0.0, so the version number can't tell);
- it is on a network share (a UNC path), a mapped, removable or USB drive
rather than a fixed drive inside this PC, or on another drive under the same
letter than when the host first checked it since it started; anything in
it is a link (a junction or symbolic link; only inside Nucleus' game
instance folders,
content\<game>\InstanceN, which link to the game's files); or anyone but SYSTEM, Administrators and TrustedInstaller owns or may change a file or folder in it, or any folder above it (Folder refused). Nucleus Co-op runs elevated and the host writes into its folder as SYSTEM, so a folder you can change without elevation would hand both to any program you run. A folder unpacked underC:\Program Filespasses; one in Downloads, on the desktop or right underC:\(as Nucleus Co-op suggests) doesn't; - a file in it still carries the Mark of the Web (Blocked by Windows): unblock the zip and unpack it again into a new folder.
Forget this folder on either panel clears nucleus_path. Neither it nor
Use this folder works while a co-op or background session runs: end the
session first.
The panels show the state with the host's reason. Saving the folder under
Settings checks it the same way and refuses the whole save with the
reason. A nucleus_path written into sunshine.conf by hand is checked at
each launch: while Nucleus Co-op isn't set up, or its folder is refused, co-op and
background launches answer 503 and Open Nucleus Co-op on this PC is
refused, each with the reason. Sessions turn Nucleus Co-op's own folder check
off, but the window Open Nucleus Co-op on this PC opens may warn about a
folder under C:\Program Files; that warning doesn't apply here.
Earlier Rubylight versions downloaded Nucleus Co-op into
C:\ProgramData\Butterpollo\nucleus\2.4.2. With no folder chosen, that
install keeps working (the Nucleus Co-op panel under Advanced →
Troubleshoot shows it as Earlier install); choosing a
folder takes over from it. A folder kept as nucleus_path that isn't 2.4.2
(one an earlier version allowed) falls back to that install while it exists:
the panels say so and offer to choose another folder. Games added in Nucleus
Co-op stay in the copy they were added in, so add them again after moving to
a new folder. Nucleus Co-op's handler hub view is a WebView2
browser, which runs without administrator rights, so its data lives in the
signed-in user's AppData\Local\Butterpollo\nucleus-webview.
Nucleus Co-op launches a game through its handler for that game. Handlers come from Nucleus Co-op's handler hub and are your own content: Rubylight ships none. When a game has none, its Play together panel says so: Open Nucleus Co-op on this PC opens Nucleus Co-op on the PC's screen, where you search its handler hub for the game, download the handler and add the game. The panel moves on by itself once the handler is there. Close Nucleus Co-op beside it closes that window again, and the next co-op or background stream closes it by itself first; if it won't close (it is asking you something), the stream is refused until you answer it at the PC. Only Nucleus Co-op itself is closed: what it started (a browser, a game) is left alone. A Nucleus Co-op you started yourself is never closed: Open and launches are refused while it runs. Co-op in a game without a handler is refused with "No Nucleus Co-op handler for <exe>: add one in Nucleus Co-op's handler hub"; a background stream of it uses Rubylight's own handler (Games without a handler).
How a session starts #
Rubylight writes a Nucleus profile named Rubylight for each session and
loads it. For that it sets a few of Nucleus Co-op's settings: pads by XInput
index and game profiles on, which stay, and, for the session only, no
install-folder check at its start (it warns about a Documents folder in
OneDrive), no reminder of the End key, and no favourites-only or game-type
filter on its list. In the user's own copy
(Without administrator rights) the session's
values stay. Otherwise your own values of those come back when the session ends,
or after a host crash when the service starts it again; a value you or Nucleus
Co-op changed meanwhile stays, and a Settings.ini deleted meanwhile has
nothing to put back. While a session starts or runs, the service leaves its
values alone. Keys missing from Settings.ini, or the whole file, are filled
in from Nucleus Co-op 2.4.2's own defaults. A
Settings.ini saved as UTF-16 (Unicode) text is never edited: the launch
says to save it as ANSI or delete it.
A start that times out says what Nucleus Co-op shows instead: a message on the
PC's screen, from Nucleus Co-op or from Windows on its behalf, before or after
the click on the profile (answer or fix it there; a box Windows showed for
another program before the launch doesn't count), that it doesn't list the
game (naming the game list it reads),
no profile Rubylight (open Nucleus Co-op and load the profile Rubylight once,
then launch again), that it still shows its setup screen with the profile
Rubylight (Nucleus Co-op shows Play, or with auto-play starts the game, once
every player has a controller there), that the press of Play failed (and why,
such as a window that kept covering it) or started nothing, or no window at all, with the last error from its crashlog.txt if it wrote
one (in the user's own copy, read as the user). The host clicks the profile
without moving the mouse or taking the focus. Nucleus Co-op only takes a click
on the window it shows at that point, so when another window covers its list
(your game, or a game you stream), the host raises Nucleus Co-op above every
window for the click, never activating it, and puts it back below that window
right after; a window that stays on top even then fails the click, and the
start says so. Nucleus Co-op 2.4.2 finds the PC's screens for its setup screen
on a 3 s timer, and a click before that fails with "The profile can't be
loaded", so the first click waits until it has listed the profile for 3.5 s.
That message comes in Nucleus Co-op's own untitled box, which draws its text
(so the log can only name it, not quote it) and blocks its window until
someone closes it. So after the click, until a game instance runs, the host
closes a box like that (logging what it says) and clicks the profile again
every 5 seconds while Nucleus Co-op still lists it and shows no message box.
Once Nucleus Co-op hides the list to play the profile, it is never clicked
again. When the last click ends in such a box, the start fails saying so.
The host then presses Nucleus Co-op's Play once, without moving the mouse and
in the same way as the click on the profile.
The profile has Nucleus Co-op's auto-play off, because auto-play runs from the
setup screen's paint and can start the game a second time during a start, which
kills the first one (#59). Nucleus Co-op shows Play only once every player of
the profile has a controller, on the options step if the handler has options,
so the press waits until Play is shown and enabled. A handler with steps of its own
(Game.ShowOptionAsStep, Game.CustomSteps) shows no Play until someone
answers them, so its profile keeps auto-play and can still start twice.
Playing co-op #
Each app whose game has a handler gets a second library entry, <app>
(Co-op), which sorts next to the game. The game's Play together panel says
how many players it seats and can hide the entry (Show "<app> (Co-op)" in
the library, the app setting coop-entry). The first device that launches it starts a session with
one slot per player: the handler's maximum, capped at 4 and at
nucleus_coop_players (1 to 4, 4 by default). Every other device that
launches the same entry joins the running session in a free slot. Any
Moonlight client can join this way.
Joining a session that someone else started needs Can join co-op games
(coop_join) on the device's page in the console. A device that never set it
follows Launch apps, so every device with Play games joins. Joining launches the
co-op entry, so a device without Launch apps (Watch only) never joins, and the
console keeps the switch off for it and leaves it out of the invite list. An explicit off
refuses the join with "This device may not join co-op games: turn on “Can join
co-op games” for it in the Rubylight console". A device that holds a slot can go
back to it while it may join; turning it off ends the device's stream and keeps
it out. The device that started the session needs no permission to return. When
a device's stream ends, its slot is held for 120 s so it can come back. A
player's Quit ends only its own stream: the other players keep playing.
Sessions list who plays only to devices that may join.
Home in the console shows each running co-op game as a card: its players, an away device's remaining 120 s, Remove (asks first) and End co-op (asks first). While a slot is free, the card lists the paired devices with Let <device> join for one that may not yet; a removed device is not offered again. A background stream gets a card too, with End stream only.
Nightjar lists the running co-op sessions on a PC with their free slots and this device's own seat: on Android under Join co-op in the PC's menu, on the desktop on the PC's details page. Join (or returning to your own seat) takes the slot and starts the stream. A refusal is shown with the PC's own words.
Ending a session stops Nucleus Co-op and every instance, and ends each player's stream. A session also ends when every player has left, when an instance crashes, or when its start fails. For a minute after, Home says which ended last and why, and the log keeps it. Nucleus Co-op's folder and why it can't run from it are in the Nucleus Co-op panel under Advanced → Troubleshoot.
Limits #
- Controllers only. Each slot gets one virtual Xbox controller (a USB
Xbox 360 pad on ViGEmBus when the controller type is Xbox 360
(ViGEmBus),
gamepad = vigem_x360), so up to 4 XInput players. The device's first controller drives its slot. Keyboard, mouse, touch and pen are not sent to the game, and the stream says so. A session first unplugs the virtual controllers an earlier session still holds, and those that streams which ended still keep plugged in for a reconnect (not those of streams still running or about to start), so its players take the lowest XInput slots free; controllers that don't unplug within 3 seconds fail the launch, which says so. If one of the PC's own controllers, or another stream's, sits in a lower slot, the stream warns: a game that reads XInput past Nucleus Co-op's hooks takes that controller instead. - Window capture. Each instance's window is captured with Windows Graphics Capture (Windows 10 1903, build 18362, or later), and the window is parked away from the PC's monitors. Your displays and their layout are not touched. The host puts the window back whenever it moves or resizes itself. One that keeps returning to a PC monitor, or minimising itself (some fullscreen games do when they lose the focus), is restored for the whole stream, every 2 seconds after the first 5. One that only keeps a place or size of its own away from the monitors is left there.
- Sound. Each stream carries its own instance's sound. Separate sound per player needs Windows build 20348 or later. On older builds the host says so. The instances play on a virtual playback device from their start, off the PC's speakers; in co-op, a player whose device asks to play audio on the PC gets their instance back on the PC's device. A background stream never does (Background streams).
- One Nucleus Co-op session at a time: a second one is refused while Nucleus Co-op is busy with another game.
- Compatibility settings come back. As it starts each instance, Nucleus
Co-op sets the game's .exe to its DPI mode in your Windows compatibility
settings (Properties › Compatibility), replacing what you set there. The
host keeps those settings from before the session and puts them back
when it ends, also after a crash or a failed start. It only touches the
game's own .exe and Nucleus' instance links, and only where Nucleus' DPI
mode is still set: a setting you change meanwhile, or another game's .exe
of the same name, stays as you left it. Should the host stop mid-session,
the settings come back when you next sign in at the PC, when the service
starts the host again, or before the next session. Until then they wait in
Rubylight-layers-<SID>.jsonin Nucleus Co-op's folder. If that file can't be read, the launch says so and names it: delete it to stream again.