Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

(one!) Example for async (passive) authorative multiplayer (for mobile, like word with friends etc.)

Discussion in 'Multiplayer' started by kragil, May 24, 2023.

  1. kragil


    Mar 5, 2015

    I cannot find _one_ example for a multiplayer game that can handle offline matchmaking with a stored game state.

    Think chess, you start a match, play your move and go offline.

    Then somebody comes online, starts a match and is then matched with the first player and can do his move. Then he goes offline again. When the first player come online again, he can do this move.

    A lot of mobile games have this kind of matchmaking, but for Unity I cannot find a single example and nearly all frameworks and game servers only support matchmaking with online players ..... Unitys netcode does not seem to be able to handle this use case. I would love to use Nakama, but it can't handle this out of the box, only with a lot of crutches. What are people using to build something like this? Why are there no examples? I would like a working example that is extendable. Thanks!
  2. CodeSmile


    Apr 10, 2014
    You do need online matchmaking. In addition you need a way to uniquely identify players, unless you want any random stranger to continue the next move of any random chess game in progress.

    The rest is just serializing the game state and session id and sending it to the server, and vice versa.

    This isn’t actually multiplayer. It’s mostly backend server/database transactionss. Perhaps this sort of gaming backend has a technical term that, if you know and search for it, brings up more hits.
  3. pKallv


    Mar 2, 2014
    I did a prototype for an upcoming game doing this and used UniRest asset as the connection point for the functionality:

    I used UniRest SyncTables as a base:

    If I remember correctly it was not that complicated. As CodeSimle correctly stated "This isn’t actually multiplayer. It’s mostly backend server/database transactions"

    Just saw that I unfortunately have deleted the project.