Search Unity

RELEASED: JUMP Multiplayer for Photon PUN

Discussion in 'Assets and Asset Store' started by JuicedMauro, Jun 21, 2016.

  1. JuicedMauro

    JuicedMauro

    Joined:
    Jun 21, 2016
    Posts:
    3
    JUMP facilitates writing simple multiplayer games with Unity and Photon Networking (PUN).

    Available on the Asset Store here: http://u3d.as/uRe

    JUMP provides:
    - A simple flow for connecting to the server, matchmaking and starting a multiplayer game
    - Authoritative local Server (using Photon Master Client)
    - Streamlined Client-Server communication
    - Custom Client Commands and Server Snapshots
    - Sample Project and Prefabs to get started in 5 minutes
    - Full source code access and great customization

    Note: JUMP Requires the Photon PUNpackage, you can download the free version here:

    See more details at http://maurgi.github.io/JUMP/
     
  2. JuicedMauro

    JuicedMauro

    Joined:
    Jun 21, 2016
    Posts:
    3
    JUMP (Just Unity Multiplayer with Photon)
    JUMP is a library that facilitates writing simple multiplayer games using Unity 3D and Photon Unity Networking.

    I was working on a multiplayer game and found myself in trouble trying to handle events from Unity and Photon at the same time; ending up with fragile code - so I worked to streamline and simplify the scenario and build a reusable library.

    Out of the box, JUMP Provides:

    • A simple flow for connecting to the server, matchmaking and starting a multiplayer game
    • Authoritative local Server (using Photon Master Client)
    • Streamlined Client-Server communication
    • Custom Client Commands and Server Snapshots
    • Sample Project and Prefabs to get started in 5 minutes
    • Full source code access and great customization.
    Current Version
    [0.2.0] - 2016-05-05

    For details, see Changelog

    Table of Content
    How to Install
    You can get the source code here or download JUMP from the Unity Asset Store.

    Prerequisites
    JUMP works with Unity 5 and requires Photon PUN to function properly:

    1. Install Photon PUN Free or Photon PUN+
    2. Configure your Photon Application ID - see Initial Setup
    For more information about configuring PUN, see PUN Setup.

    Note: JUMP was tested with Unity version 5.3.4 and Photon PUN Free version 1.67

    Option 1: Unity Asset Store
    The Unity Asset Store package includes the DiceRoller sample project.

    • Download JUMP from the Unity Asset Store.
    • Add all the scenes in the DiceRollerSample/ to the Unity build
    • Open the DiceRollerConnection scene and start Unity.
    • The DiceRoller sample should go to the Matchmake scene in connected mode.
    Note: To test multiplayer games in Unity, you will need to run two copies of the game, so that they can connect to each other. The best way, is to build a copy of the game (File/Build & Run) for one player and start Unity debugging for the second player. See this Unity forum post for more details.

    Option 2: From GitHub source code
    In alternative to use the Asset store, you can create a folder in the unity project (under Assets) and copy all the files from the JUMP Multiplayer\ folder. Then you can use the Object Model and the prefabs.

    Scenario
    The scenario supported by JUMP is very simple and designed with mobile multiplayer games in mind:

    Two Players networking
    JUMP automates building Photon game rooms, easy.

    Note: While it supports more than two players, we tested JUMP with the two players scenario

    Basic Matchmaking
    JUMP uses Photon Random Matchmaking without the use of the Photon Lobby making the UI and the object model much simpler to use compared to the use of the Lobby.

    Streamlined UI flow
    JUMP supports up to five different Unity scenes:

    • Connection
    • Home Page (Master)
    • [Room] Waiting for players
    • [Room] Playing the game
    Note: support for multiple levels can be added to the Playing the game scene.



    Custom Server
    JUMP cannot provide a dedicated remote server using Photon Unity Networking or Photon Cloud, so it uses the Host model, where one of the clients also hosts the Game Server (sometimes calledLocal Server)

    Photon provides support for this with the concept of Master Client.

    Client-Server Communication
    JUMP supports the concept of an Authoritative or Semi-Authoritative server using a Command/Snapshot Client-Server communication:

    • The Client sends Commands to the Server
    • The Server sends Snapshot to the Client
    The model is similar to the one explained by Fast Paced Multiplayer, but we use the termCommand instead of Actions and Snapshot instad of New State



    The slanted lines indicate that there is lag between the client and server communication, seeFighting Latency on Call of Duty III

    While it is possible to optimize the client/server communication in terms of reliability and space utilized with delta compression of snapshots and queues of commands, JUMP simply uses Photon Reliable UDP to communicate, it is a good balance of reliability and ease-of-use.

    References
    JUMP Multiplayer with (Semi)Authoritative Server model is based on lots of literature on multiplayer games:

     
  3. benopotomus22

    benopotomus22

    Joined:
    Dec 18, 2015
    Posts:
    1
    This project is great for learning server architecture! Highly recommended. Do you think you'll be continuing development? Recreating the Gambetta demonstration inside unity for prediction and reconciliation would be awesome.
     
  4. JuicedMauro

    JuicedMauro

    Joined:
    Jun 21, 2016
    Posts:
    3
    Thank you for the feedback!
    The Gambetta demo (http://gabrielgambetta.com/fpm_live.html) is a pretty sweet idea - if there is enough demand I might go for it ...
     
    hakankaraduman likes this.
  5. Kalle801

    Kalle801

    Joined:
    Mar 3, 2013
    Posts:
    80
    Please make a Demo Video. Im a unity starter and dont know if i really could do anything with it.
     
    maurgi likes this.
  6. maurgi

    maurgi

    Joined:
    Jun 1, 2016
    Posts:
    4
    *** VERSION RELEASE UPDATE ***

    Newly released version 1.3 including support for Offline Bots -

    See updated documentation at http://maurgi.github.io/JUMP/

    Offline Bots allow a very simple interface to write bots and to ensure that your players can enjoy your even when there are not enough people online.

    To create a Bot, you just need to implement the following interface, you will receive Ticks from the server and a pointer to your custom Engine - the Bot will be able to see the other players and determine the best strategy for an engaging offline game.

    public interface IJUMPBot
    {
    void Tick(double ElapsedSeconds);
    IJUMPGameServerEngine Engine { get; set; }
    }
     
  7. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    maurgi,
    You referenced the Gambetta series on the Jump "details" page but, does that mean you implemented that type of prediction and reconciliation in the Jump code/examples?

    Thanks.
    -- Paul
     
  8. maurgi

    maurgi

    Joined:
    Jun 1, 2016
    Posts:
    4
    Hey Paul -
    No I did not have the time and resources to implement it but I think it can be done on top of what is there -

    Thanks
    Mauro
     
  9. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    Hi does your project illustrate how to implement a multiplayer leaderboard with PUN

    Thanks

    Daniel
     
  10. maurgi

    maurgi

    Joined:
    Jun 1, 2016
    Posts:
    4
    Hi Daniel -
    JUMP it demonstrates connection, matchmaking and playing a multiplayer game with Photon in an easy way.

    Leaderboards are usually an offline activity, you record the results of the games to a leaderboard service and then you compare your score with your friends or with the top players.
    You can use a platform service like Game Center on iOS, or a platform independent one like PlayFab.

    If you are talking about a scoreboard instead (the score of all the players during a multiplayer game), then yes, that is demonstrated in the sample, the score of both players is visible in the game, and can be generalized for more players.

    HTH
    Mauro
     
    MTDues likes this.
  11. MTDues

    MTDues

    Joined:
    Mar 27, 2014
    Posts:
    27
    Hello, can this be used as a lobby for a project i made with UFPS Multiplayer ?