Search Unity

(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

    kragil

    Joined:
    Mar 5, 2015
    Posts:
    7
    Hello,

    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

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,989
    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

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    I did a prototype for an upcoming game doing this and used UniRest asset as the connection point for the functionality: https://assetstore.unity.com/packages/tools/input-management/unirest-solution-182485

    I used UniRest SyncTables as a base: http://tigerforge.altervista.org/docs/unirest-1-0/unirest-client/async-class-features/synctable/

    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.