Search Unity

MMOG with Unity(500 users+)

Discussion in 'Multiplayer' started by BearishSun, Dec 1, 2008.

  1. BearishSun

    BearishSun

    Joined:
    Dec 1, 2008
    Posts:
    175
    Hello,

    me and few of my friends have recently started working on a MMORPG game, and we're considering to use Unity for it.

    Our MMO would need to have at least 500 people per server. My question is, is Unity capable of handling that? With the few tests I've done I ended up with 7mbit/s bandwidth only for 500 people, only walking, and server only communicating with one person. (Client sends movement data to server, server confirms player position).

    Considering that there will be many more things other than movement, and that server doesn't send your position just to you, but to everyone around you(and from everyone around you to yourself) bandwidth used would be huge.

    So my plan would be to have RakNet running as the server, but the problem is I still don't know how to control which data unity sends to RakNet. For example, for movement, I'd just like to transfer current player Y axis rotation, and direction(forward, backward, left or right).

    So,
    Question #1: Could I do this with RPC, and what would be the overhead?
    Question #2: Is there a better way to do what i'm trying?
    Question #3: Are .NET sockets fast enough and can I use them to connect to RakNet?
    Question #4: Is it even possible to do what I'm trying with unity(MMORPG with at least 500 people playing simultaneously)?

    I'd appreciate any other info that would help me. If this doesn't work out I'm planning to use Torque engine(although i'd really love if I could do it with Unity).
     
  2. aaronsullivan

    aaronsullivan

    Joined:
    Nov 10, 2005
    Posts:
    986
  3. BearishSun

    BearishSun

    Joined:
    Dec 1, 2008
    Posts:
    175
    SmartFox, as suggested by that thread is not really an option for me. First, it's expensive, and second, most of its features are useless for me.

    For now it seems my best bet is to use sockets and make the server from scratch...
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Or use a headless unity client for it.

    The most complex thing seriously will be the network implementation. Even thought it might sound simple, expect to have 2-4 months fulltime to get a performant and traffic saving technology with security protocoll layer that supports 500-1500.

    And at that time, other technologies might likely become an option, especially if you have no experience with the related networking, state handling, syncronization range implementation practices, how to wire it with visual technologies like PVS etc to get best performance and a plentitude of other things.

    MMO networking also will be about the only thing you won't find much on the net or in books. Its art, there is no way how to do it right or anything a like.
    Thats easiest to see if you compare WoW to EQ. Both are somehow known but if you stand in a building in stormwind and check the radar, you will see what noob level EQ / EQ2 / Vanguard actually are when it comes to the MMO related technology aspect ...

    And EQ level already will take you months to reach if you start at 0

    So do yourself the favor: whatever you do, sockets are definitely the wrong way.
    If you don't want to invest in a fully fledged technology that offers the server backend etc, then at least either use a unity client with its raknet 3.0 networking or wrap RakNet 3.3
    It will save you the first 6-9 weeks easily and even later it will save you time. At the price of one to two weeks to wrap the needed stuff into .NET.

    The time frames assume that you have basic knowledge with networking, encryption, how sockets work on the different platforms you intend to use (including the related assumption on sending window widths etc because they differ drastically between Windows and *nix) and other basic topics on that end.
     
  5. aaronsullivan

    aaronsullivan

    Joined:
    Nov 10, 2005
    Posts:
    986
    Of course, my point wasn't to check out that one thread, only. :) I'm sure you realize that, though.

    There's a lot of info out there and people are working on it with Unity, so seek it out on the forums and ask specific questions when you run into problems. That's all I've got. Good luck.
     
  6. BearishSun

    BearishSun

    Joined:
    Dec 1, 2008
    Posts:
    175
    Thanks for your replies. I did indeed read most of the stuff on this forum related to my post before I started this thread.

    I started working with sockets and I do realize it will take me months to have a full fledged system(I have no experience in MP networking, but I do consider myself a pretty good programmer).

    Now, in response to dreamora's (very useful) post, I have few more questions:
    1. How would I go about wrapping RakNet functions and importing them for use in Unity? (i.e. I want a RakNet server, but I don't want to use Unity's Network.Connect(), but instead use RakNet native stuff). Is this even possible in Unity Indie? (I know about importing C# plugins into Unity)
    2. How do I implement server-side RakNet? I mean, I still need Unity running on the server with my game(NPC AI, maybe physics, player movement, etc.) right?

    And in your fifth paragraph you say I should use unity's implementation of raknet, so are you saying Unity implementation(with proper use) could indeed handle 500 users? (Without like a massive 1gbit connection)
     
  7. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Depends on your coding skills.
    Unity default is 1 server many clients, with a default listen for 1000 connections max.

    If you code it right, you can easily have 500 people going at the same time with Unity and not miss a beat. The problem is not Unity with Raknet, the problem is byte management. This will totally depend on your ability to program your game 'smart' and not 'fat'.
     
  8. BearishSun

    BearishSun

    Joined:
    Dec 1, 2008
    Posts:
    175
    Yeah but that's the problem, I don't see how I have the choice whether will it be "smart" or "fat" with unity, I just assign network view to player and it updates the position. I can't change that; or can I?
     
  9. ProtonOne

    ProtonOne

    Joined:
    Mar 8, 2008
    Posts:
    406
    You can choose to let the network view update the position auto-magically if you want. But if you want more control, you can script exactly what is sent.

    So you could just send the XY for a 2d game for example.

    The network example shows how to do this with manual interpolation and extrapolation of the objects position rotation.
     
  10. BearishSun

    BearishSun

    Joined:
    Dec 1, 2008
    Posts:
    175
    Ah I did not know that! I'll see if I can work something out that way. Thanks!
     
  11. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Have you looked into sendrate? That's another thing you can control (at least "per project", AFAIK not from script). Not sure what the default value is, but you might be fine with a much lower value (it only controls automatic NetworkView-synchronization, not RPCs).

    Also, NetworkViews have a nice method called SetScope(NetworkPlayer player, bool relevancy) since 2.1. You can also control scope (i.e. which players receive which messages) per group via: Network.SetSendingEnabled (NetworkPlayer player, int group, bool enabled).

    Be careful not to confuse this with: SetReceivingEnabled (NetworkPlayer player, int group, bool enabled), though. Could be the implementation has changed with 2.1 (which is unlikely) - but in 2.0, this only made the messages "not get through to your code" - but it would not stop the messages being sent, so it would not give you any benefit concerning bandwidth used (it would just discard the messages after they are received and give you exceptions if the NetworkView doesn't locally exist which would frequently be the case in an MMO because not every client has every object).