Repository navigation
feat: add talking to AvatarBase - #501
Merged
Merged
Conversation
Test this pull request
|
cyaiox
approved these changes
Oct 14, 2026
This was referenced Oct 14, 2026
popuz
added a commit
to decentraland/unity-explorer
that referenced
this pull request
Oct 22, 2026
# Pull Request Description ## What does this PR change? Reports Nearby voice activity to scenes through `PBAvatarBase.talking` (`optional bool`, field 6). It is the same signal Bevy already ships, so scenes get one cross-engine field: - decentraland/protocol#493 (merged into `experimental-bevy`) - decentraland/protocol#501 (cherry-pick to `main`, merged) How it flows: - **Remote players:** `NearbyLivekitBridgeSystem` (global world) writes every `IsActivelySpeakingTag` flip (LiveKit active speakers) into the new scene-world component `SDKTalking` of the scene the player stands in; `NearbyTalkingSDKPropagationSystem` seeds the current value when the player's scene assignment changes. On purpose it is **not** gated on mute, block, scene ban or listening state: the field says the avatar talks, not that the local player hears it. - **Local player:** `NearbyVoiceChatStateModel.IsLocalSpeaking` → `TalkingComponent` (global world) → `LocalPlayerCRDTEntityHandlerSystem` mirrors it into `SDKTalking` of the persistent player entity of every loaded scene, portable experiences included. - **Change-only writes:** `SDKTalking` carries its own dirty flag (reset by `CleanUpAvatarPropagationComponentsSystem`), so a speaking flip rewrites only `AvatarBase`, never `AvatarEquippedData`. `WriteSDKAvatarBaseSystem` writes `talking` only when the value is set. - **Unset when Nearby is off:** the system is registered inside the Nearby feature-flag block only. Without it `SDKTalking.Value` stays null and the field is never written, so scenes can tell "no data" from "not talking". `scripts/package.json` pins the published `@dcl/protocol@1.0.0-39771882714.commit-70f2654` (`main` with decentraland/protocol#501 merged). The regenerated bindings also pick up the additive `PendingTakeover` / `TakeoverCompleted` messages from decentraland/protocol#498. Related PRs: - decentraland/js-sdk-toolchain#1654 - decentraland/sdk7-test-scenes#112 Supersedes Gabriel Díaz's `PlayerVoiceState` / `VoiceChatModifierArea` PRs (area-based voice components are dropped in favour of the address-targeted `PBAudioSourceEffect` design, backlog). Thanks to Gabriel for the groundwork on the active-speaker source and change-only writes: - #10417 - #10418 - #10419 - #10420 ## Test Instructions **Steps (standard run)**: ```bash metaforge explorer run 10462 ``` **Expected result**: The QA scene shows a label above every avatar: **no data** (grey, field unset), **silent** (white, `false`), **talking** (green, `true`). A player's label turns **talking** while they speak in Nearby voice chat and goes back to **silent** when they stop, on every client in the scene. With the Nearby feature flag off every label stays **no data**. ### Test Steps Setup: - Scene `4,26-avatarbase-talking` is deployed to the zone world `sdk7testscenes.dcl.eth`. MetaMask on **SEPOLIA**; open with the deep link `decentraland://?dclenv=zone&realm=sdk7testscenes.dcl.eth` or launch with `--dclenv zone --realm sdk7testscenes.dcl.eth`. - **Two clients on this build**, both standing inside parcel 4,26, Nearby voice chat enabled. A client on an older build shows **no data** above itself on every client: expected, its engine does not write the field. 1. Idle: both labels read **silent**. 2. Client A speaks: A's label turns **talking** on both clients, back to **silent** when A stops. 3. On client B mute or block A, then A speaks: A's label still turns **talking** on B (talking is not hearing). 4. Client A speaks while a portable experience is loaded: the PE reads the same `talking` on the local player entity. 5. Walk out of the parcel and back: the label reappears with the right state. 6. Nearby feature flag off: launch the client with `--nearby-voice-chat false` (overrides the remote `alfa-nearby-voice-chat` flag, works in any build without `--debug`). Every label stays **no data**, never **silent**. 7. Nearby disabled in the settings of client B: B's own label reads **silent**, A's label on B still follows A's speech (the engine keeps tracking the room). ## Quality Checklist - [x] Changes have been tested locally - [ ] Documentation has been updated (if required) - [x] Performance impact has been considered — change-only writes, no per-frame allocations - [x] For SDK features: Test scene is included — decentraland/sdk7-test-scenes#112
popuz
added a commit
to decentraland/js-sdk-toolchain
that referenced
this pull request
Oct 23, 2026
Exposes `AvatarBase.talking?: boolean` to scenes: `true` while the player is speaking in voice chat, `false` when silent, `undefined` when the engine doesn't report voice activity. - Pins the published `@dcl/protocol@1.0.0-39771882714.commit-70f2654` (`@next`, includes protocol PR #501 feat: add talking to AvatarBase — decentraland/protocol#501). - Adds serialization tests for `talking: true`, `false` and unset. - `onProfileChanged` ignores `AvatarBase` updates that only change `talking`: Explorer rewrites the local player's `AvatarBase` on every speaking start/stop, so scenes would otherwise get a spurious profile change each time the player talks. Scene snapshots updated for this. ## How to test 1. Build a scene against this SDK with a system that logs the field on change: ```ts AvatarBase.onChange(engine.PlayerEntity, (v) => console.log('talking', v?.talking)) onProfileChanged.add(() => console.log('profile changed')) ``` or use the QA scene from sdk7-test-scenes PR #112 feat: AvatarBase.talking QA scene at 4,26 — decentraland/sdk7-test-scenes#112. 2. Run it in an Explorer build that includes unity-explorer PR #10462 (merged into `dev`) with Nearby voice chat enabled. 3. Expected: - silent: `talking false`; - speaking in Nearby: `talking true`, back to `false` when you stop; - `profile changed` is **not** logged on speaking flips, only on real profile/outfit changes; - Explorer launched with `--nearby-voice-chat false`: `talking undefined`. Explorer side: unity-explorer PR #10462 feat: report Nearby voice activity to scenes via AvatarBase.talking (decentraland/unity-explorer#10462). Bevy already ships the field via protocol #493 on `experimental-bevy`. Replaces #1647 (`PlayerVoiceState` / `VoiceChatModifierArea`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
popuz
added a commit
to decentraland/sdk7-test-scenes
that referenced
this pull request
Oct 23, 2026
QA scene for `AvatarBase.talking` at parcel 4,26. Shows a billboard label above each player: **no data** (`talking` unset — engine doesn't report voice / Nearby off), **silent** (`false`), **talking** (`true`). Logs each state change to the console. - Pins the published `@dcl/sdk` / `@dcl/js-runtime` `7.31.1-39942109730.commit-afd7f79` (`@next`, includes js-sdk-toolchain PR #1654 feat: expose AvatarBase.talking — decentraland/js-sdk-toolchain#1654, merged). - Explorer (merged): unity-explorer PR #10462 feat: report Nearby voice activity to scenes via AvatarBase.talking (decentraland/unity-explorer#10462). - Protocol (merged): PR #501 feat: add talking to AvatarBase (decentraland/protocol#501). Replaces #109 (nearby voice areas QA scene). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings
optional bool talking = 6onPBAvatarBasefromexperimental-bevy(#493) tomain, so Unity can ship it too and scenes get one cross-engine signal.The engine writes it with the rest of the player's AvatarBase; it stays unset on engines that don't report voice activity, so a scene can tell "no data" from "not talking". Additive to
PBAvatarShape.talking(scene-to-engine display flag).Same line as #472, so no conflict when that lands.
Supersedes the
PlayerVoiceStatepart of #499.🤖 Generated with Claude Code