Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Turn-based game with unity transport

Discussion in 'Unity Transport' started by ElegantUniverse, Jan 7, 2023.

  1. ElegantUniverse

    ElegantUniverse

    Joined:
    Sep 13, 2018
    Posts:
    78
    Hello
    I'm working on a turn-based game with Unity transport, as you know in turn-based games there are not many packets sent and received in the game, so being sure about the message that is delivered to both server and clients is essential.
    what is the best way to have a persistent connection and be sure that the server and client have received the packet?
    note: we should consider it sometimes we have an unstable client connection and that client may every time receive a message or send a message with that connection.
    for example, when we use WebSocket most of these part has been solved but for Unity transport what is the solution?
     
    iamdrw and owlrazum like this.
  2. JohannRw

    JohannRw

    Unity Technologies

    Joined:
    Jan 26, 2022
    Posts:
    13
    Hi,
    If you want to add some reliability with Unity transport while using UDP, the recommendation is to use the reliability pipeline : https://docs-multiplayer.unity3d.com/transport/current/pipelines#reliability-pipeline.
    If you are more familiar with a WebSocket implementation, and if you are using one of the latest versions of the editor, (starting 2022.2), you can also upgrade Unity transport to 2.0 (Currently -pre release) that supports WebSocket transport. (https://docs-multiplayer.unity3d.com/transport/2.0.0/minimal-workflow-ws)
     
    owlrazum likes this.
  3. ElegantUniverse

    ElegantUniverse

    Joined:
    Sep 13, 2018
    Posts:
    78
    Does Websocket transport support on mobile (android and IOS) without any issues?
     
  4. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Do you mean if it's supported in a web browser running on a mobile device, or on native applications for these platforms? For the latter (native applications), yes it is fully supported. For WebGL builds running on mobile web browsers, then it will probably work, but bear in mind that Unity doesn't officially support mobile web browsers for WebGL builds, so we don't explicitly test for this scenario.