社区问答

欢迎来到 Audiokinetic 社区问答论坛。在此,Wwise 和 Strata 用户可互帮互助。如需我们团队直接提供协助,请前往技术支持申请单页面。若要报告问题,请在 Audiokinetic Launcher 中选择“报告错误”选项(注意,问答论坛并不会接收错误报告)。我们内部设有专门的错误报告系统,会有专人查看报告并设法解决问题。

要想尽快得到满意的解答,请在提问时注意以下几点:

  • 描述尽量具体:比如,想达到什么样的目的,或者具体哪里有问题。
  • 包含关键细节:比如,Wwise 和游戏引擎版本以及所用操作系统等等。
  • 阐明所做努力:阐明自己为了排除故障都采取了哪些措施。
  • 聚焦问题本身:聚焦于问题本身的相关技术细节,以便别人可以快速找到解决方案。

0 投票

Hi all,

I'm working on a multiplayer game in Unity using Wwise, and I’d like to know if there’s a way to differentiate each local instance of my game when selecting the remote connection in the Wwise Profiler.

Currently, all instances show the same parameters, and the only difference Wwise displays is the port number, which makes it hard to tell them apart.
I’ve tried using: AkSoundEngine.SetNetworkName(instanceName);…but it doesn’t seem to work in recent Wwise versions.

Does anyone know a clean way to make multiple local instances easily identifiable?

Thanks in advance!

分类:General Discussion | 用户: Nicolas R. (140 分)

1个回答

+1 投票
 
已采纳

Hi Nicolas,

By default, the Wwise integration uses UnityEngine.Application.productName as the Application Name in the Remote Connections window if a custom network name is not specified in the Wwise Communication Settings (Project Settings → Wwise Initialization → Wwise Communication Settings → Network Name).

You can append a unique identifier to settings.szAppNetworkName in
Assets\Wwise\API\Runtime\Handwritten\Common\AkCommonPlatformSettings.cs
to easily distinguish your multiple local instances in the Remote Connections window. (Wwise 2025.1.2)

前 | 用户: Alessandro Famà (5.5k 分)
采纳于 前 | 用户:Guillaume R. (Audiokinetic)
Nice thank you, It's working! I didn’t think of actually changing the networkName directly from the script.

I tried appending a unique identifier, but I still need a reliable per-instance ID. Is there a way to read a network id from AkCommonPlatformSettings? Accessing the processor id is not ideal and seems unreliable, and choosing a random processor does not solve the problem.

Ideally I would like to know whether the instance is a client or a server and, if possible, a stable local network id for each instance. From inspecting AkCommonPlatformSettings it looks like this information might be not reachable. Could you point me to the exact field or API to read the network id, or suggest a robust method to generate a stable per-instance identifier on the same machine?

Thanks.
Wwise's network name and remote connection system are designed primarily for debugging and profiling audio in real time, not for tracking individual game instances in a multiplayer environment. That means things like distinguishing clients and servers or assigning unique identifiers are responsibilities for your game to handle.

A simple approach is to generate a unique ID for each instance at runtime and append it to the network name, or include role information like "Server" or "Client" so it's immediately clear which instance is which in the Profiler. For a more consistent identifier per machine, you could combine the machine name with the process ID, but anything like that needs to be done on the game side, Wwise won’t do it automatically.
...