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.
  2. Dismiss Notice

Learning Networking

Discussion in 'Multiplayer' started by DRRosen3, Jan 28, 2015.

  1. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    682
    I want to begin learning how to code the networking part of multiplayer. Specifically, in the end what I want to accomplish is something similar to Final Fantasy XI and Final Fantasy XIV. They're both MMO's, but they're not a single continuous world. Each game has various areas (zones) that players can enter and explore towns, or the wilds. However, each zone is always active. Just because there are no players in a zone, doesn't mean the zone "doesn't exist". I understand that for networking such as Photon and Unity's built-in networking, this DOES hold true.

    If I understand them correctly, a player has to be hosting the game, and if a player is not, the world basically doesn't "exist". I need my world to exist at all times, so that things like the passage of time is always occuring. I'm not trying to create the world's next great WoW or anything like that, but I do want to start learning how these massive worlds work.

    So what am I asking...?

    Can anyone point me in the right direction to learn how to network like this? Whether its text to read, or video tutorials. Thanks!
     
    Ony likes this.
  2. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    Please see back to my private message, as I've added in quite a bit of detail.
     
  3. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Before you get started making a multiplayer game, I suggest knowing what your multiplayer game needs and what tools can supply that. You seem to already know what your game needs so I'll suggest a great tool to supply that.

    I might be a bit biased because the developer was super supportive and friendly to me but I strongly recommend looking at Forge. It's pretty new and making huge advancements in development at a rapid rate. It's already fully functional and you can ask Brent (farrisarts) about joining the Beta to start networking your game right away.

    Forge works in Unity instances so you can run it on your server (maybe Amazon EC2) and simulate everything about the game from physics to movement. The framework for an authoritative MMORPG can essentially be something like this:

    1. Player presses movement button
    2. Game sends a message to the server telling it to move
    3. Server simulates the movement
    4. Server sends back the position

    When making your game, you can think of the server as the 'authoritative' player. Everything done goes to his world and gets simulated then the results are sent back (so Player A swings his sword, the server gets notified and simulates the sword swing, then updates the health of the goblin hit by the sword). This can be done easily with RPC's and periodic syncing.

    There are other options too, like having a 'dumb' server that simply takes in data and replicates to distribute to all clients (players simulate their movement then send their positions to other players). For a framework like this, I'd recommend Photon Cloud.

    If you'd like, you can also find some reviews and feedback I wrote of several Unity networking solutions here and look at your other options. There are others that are notable I haven't mentioned like Bolt and TNet.

    Each networking solution has its own documentations. I've only explained the general concept so you'll have to check out how to implement this for the specific networking solution you choose.
     
    Last edited: Feb 1, 2015
  4. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    I have a short video series if you would like to watch it going over some of the basics in Unity networking. I haven't completed the series because I began work on my own Networking library "Forge Networking" which is taking up all of my time as I am writing it and making video tutorials for it now.

    Please do feel free to send me a message with any questions and I'd be glad to help out! :D