Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[help] Dissonance Only Working if Host Runs Game from Unity Editor #296

Open
NetKing2464 opened this issue Dec 2, 2024 · 3 comments
Open

Comments

@NetKing2464
Copy link

Context

Multiplayer game using NFGO + Steam as transport. Game runs perfect with Dissonance as long as the host runs the game within the Editor.

When run outside the editor in a game build (same pc) audio does not work, client shows Connection Status as Degraded.

Have you seen this issue before?

  • Dissonance version used: e.g. v9.0.6 (2024-10-21) (check Assets/Dissonance/changelog)

  • Unity version: e.g. 2021.3.11f1 Personal (check Help > About Unity)

  • Windows 11
    Windows, x86_64 + Windows, x86_64 Development Build

@martindevans
Copy link
Member

I haven't seen anything like this before!

client shows Connection Status as Degraded.

Degraded basically means the client is sending messages to the server, but is not receiving any replies. That could mean it's outgoing messages are dropped, or the replies are dropped. Does the rest of your game networking function properly in this test setup?

Steam as transport ... same pc

Does Steam allow you to use 2 copies of the game on the same machine? As far as I'm aware packets are sent to a specific SteamID, so if both clients are using the same SteamID that would presumably cause issues. (I've never used the Steam backend with NFGO, so I might be completely wrong with this!).

@NetKing2464
Copy link
Author

Rest of the game ok, players can connect to host etc.

Testing connectivity between two devices, same result if on same network at home or over the internet. Device1 > Client, Device 2 > Host (Works if runs in editor, not in game build). Same results if I switch that around.

Yeah that's correct, clients connect to a Steam ID. Players start in Scene1 where they locate each other using Steam lobby system. They then load into the second scene which has the Dissonance prefab, players spawn in using a prefab ID which they assigned in scene 1.

I've pulled some logs, working vs not working (editor vs build), I dont think Dissonance is starting as host:

Editor:
DEBUG [Dissonance:Recording] (09:15:23.753) VoiceSettings: Loaded Pref Dissonance_Audio_Quality = High
DEBUG [Dissonance:Recording] (09:15:23.756) VoiceSettings: Loaded Pref Dissonance_Audio_FrameSize = Small
[Dissonance:Core] (09:15:23.756) DissonanceComms: Loading default playback prefab
DEBUG [Dissonance:Recording] (09:15:23.773) CapturePipelineManager: Not changing microphone device from '' to '' (equivalent devices)
[Dissonance:Core] (09:15:23.775) DissonanceComms: Starting Dissonance Voice Comms (9.0.6)
DEBUG [Dissonance:Network] (09:15:23.870) NfgoPlayer: Tracking NetworkStart for local player. Name=17564616-ddba-45de-bb43-41e307e83267
DEBUG [Dissonance:Core] (09:15:23.872) PlayerTrackerManager: Associated position tracking for '17564616-ddba-45de-bb43-41e307e83267'
DEBUG [Dissonance:Core] (09:15:23.917) VoiceBroadcastTrigger: Collider entered (1)
DEBUG [Dissonance:Core] (09:15:23.917) VoiceReceiptTrigger: Collider entered (1)
DEBUG [Dissonance:Network] (09:15:24.408) NfgoCommsNetwork: Starting network session as Host
[Dissonance:Network] (09:15:24.409) NfgoServer: Created server with SessionId:1700403822
[Dissonance:Network] (09:15:24.412) NfgoServer: Connected

Build:
DEBUG [Dissonance:Network] (09:22:56.191) NfgoPlayer: Tracking NetworkStart for local player. Name=
[Dissonance:Core] (09:22:56.220) DissonanceComms: Loading default playback prefab
DEBUG [Dissonance:Core] (09:22:56.222) PlayerTrackerManager: Got a player tracker for player 'ada294b2-da8e-492c-b48c-696045245a9e' but that player doesn't exist yet
DissonanceException: Voice Error: Attempting to start player tracking, but tracking is already started! Error ID: 4C2E74AA-CA09-4F98-B820-F2518A4E87D2
DEBUG [Dissonance:Core] (09:22:56.794) VoiceBroadcastTrigger: Collider entered (1)
DEBUG [Dissonance:Core] (09:22:56.794) VoiceReceiptTrigger: Collider entered (1)

Does the above help?

Cheers,

@martindevans
Copy link
Member

Can I get you to make a few changes and then send me the full log. I'll have a trawl through it to see if I can spot anything:

  1. In Assets/Dissonance/Integrations/Unity_NFGO/NfgoCommsNetwork.cs you'll find RunAsHost, RunAsDedicatedServer and RunAsClient (around line 60). In each of these cases add a message like this:
Log.Warning("Chrisbell123: RunAsX");

(making sure to change RunAsX to the correct one for that branch).

  1. In Window > Dissonance > Diagnostics change Core and Network to Debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants