Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What do I need in order to make a player-hosted online RPG?

Discussion in 'Multiplayer' started by RainyLad, Mar 8, 2019.

  1. RainyLad

    RainyLad

    Joined:
    Sep 15, 2018
    Posts:
    1
    Hey! I'm interested in making an online RPG, where the servers are hosted by players (Examples of this would be Minecraft/Terraria). This is different from an MMO where you have one big server and everyone connects to it. I'm talking about servers that are run on your own PC and hold up to 50~ people.

    I've toying around with PUN but I'm struggling with alot of technical issues, for example:
    The combat system is one where players get transferred to a new scene, and a combat sequence commences in a Turn-Based JRPG fashion. Some people might be in the battle sequence, some might not, it depends if they're in the same party. This means I cant sync up with the MasterClient or anything because they might not be in the same battle sequence as the others!

    So I saw there are Photon Servers, but is that what I'm looking for? I'm pretty new to all this, so I guess the core of the question is: What services do I need to use in order to make an online RPG like the one I'm describing?
    Thanks in advance!
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,732
    This can all be done with PUN, but not with 'out of the box' code, you'll have to manually manage network traffic and visibility/instantiation of networked objects depending on which map they are on and if they are in a combat sequence etc.

    As far as I'm aware there aren't much in the way of examples to be found that show how to achieve this, but you'll want to start by taking a look at RaiseEvent as this will be the way to go.

    https://doc.photonengine.com/en-us/pun/v2/gameplay/rpcsandraiseevent
     
  3. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    459
    As I've understood you probably do not want to use Photon in this case. While it is true, you can self host the servers (meaning you are running servers on your own pc or laptop), you still have to pay a license for each server. So if Bob wants to host a game in their home, Bob either somehow has to pay Photon or you have to pay for it. Even though your game is self hosted, Photon is asking money for using their software.

    In my opinion, Photon Servers would be a good solution if the servers the players can join, are all official servers, ie. you host them and they are available 24/7. But a bad solution if you just wanna kickstart a headless server on your computer for a lan party. Photon Bolt used to work that way but since they were bought, you can no longer host local servers without paying them (except the free, <100 CCU restriction). Though now that I think about it...can I host unlimited amount of Photon Servers if the CCU never exceeds 100? And even if I can, do I still need an app id for it to work?
    @tobiass

    In conclusion, Photon Servers are not designed to be what you need them to be.
     
  4. thegreatzebadiah

    thegreatzebadiah

    Joined:
    Nov 22, 2012
    Posts:
    836
    For a peer-hosted setup like you describe I would recommend anything but photon for the reasons already mentioned above.

    Personally what I recommend these days is Mirror.

    As for what service you would need: Regardless of what networking system you use, your player's servers are not going to be connectable if they are behind a router, so you're going to need some sort of relay solution.

    For that I recommend my own recently released Noble Connect asset which will work with Mirror in the next release.

    There are also many other options for your networking system if you look around. MLAPI is another prominent one, and it comes with relays, but you have to host them yourself, so still not totally free.
     
    Wattosan likes this.
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    While Photon Server would fit your requirements technically, we don't offer a redistributable license. So your players can't host the server you would have to provide. This model is currently not supported, sadly. :(

    The 100 CCU license is per game/title, so you can't just get a bunch of those to run lots of servers. ;)


    Edit: @RainyLad: You can use Photon Bolt for your case. Any player can host.
    It will cost per concurrent player (max in a month) like our other packages but it solves the problem of matchmaking, discoverability, has built-in Nat Punch Through and a relay as fallback, if some user's server/router/firewall isn't open for direct connections. It also comes with various nice features that your game may need, including interest management.
    It may be a good fit, actually.
     
    Last edited: Mar 19, 2019
    Stanchion and Wattosan like this.
  6. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    459
    What do you actually mean per concurrent player? As I understand then if a room with max 8 players is created, using PUN, then 8 spots are automatically reserved and go towards the CCU. So if only 2 players are in that room, it still counts as 8 CCU, correct? But in Bolt's case it is different then? If there are 3 people in a server then only 3 people count towards the CCU?

    Also, does Bolt require online internet connection to work even in LAN games? As I understand, it does because how else would you be able to count the CCU.
     
  7. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    For CCU (Concurrent Users), we always count the active connections at any time. The maximum per month is what we have to plan for and defines your fee. The CCUs are considerably less than DAUs, MAUs and downloads! None of your players will be online 24/7.
    It's the same for PUN and Bolt. The value of MaxPlayers for a room does not matter.

    Bolt Free must have an online connection for matchmaking, NAT punch through and relay on demand. Any user can host the game / session, however. There is no way to directly join via IP / locally.
    There is a Bolt Pro variant, which allows players to host and connect to a game locally (IP entry). This is not sold anywhere yet, mail us if you are interested.