Search Unity

What message protocol can be used to pass game data between external devices in real time

Discussion in 'Multiplayer' started by MoombaTroopa, Jan 9, 2023.

  1. MoombaTroopa

    MoombaTroopa

    Joined:
    Dec 6, 2015
    Posts:
    1
    Imagine an online party game like Jackbox games, there an external device that plays a game and generate numbers or answers to a question and another Unity application on a different device needs to receive that data and display it and also send off it's own data about a player that's interacting with it such as whether they picked the correct answer to the question. This needs to happen in real time and there may be many users each with their own device playing at the same time.
    The idea here is that only one device has the game and all the others are just displaying info and don't have any of the game logic.

    What messaging protocol can be used to do this and would it be possible to get an external service that links the messages coming in and out so that the Unity app doesn't have control of the messaging app. The idea here being that if I have to change the messaging system/API then I'd only have to make sure the external service is adapted to the new messaging system/API.

    Any suggestions with pros/cons would be appreciated.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,888
    Sounds like you simply need to send UDP packets.

    I would look into Unity Transport (part of Netcode for GameObjects) to see if it can be used to send data between different builds. Otherwise simple UDP messaging implementations are available as open source, shouldn't be hard to find.