Seeking Suggestions for AI NPC Communication in Unity Multiplayer

Hello everyone,

I am currently developing a Unity application that features AI NPCs capable of communicating with players and providing voice responses using the Chat-GPT real-time API. At this stage, I am focusing on the single-player phase, but I plan to extend this functionality to a multiplayer environment in the future.

Current Scenario

In my envisioned multiplayer setup, an admin can present scenarios to the NPC, which will then provide explanations. The remaining players in the room will listen to this conversation. However, I have some concerns regarding how to synchronize this interaction across multiple players.

Synchronization Methods

I have identified two potential methods for achieving synchronization in a multiplayer setting:

  1. Real-Time API Request from All Instances: This method involves sending requests to the real-time API from all instances of the game. However, I have found that this approach can be costly and may not be efficient for larger player groups.
  2. Admin Response Sharing: In this method, the admin would receive the response from the NPC and then share the audio with all players in the multiplayer session. While this approach is more cost-effective, it introduces a time delay that can lead to noticeable latency during gameplay.

Request for Suggestions

I am seeking advice on whether there are alternative methods to achieve synchronized NPC communication in a multiplayer setting without relying on the aforementioned approaches. Additionally, I would like to know if there are any feasible ways to integrate the real-time API with Photon Server to facilitate easier sharing of audio among current room players. Your insights and suggestions would be greatly appreciated!

Note : We are using the Photon Fusion SDK for Multiplayer connectivity.

Thank you!