AI VTuber Broadcast
Overview
This guide explains the current ProjectP broadcast-console workflow for running a YouTube-style AI VTuber stream inside the ProjectP client.
The current implementation combines:
- an in-world broadcast console item
- one target NPC
- YouTube OAuth and live-chat polling
- OBS for outgoing video streaming
Current Runtime Split
The current implementation is built from three parts.
BroadcastController
Owns:
- Google OAuth
- token storage
- broadcast creation
- reusable stream lookup or creation
- stream preparation
- YouTube live-chat polling
- current watch URL / RTMP / stream key state
BroadcastChatNpcRelay
Owns:
- reading the current chat feed from
BroadcastController - choosing the next usable viewer message
- resolving the selected target NPC
- forwarding the message to that NPC through the normal AI NPC path
This component should stay thin.
ItemBroadcastConsole
Owns:
- the in-world control UI
- Google Client ID / Client Secret inputs
- target NPC selection
- login / start / stop button flow
- current status display
OBS
OBS still sends the actual video stream to YouTube.
ProjectP renders the world and the NPC.
OBS captures that output and transmits it using the RTMP values prepared by the console.
Supported Scope
- YouTube OAuth login from the client
- local token storage on the broadcast console
- watch URL / RTMP / stream key display
- reusable stream workflow
- live-chat polling
- one-NPC chat relay
Autotarget mode that uses the first NPC found in the world
Current Limitations
- one target NPC at a time
- one-message-at-a-time relay
- normal AI NPC response path only
- no in-console OBS control
- no multi-NPC broadcast flow
Prerequisites
Before using the broadcast console:
- Prepare a YouTube channel that is allowed to go live.
- In Google Cloud Console, enable
YouTube Data API v3. - Create an OAuth 2.0 desktop client.
- Prepare the
Client ID. - Prepare the
Client Secret.
Notes:
- Some desktop OAuth flows can work without a secret, but the current ProjectP sample expects both values to be available.
- If the OAuth consent screen is still in testing mode, add the intended Google account as a test user.
World Setup
- Prepare at least one NPC with
NpcDesc. - Place the broadcast console item in the world.
- Make sure the item contains:
BroadcastControllerBroadcastChatNpcRelayItemBroadcastConsole
- Open the console UI.
- Enter:
Google Client IDGoogle Client Secret
- Choose
Target NPC.
Target selection behavior:
Autouses the first NPC found in the loaded world- explicit NPC name
uses the selected
NpcDesc.npcName
The target list refreshes:
- when the console opens
- when the target dropdown is opened
Ownership And Control
The console can be configured to require item ownership before control actions are allowed.
In that mode:
- the user controlling the broadcast console must own the item
- login, start, and stop actions are blocked until ownership is available
- the console UI still shows status, but protected actions stay host-only
This prevents multiple users from fighting over the same live session state.
Login Flow
- Click
Login YouTube. - A browser window opens.
- Sign in with the Google account that owns the YouTube channel.
- Approve access.
- Return to ProjectP and confirm the console changes into a connected state.
The console stores token state locally, so repeated login is usually unnecessary while the refresh token remains valid.
Broadcast Preparation Flow
- Click
Start Broadcast. - The console creates or reuses the YouTube live stream.
- The console creates or refreshes the broadcast session.
- The console binds the broadcast to the stream.
- The console displays:
- watch URL
- RTMP server URL
- stream key
- Copy the RTMP values into OBS.
- Start streaming from OBS.
- The console continues polling until the stream state becomes live.
OBS Setup
Basic OBS setup:
- Create a new scene.
- Add the ProjectP client as a source.
- In
Settings -> Stream, chooseCustom. - Paste the RTMP server URL from the console.
- Paste the stream key from the console.
- Start streaming in OBS.
Recommended capture order:
Game CaptureWindow CaptureDisplay Capture
Chat Relay Flow
BroadcastChatNpcRelay works like this:
- Read the current JSON chat feed from
BroadcastController. - Ignore already-processed chat entries.
- Skip unsupported message types.
- Choose the next usable
textMessageEvent. - Resolve the target NPC.
- Call
ExecuteNpcChatAsync(...). - Push the reply back through the normal NPC chat and speech path.
The relay also supports:
ignoreExistingMessagesOnStartprevents the NPC from responding to old chat history when the relay bootsminReplyIntervalSecondsenforces a minimum reply gap to avoid spammy back-to-back speech
Troubleshooting
Browser login succeeds but token exchange fails
Check:
Client IDis correctClient Secretis correct- the Google account is allowed in the OAuth consent configuration
- the YouTube channel is actually live-enabled
Target NPC dropdown is empty
Check:
- the world has at least one object with
NpcDesc - the NPC is loaded in the current world
Chat appears in YouTube but the NPC does not answer
Check:
- the console is not still in auth or start-in-progress state
Target NPCis set correctly- the selected NPC has working AI chat
- the broadcast state is no longer
idle
OBS is streaming but YouTube does not become live
Check:
- RTMP server URL is correct
- stream key is correct
- OBS is really sending to the configured endpoint
- the YouTube channel is allowed to start live broadcasts