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

Unity MMO capability questions

Discussion in 'Multiplayer' started by Makosai, Feb 25, 2016.

  1. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    Introduction
    Hello. I have a few detailed questions about networking. I don't expect them all to be answered in one post. Answering just one question, or sub-question, is fine. I may update this post if anything else that concerns me comes to mind. If I do update it, I'll be sure to write a timestamp next to it.

    Situation
    These questions are in relation to Unity 5.3.3 Pro (I say Pro because some resources may come in handy here) and a Linux operating system - preferably Debian Wheezy.

    Questions (all questions answered - new ideas posted here)
    1. Should I split the chat server and game server to minimize lag and possible bottlenecking?

    2. Will Unity3D properly make use of multiple cores naturally? Is there anything I need to do to aid Unity3D in utilizing difference cores for different operations? If the answer to both of these questions is no, then is it safe to assume that getting multiple servers with single cores, higher frequencies, and better cache is the better route to go?

    3. Scenario - If the game were to, hypothetically speaking, achieve 10,000 players and the maps were big enough to spread them around so you don't have 100 players in one spot:
    A) Should I separate the map in to "network"-chunks and have a server for each "network"-chunk (visually the map will load in chunks on the client, but I'm referring to the network aspect at the moment)? To be more clear, rather than handling calculations and network transfer for every player on a single server, should I figure out some way to break up the work between different servers? If this is the case, what would be a theoretical method to achieve switching between servers seamlessly. I say "theoretical" because I can do research myself, I just need the general idea on how to go about doing it. Such as should the two server boxes have the same IP, different port, and then the client just connects to the second port when they enter the new chunk.

    B) If I were to give up the server-authoritative scheme and let the client handle calculations (ultimately offloading processing power from the server), should I still separate the map in to "network"-chunks or is it safe to assume that a single server can handle simply sending packets (providing that the network allows it)?

    timestamp: 6:30pm EST - 2/25/2016
    I talked to Kennux for a bit and came to a conclusion about my server model. As an example, I have 10 instances of my game to break up the processing between 10 chunks. These instances go on one server box. In addition to that, I have 2 server boxes totaling 20 chunks / instances. In crontab, or whatever I may choose to use for startup commands, I tell it to run the game's file 10 times. Every instance that starts begins to send packets every 10 - 60 seconds. These packets request instructions from a master server. When it finally get instructions from the master server it stops sending these packets. The master server then increments its online chunks parameter. Until there are 20 (max) chunks online, no players can join. The master server holds the server data (IP and port) and tells the player which server to join.

    4. There is something I have never understood how to efficiently accomplish. How would I prevent a player from hosting a "network"-chunk if they were to have a Linux OS? My previous networking project tried to attempt this by having a few checks: It checks that the host IP matches the subdomain of a website & that their is a file present with certain text present. I used PHP on the domain to also get the current IP of the host. This seems like a bit too much. Isn't there an easier way to go about this? Especially since not all servers may have the same IP.
     
    Last edited: Mar 3, 2016
  2. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    I dont want to be negative, but to make the story short, unity is not mmo capable out of the box, never was and never will be any time soon.

    dont beat a dead horse with a stick,
    instead, try a really mmo capable engine built for specially to handle such a task, ie:
    hero engine, big world engine you cant go wrong with any of these 2 mmo capable engines built from the ground up specially for that.
     
  3. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    I appreciate your concern for not being negative. Thank you. However, I still feel that some of these questions would be beneficial wherever I go. If you could perhaps give me some insight on on how to tackle organizing the networking that'd be great (basically answering any aforementioned applicable questions).
     
  4. kennux

    kennux

    Joined:
    Aug 25, 2013
    Posts:
    43
    Since the new networking in unity 5 you should be able to implement mmo-like networking without too much trouble using the LLAPI which takes all the networking stuff already away and you just need to implement the highlevel logic for your game.

    Anyways i dont think you can use the HLAPI without any modification for creating mmo games.

    So, to your questions:
    1) I would seperate them, for 2 simple reasons: Make cross-world/instance chatting possible (example for a friendslist) and it doesnt really need to run in the world server.
    2) Unity does run stuff on different threads, if im not mistaken unity physics, rendering and your game update logic all run in different threads (Physics does for sure: http://blogs.unity3d.com/2014/07/08/high-performance-physics-in-unity-5/). You could also just host multiple instances of your server that all handle different regions / instances for the game to make use of the other cores.
    3)
    A) This is depending on how much load to expect on a single instance. You can for example also just seperate world simulation, npc logic and character / login server. But if you are going for a classical mmo with a pretty big world imho the best should be to seperate the world into chunks and let each server handle a single chunk.
    You can keep your world streaming in sync with your chunk servers, so when loading a chunk in your world you also connect to this server and start accepting data from it.

    B) Just dont do that for an mmo game at all (Cheating / Hacking in MMOs is a very important topic and client authority lets the door for this wide open :p). But if you want to, it again depends on how much load to expect but a NAT punchthrough / Relay server is ways less processing expensive.
     
    Last edited: Feb 25, 2016
  5. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    Good point. I guess that clears that point up.

    I guess I'll experiment with some things. I've never tried to closely examine the processor when running Unity because I've mainly done single-player games. Thanks for the insight.

    Yeah, I briefly thought about the whole cheating thing. The idea to drop server-authorization in trade for less processing on the server's side spawned from my idea to have player moderators. I was hoping to have the moderators keep rule-breakers in check. I'm still leaning more server-authorization but removing it is on the table for options. If I could somehow minimize how easy it is to hack, that'd be awesome.

    The only thought I had to somewhat solve this, and it's purely a theory, was to handle server-auth over time. In short, rather than handling them on every request, handle them every 10 requests, as an example. Another thought was to have nearby clients handle the authorization (no, there won't be peer-to-peer). Sort of like a client-server-client authorization. It'd increase data usage but would share processing between everyone. Just thoughts.

    ----

    Just to be clear, my questions are already answered. But, it'd still be nice to still have a discussion so I can make plans before I start programming. That way I can get everything done without having to fix huge mistakes.
     
  6. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    Added question 4.
     
  7. ikefrc

    ikefrc

    Joined:
    Jul 3, 2012
    Posts:
    81
    How do you envision using the LLAPI to control network traffic server side? Let's say you want to handle position updates of players with LLAPI. You can either use Update() which is bound to frame rates (which a headless server does not have) or FixedUpdate() which is useless for anything not physics related (http://forum.unity3d.com/threads/the-truth-about-fixedupdate.231637/). So how exactly does one retain control and control whether he send packets to a player at a rate of 20 times per second or 30 times per second?
     
  8. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    HeroEngine really isn't even an option any more. They have run into financial trouble and have had to shut down most of their servers and stuff. The biggest Indie MMO being created with it (The Repopulation) have had to switch to Unreal Engine 4 so that they wouldn't have to deal with the issues that Hero is currently facing. So if you want your game to have a Stable future I wouldn't go with Hero until they get everything sorted out. BigWorld I don't know much about since I have never used or been associated with anyone who is using it. (Repopulation did for a short amount of time before they switched to Hero).
     
  9. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    Do you have any proof behind this "financial trouble"? I'm not saying you're incorrect, I'd just like to know your source.
     
  10. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
  11. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    damn, I was not aware of hero engine issues, it has been like almost 4 years since i stopped using it, altho seems they are back in business as per this update:
    https://community.heroengine.com/forums/index.php/topic,6104.0.html

    also did not know the repop stopped their dev in hero to switch to UE4,

    I hope heroengine picks up back again. otherwise they might go open source soon, which is not a bad thing for some people.


    I have used both, hero and bigworld and if i were to do a commercial game, my best choice would of been BigWorld engine, they wont go anywhere any time soon, now that it has been bought by the multi million gaming studio wargaming,net with world hit world of tanks game and the others released later by same company.

    meaning Bigworld is a proven real life mmo engine tech which i guess noone can not argue with that when i comes to handling real massive ammount of players for a real mmo game of any sort.

    so I guess ill can say i would trust BigWorld engine very much because of the proven technology and multi million company behind it, i dont think it will go anywhere anytime soon.
     
    Last edited: Mar 2, 2016
  12. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    BigWorld is proven to be a reliable engine when it comes to smaller Lobby based MMOs Like as you mentioned World of Tanks and it's spin offs. However it has yet to produce any real Massive MMORPG that wasn't lobby based. Also their Indie License or at least their cheapest Indie License came with no MySQL Database support. The database was a Flat file system which I guess would be good enough for development but I doubt it would stand up well post release.
     
  13. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    Anyone making posts looking for guidance on how to go about making a MMO should likely steer away from BigWorld. I really appreciate their candidness and being upfront about costs. They clearly inform people that their licensing is going to costs hundreds of thousands of dollars. If you have that kind of money, you likely don't need to be asking these kinds of questions. ;)
     
  14. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    What did BigWorld do away with their Indie License?
     
  15. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
  16. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121

    Actually, BW engine has more than 15 mmos titles released under its belt, most of them Chinese or Korean mmo games all released and commercial games outhere, not just lobby games as you mentioned, real mmorpg games making profits even as we speak.

    clarification on the indie license, BW engine release BW indie 2.1 on Nov 2012 which can handle now support for MySql database, so even with indie license BW is quite suitable to handle any sort of mmo game and can handle millions of concurrent users at a time.
    guys, I am not advertising here, I do know for fact all this since I used to work on a commercial title using BW engine a few years ago. I have use and tried all sort of engine, but so far there is nothing outhere up to date that can compare to BW engine when it comes to networking capabilities as BW engine backend server.

    I want to make a clarification, BW server is the best you can get outhere for networked games, it can handle whatever you can throw at it, easy to use, server deployment is easy as it can get, if your game all the sudden gets flooded with users overnight, all you have to do is install server in other hardware node configure settings and fire it up, the server will auto load balance itself all across all the hardware nodes without any human intervention, get more ccu again? deploy other server do the same, its easy as cake, you can do this over and over as your user base grows larger, the server itself will do the dirty job for you.

    the only drawback is the BW client, i am saying drawback because compared to the beast of BW backend server, the client could be better, and better in a sense that the graphics are not that high tech, it can only handle DX9 altho BW 2.1 had great upgrade on graphics wise, but dont compare to today's DX11 capabilities.
    I mean is not bad or ugly at all, what you see in World of Warcraft engine graphics, BW can also compare aswell and even a little bit better imo.

    anyways, BW client side is not bad at all, specially for an mmo game,besides you dont see a high end graphics game in an mmorpg game nowadays, and the reason is obvious since their focus is massive worlds and concurrent users with a decent graphics for a fast and lag free enjoyable experience with millions of players online.


    So, if you really want a true mmo engine and if you are happy with DX9 rendering and if you are comfortable with python game logic scripting BigWorld is what you looking for, I know this for fact too because I do own a license of BW engine indie version 2.1 with mysql support db.
    they dont advertise 2.1 since it was a free upgrade from BW 1.9 indie license holders.




    cheers
     
    Last edited: Mar 3, 2016
  17. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    They don't seem to offer Indie at all anymore...period.
     
  18. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    you right,
    they dont support indie licenses anymore, only commercial ones, well at least existing indie licensees can still enjoy it.
    glad i am on of them incase i want to do so.

    too bad new ones wont be able to do so, unless they buy commercial :)
    I imagine cost, at least $300k and up fees for commercial licenses. ouch

    and I understand why, before BW was owned by wargaming.net they had indie licenses to continue business, but now that multi million dollar wargaming.net acquired it, their main income is not the enigine itself but the titles they made with it. so they dont care to earn a few bucks from indies anymore, they are after the big profitable studios :-(
     
  19. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    After a little bit of a discussion with others, I've come to a conclusion that a chunk-based networking system is a terrible idea. Not only does it require there to be multiple servers present, but it also has another drawback other than being expensive. It fails when you have large events. If this is a chunk-based system and you have a large amount of players in 1 location, you run in to issues. You'd have one servers doing all that work. And, let's just go back to the fact that this chunk-based system still requires multiple servers.. meaning multiple payments and management costs.

    Instead, I revised my plan and would like to go over some things I changed with the game as a whole. It's still an MMO. I mean, I plan for it to be able to support a massive amount of people online. So.. yeah. Definitely still an MMO. One thing that's very different though is that I plan for it easily hosted by players as well. This means a player should be able to have a single server and be fine. But, just one server isn't enough. So, I thought of a way to expand on the processing power. I've gone through a lot of revisions. These revisions solved latency issues between hardware (because my first idea was the have each server communicate with each the master server and back, rather than directly to the client) and also over the network. Here is my final thought on how to handle networking on a large scale while also allowing room to support, to the best of my knowledge, an endless amount of additional servers:

    Setup
    There are three separate files for this project. The Master Server (Linux only), the Server (Linux only), and the Game (Win/Mac/Lin). The Server and the Game are technically the same files. The only difference though is if there is a password.pub file present the Game acts as a Server. Once the Master Server starts up, it runs the Server and also generates a highly encrypted password and password.pub file. The Master Server begins listening for connections from a Server and a Game (note: Game connection requires at least 1 Server authenticated). The Server reads a configuration file to find out the IP of the Master Server. The Server then sends the password in password.pub to the Master Server. The Master Server receives the password and validates it with the private key. If it is not valid then the connection is dropped. If it is valid then the Server is added to the "serverList" variable in the Master Server.

    Connections
    If a Game tries to connect to the Master Server, the Master Server will first verify that there is at least 1 Server in its "serverList". If there is, then the Master Server will permit the client's Game to connect. Once the client's Game connects to the Master Server, the Master Server will assign the Game to a Server that is handling the least amount of players. The Game will be given this Server's IP and will make all computational requests to it. The only time the Game would make a request to a different Server is when the Master Server feels that one Server is starting to have a far greater number of players than other Servers. At this point, the Master Server will start to tell the Games of clients that they should change their assigned Server.

    Reallocation
    When one Server is determined to have a far greater number of players than another server (%-wise) then that Server will be sent a "redirection" variable that contains an IP. Any Game that makes a request to a Server with its redirection variable set will be assigned a new Server. Additionally, the Server will get a "redirectionCount" variable that indicates how many players are to be redirected before discarding its redirection variable. It should be noted that when a Game is assigned a Server, the Master Server increments that Server's "playerCount" in the "serverList". It should also decrement the Game's previous Server's "playerCount". This allows for the addition of Servers very easily while the Master Server is running and the game is online. This also allows for Servers that fail or disconnect to redirect Games elsewhere. If a connection times out, the Game will request a new Server from the Master Server. If there are no Servers present, the Master Server will tell all Games to please wait and that it will send the Server IP when there is one present.

    ---

    I already started working on this with the Transport Layer API (TLAPI). I haven't done anything fancy with the TLAPI yet. I can definitely scrap the code at anytime. I'm also all ears on suggestions for other solutions (languages/APIs in particular) to this network architecture in the most efficient way possible. I am also open to any suggestions on how the aforementioned idea can be even more efficient, but not drastically changed.

    Also, when I said I could scrap the code, I meant it:
    Code (CSharp):
    1. using UnityEngine.Networking;
    2. //http://docs.unity3d.com/Manual/UNetUsingTransport.html
    3. public class MasterServer : NetworkManager {
    4.  
    5.     // Configuration Channels
    6.     int reliableChanId;
    7.     int unreliableChanId;
    8.  
    9.     // Sockect Configurations
    10.     int socketId;
    11.     int socketPort = 7000;
    12.  
    13.     // Communication
    14.     int connectionId;
    15.  
    16.     void Awake() {
    17.         // Initializing the Transport Layer with no arguments (default settings)
    18.         NetworkTransport.Init();
    19.  
    20.         // Configuration Channels
    21.         ConnectionConfig config = new ConnectionConfig();
    22.         reliableChanId = config.AddChannel(QosType.Reliable);
    23.         unreliableChanId = config.AddChannel(QosType.Unreliable);
    24.  
    25.         // Max Connections
    26.         int maxConnections = 10;
    27.         HostTopology topology = new HostTopology(config, maxConnections);
    28.  
    29.         // Socket Configurations
    30.         socketId = NetworkTransport.AddHost(topology, socketPort);
    31.         print("Socket open on port " + socketPort + ": ID #" + socketId);
    32.  
    33.         // Communication
    34.        
    35.         NetworkTransport.Disconnect(socketId, connectionId, out error);
    36.         NetworkTransport.Send(socketId, connectionId, reliableChanId, buffer, bufferLength, out error);
    37.  
    38.     }
    39.  
    40.     void Connect() {
    41.         byte error;
    42.  
    43.         connectionId = NetworkTransport.Connect(socketId, "localhost", socketPort, 0, out error);
    44.     }
    45. }
     
  20. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    A Chunk based Server as you describe it is the only way to go for true MMOs. If you want players to be able to host the server as well then it can't be a true MMO with thousands of players in a single world. For a true MMO in Unity the best way to go is similar to how uPikko from MuchDifferent handles load balancing. Be able to dynamically load balance the servers as the user base changes. Don't have set Server regions. Use a Quadtree and once the player limit exceeds a giving thresh-hold sub-divide the QuadTree until there are no regions that has more players then a giving number. Then have a way to offload the sub-divided regions to other server instances as needed and automatically reconnect the client to the needed Server instance.

    And yes any true MMO is going to require a Cluster of Servers not just a single server which is going to cost money.
     
  21. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    I'm a friendly guy. So, please read my posts with a smile. After writing the post below, I feel as some parts are vicious! I'm sorry if it comes off that way.

    What exactly makes you say that it's the only way to do this? And what do you mean when you say true MMO? In my mind, and this is purely an opinion, I feel as a "massive" number of players would be 1000+. With that being said, 100 is a pretty big number still. So, let me step back a little bit.

    My original goal here was to create a multiplayer server that would be able to support a very large map. The map is large to support a very large number of people. Because this project is still in an outlining phase, I made some minor changes. Initially players weren't allowed to ever host, the maps were going to be expansive, and the game was going to run on a chunk-based system.

    Rather than having things on a fixed size, even though you said divide the chunks -- which is not fixed, I decided to designate each player to a specific server. In my opinion, it feels like it would result in far less calculations (since I assume that I would have to calculate the chunks and the location of each player in relation to those chunks). To balance things between each server, I thought of a way to reallocate users to a new server (which I will improve on later -- I'm just going to add in a method where it will reallocate them to multiple servers if there is more than one server that needs more players).

    Additionally, players are now allowed to host. I talked with someone and it was brought to my attention that... honestly I have no real reason to prevent the player from hosting their own server. I mean, there's a single player mode for goodness sake. Why not let them host their own? This led me to think of a more efficient model in terms of cost and efficiency. Now, I won't boast and say that my method is the best out there. Because I know it's not. But it's definitely far better than my other solutions. This method allows for a game to be ran on a single server. And let's just say, for guesses, it can only sustain 100 players. So, if you want 101 players all you need is a second server. My plan was to make it easy to setup. So, the only thing needed to be done is to:
    • Change the IP in the configuration file from localhost to the IP of the host
    • Start the server
    That's it. Done. It can even be done while the game is running. So there's no need to shutdown. Once the Master Server detects that there's a server in the list that has a far less number of players connected to it, it tells the other servers to send some players to it. There's no computations, every value is indexed, and the players only communicate with the Master Server once (or twice if all servers go down -- read the example in my previous post about this). After that initial communication, they have an absolute direct connection to the server they were assigned to.

    To add on to this, I decided that the maps would be as big as the host wants them to be. Since the map is practically nothing but islands and water (and perhaps continents if I choose to add that), I felt that it would be interesting if the host had the choice of including islands of their choice or a random selection with a maximum island variable.

    Well, I don't know if that's true for sure. I mean, I'm no rich guy. And I don't intend on requiring a lot of funds just to start this project. That'd just be stupid. If I can think of a way that's cheap and would still work, then I should probably do so. Which I have already. Unfortunately, as I type more and more words, I think of more flaws in it. But I also think of ways to fix those flaws. Mind you, this is my first time making a large network like this on my own. I'm all open to criticism on my current methods and I'm also open to fully explained ideas as I have done in my previous post. Theoretical explanations don't really help me much when it comes to designing every aspect of the server. That's the equivalent of opening a door for me but not telling me where it leads lol.

    I won't pretend I know what a QuadTree is. But, I will say that I did briefly Google it just now. I feel like that's just a whole new thing I'm going to have to learn if I were to go this route. I also feel like my current method, without the chunks, would be easier and better to maintain.

    If you still feel like using QuadTrees is definitely the way to go for this, then would you so kindly enlighten me on the just the concept of it at the very least? Share your knowledge with me, if you will!

    Oh! Definitely. It will indeed. But I'd like for the user-base to be able to survive without forking over a large chunk of their income on servers for a game, especially when I'm not even the one being paid for said servers. Even if it were my servers and I were leasing it to them, that'd just be cruel.
     
  22. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    So in your example... A Server can host 100 players (Just an example)... When it reaches 101 it sends that player to a new Server... So what your talking about is having multiple versions of the game world all instanced off... So each player would only be playing with maybe 99 other possible players. Is that correct?

    If that is not what your talking about but instead want them to be able to see ALL the players but be controlled by different servers then how do you expect the Client to get the position information for the players being controlled by the other servers?
     
    Makosai likes this.
  23. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    Also if you want massive worlds you will still have to break your terrain up into chunks or regions both on the Client and Server then on the client page in the terrain as the player moves around. Unity will not support massive worlds and still have decent performance on the client with out Terrain Paging. This can be done through use of the Resource Folder, Async Scene Loading with each chunk being built in it's own scene, or through the use of asset Bundles. Using Asset Bundles you could even allow your players to create their own unique worlds and then stream the world into the client through the asset bundles. I'm attaching my Client Side Terrain Manager so you can see one example of Terrain Paging. I currently use the Resource Folder and my Chunks have a specific naming convention based on their location in the world (Example: terrain_x0_y0).
     

    Attached Files:

  24. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    No. This would be a player limit. In my example, the only time you want to add an additional server is when you start experiencing lag or bottlenecking (i.e. The server becomes unable to handle all of those players by itself). 100 players was a guess, or an example if you will. And it's not an accurate guess either. Because we haven't taken server specs in to account. So, it's just an example.

    Great question! And it's a very good question too because it's what caused me to write this:
    The answer to that though is, I don't know. But I don't find it to be impossible to handle. Yeah, it will probably result in me changing the whole networking system yet again. Or it probably won't. The quickest thing I could think of was that the client should send data regarding nearby players. The server would then send updates to the player and the nearby players. Not the best idea because:
    • How do you get the IP of these players?
      • You could send the IP to the player. But this brings in client-client connections. Which also brings in security risks.
    • How do you get the ID of these players?
      • You could use C# to send the Server IP to nearby players with a unique ID number for the initial player. The nearby players send the ID to the Server and when the Server is ready to send data back to the initial player it also sends it to the nearby players who have sent this unique ID.
    • How are the players going to spawn on each other's client?
      • I have absolutely no clue. I know Unity's UNET can now sends updates to nearby players if you want it to do that. But, spawning 1000 players on a single client? I don't know the limitations there. If there's no limitations then I feel like it's fine as it is. However, a more efficient way would be to use a chunk-based system to spawn them in. And the chunks would only be used to spawn them. They would despawn when the chunk is unloaded.
    Mind you, none of those ideas are solid. They're theoretical ideas that, if given time, I can improve on. In this case, I didn't have time. I just thought these up on the spot.

    I still plan to do a chunk-based system. I already know how to do that part. Networking is the part I need help with, which is why I made this post.
     
  25. MMOInteractiveRep

    MMOInteractiveRep

    Joined:
    Apr 7, 2015
    Posts:
    88
    In no way would you want to spawn 1,000 players on a single client... There wouldn't be enough Bandwidth to keep that many clients updated with each other to say nothing of the performance impact for rendering that many... This brings in the term Area of Interest. You would only want to update a player with the positions of other players with in a certain radius of the player. The Server should be the authority of all Game Breaking Calculations or Systems that if Hacked could give the hacker an advantage over other players including Position of the players. What you could do is have the servers all connected to each other so then you can get the positions of each player.
     
  26. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    As I mentioned before, "I know Unity's UNET can now sends updates to nearby players if you want it to do that." And I don't think Unity will render them all if they are far away. Only the ones in view. Still, I feel like spawning them chunk-by-chunk is the way to go. Sort of like entering a new area in a game. When you enter, it usually connects you to a new server with different people on it. But there's typically multiple servers for that one area. But, enough talk about that... I want everyone to be able to see each other! No hidden worlds lol.

    I believe Unity has this built in to UNET already. Don't quote me on it.

    I wanted to kind of get away from the whole server-server-client, client-server-client, client-masterserver-server-client ideas and just go with basic client-client (which should be ultimately avoided because, like you said... cheaters), and client-server or server-client. What you're telling me to do, if I understand correctly, is pretty much a server-server-client connection. Server 1 talks to Server 2 to update client nearby positions. Unless you can think of a way to do this that isn't repetitive, I think this would just bring up the very issue I just solved last night. The issue where there are needless extra connections when there could just be 1 direct connection. Also, think about latency. This is also another thing I addressed last night. You'd increase latency every time to try to send data between server. Rather than just communicating with one individual server. It sucks, I know. :(
     
  27. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    The way I see it, MMORPGs are possible with UNET. As a matter of fact, I made an Asset Store MMO project with it: http://forum.unity3d.com/threads/ummorpg-official-thread.376636/

    Right now my solution is to have everything in one server with one scene, everything else would be very hacky. Later on when UNET Phase 2 and 3 are released, we might be able to host parts of the game world on different servers easily.

    Note: it seems like you are trying to overcomplicate your MMO architecture. Of course it's cool to have master servers and slave servers and external database servers and login servers and all these things, especially if you want to reach tens of thousands of concurrent players. But this stuff is for big companies with millions of dollars and engineering teams. For indie MMORPGs, UNET will do just fine. The obvious downsides like being single threaded turn out to be good things for indie developers. We don't have to worry about many things like deadlocks, race conditions, database synchronization between server instances etc.

    Those complicated architectures would easily take 50.000, 100.000 or more lines of code - I really wouldn't want to maintain that mess. I would pick a MMORPG with 1000 concurrent players and 5000 lines of code over a MMORPG with 10.000 concurrent players and 100.000 lines of code any day.

    My uMMORPG project has a lot of MMORPG core features implemented already - with only 3500 lines of code.

    Also note that any client sided logic will be exploited/hacked sooner or later. Authoritative servers are the only way if you don't want the game's economy to be ruined by item duplication etc. Even physics shouldn't be left to the client, otherwise people will find out how to walk through walls and reach boss monsters or secret rooms easily. I can go more into detail about my solutions to those problems if you want.
     
    Last edited: Mar 6, 2016
    immanuelsteiner likes this.
  29. Makosai

    Makosai

    Joined:
    Mar 4, 2014
    Posts:
    46
    I don't plan to have external databases or login servers. I plan to have the database with the master server and to use Steam Authentication. My goal is to be as efficient as possible. In terms of both money and computations. If anything, I'm trying to simplify what I've got. :p

    Also, I don't see this being any larger than 2000 lines of code. If anything, It'd barely break 1000. Mind you, this is just the servers / client network I'm worried about.

    Edit: Also, I'd like to move this discussion to the new topic so I can make some progress on my new questions and the development of the Transport Layer API code I am working on.
     
  30. Patrick-GameSparks

    Patrick-GameSparks

    Joined:
    Feb 2, 2016
    Posts:
    23
    Hi QuaintShanty,
    I'm part of the customer success team at www.gamesparks.com . We are a Backend-as-a-Service provider, equipping developers with all the tools needed to build, tune and manage the server-side components of their projects. We currently have over 72 million players on average each month, and large enterprises, game studios and publishing companies such as Starbucks, Bandai Namco, Square Enix, Ubisoft and many more are utilizing our versatile and powerful platform.

    I see you've asked a lot of the difficult questions, that one must consider when building a back-end:
    How to segment operations and reduce server stress.
    How to choose the right hardware to meet your needs.
    Managing user numbers and world instances in the happy circumstance of your game becoming a big success.

    The GameSparks platform was designed with all of these questions in mind, built in a highly scalable and robust manner so to easily deal with all of these requests and many more.

    Here is a rundown of our platforms features:

    Core:
    · Cloud Code Editor: (Add Logic, build your own API)
    · Cloud Data: (Define MetaData/Runtime Data Structures)
    · Binary Asset Manager: (Manage DLC, No more waiting for platform holders to approve your content)
    · Push Notifications: Setup all notifications from one centralized backend, localize global campaigns )

    Social:

    · Real time and Turn based multiplayer: (Reduced latency, highly scalable)
    · Chat: (Cross-platform chat, p2p and group)
    · Leaderboards: (Rank any aspect of player performance, highly scalable)
    · Social Network Integration: (Pull Data from Facebook, Twitter, Google+ and others)

    Economies:

    · Currencies: (Up to 6 currencies. Manage rewards to increase retention)
    · Virtual Goods: (Create and manage in-game store without need for client updates)
    · Rewards and Achievements: (Easily manage both, a great way to drive engagement)
    · Optimisation & Management:
    · Analytics: (Completely customizable, build reports for almost any conceivable event)
    · Segmentation: (Group players with Segments for analysis. Optimise monetisation by age, location, anything you want)
    · Experiments: (Make drastic changes to game mechanics and only expose who you wish to those changes.)
    · Player Management: (View player history and summaries of activity. Edit player records, reward top players or remove unwanted players)
    · Dynamic Form Builder: (Custom forms for Community Managers and Game Operators to get the most out of GameSparks)

    You can register for a free evaluation account here: https://portal.gamesparks.net/register.htm
    Should you have any questions, one of our dedicated support team is always on hand and can arrange a skype call to delve a little further into each feature we have to offer and how this can impact your project.
    Hope to hear from you soon,
    -Patrick.