Search Unity

Multiplayer game but with single player scene

Discussion in 'Multiplayer' started by Hepifish, Dec 2, 2019.

  1. Hepifish

    Hepifish

    Joined:
    Sep 11, 2018
    Posts:
    2
    Hi guys,

    I'm pretty new in the Unity world, so maybe it's a dumb question, but I can't find anything related to it or I don't know how to search.

    I want to create a really basic game in which your only action is taping on a box. Each tap adds up to your score. I've finalised the single player game and now I want to move forward with the multiplayer game.

    The goal is to have the same logic as prev described, but in a multiplayer environment. Meaning that I would have a lobby where people connect, then the game starts, then the same scene as in the singleplayer would be rendered and after a certain amount of time, the game would end and the ranking would be displayed, with all the players that have joined that lobby.

    Initially I thought that maybe it could be easily made with Push Notifications, but I think that would bring a lot of overhead when working with the lobby and all the states. I've found solutions like Photon Unity Network, which work really nice when creating a lobby and managing the states, but it seems rather unpractical when there are no interactions between users. I've also read about creating multiple scenes and rendering them at different positions, but that seems also a bit of overhead for my case.

    Do you have any suggestions for what I could use in order to make this multiplayer that looks like a singleplayer game?

    Any advice is more than welcomed,
    Thanks :)
     
  2. Youdaman

    Youdaman

    Joined:
    Apr 8, 2017
    Posts:
    8
    It sounds like the players don't have avatars that need to co-exist in the same level, so you could probably avoid using a standard multiplayer approach and instead coordinate things using data only.

    One approach that springs to mind is to use a realtime database like Firebase. They have a code example that implements a leaderboard, see here https://github.com/firebase/quickstart-unity/blob/master/database/testapp/readme.md

    You'll obviously have to get your head around Firebase realtime database concepts but that would take less time than learning a multiplayer framework and converting your game logic imo.

    I don't work for Firebase but I recommend them because my day job is as a app/web developer and I use their database and other services for many of my projects.
     
    Joe-Censored likes this.
  3. Hepifish

    Hepifish

    Joined:
    Sep 11, 2018
    Posts:
    2
    Thank you for the answer :)

    I'm already using Firebase realtime db for users, so that wouldn't be a problem. I guess listening to changes to the DB together with PN would do the trick.

    Cheers!
     
    Youdaman likes this.