Search Unity

MMO Single Server Plausibility

Discussion in 'Multiplayer' started by Julian-S, Jun 12, 2013.

  1. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    Hey guys,

    How plausible is it to create an open world MMO in unity, using Photon's Server, that can have hundreds of players connected on a single server at once? Basically set up similar to Eve: Online.

    I really like how that model works where every player action means something, and the world and story is therefore very player-driven.

    The graphics are voxel based (like minecraft) to minimize performance hits.

    Also, if this isn't possible with Photon, if you have any other suggestions of ways to pull this off, I'd love to hear them!

    Thanks,
    Julian
     
  2. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    its not plausibible, it is possible, many MMOs had been made with Unity3D and Photon

    LINK
     
  3. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    But are there any with quite that scope? I'm talking hundreds, maybe thousands of clients all connected and exchanging data with a single authoritative server.
     
  4. scalify

    scalify

    Joined:
    May 20, 2010
    Posts:
    18
    Hi Julian,

    Have you had a look at Badumna http://www.scalify.com ? It was designed with single unsharded worlds in mind. It uses a hybrid of a P2P architecture and client-server. Most traffic is carried P2P so you have almost unlimited scalability - the network is the server. Client-server is used where authentication and arbitration is required. You can try it out for free.

    http://www.scalify.com/documentation/Manual/introduction.php#how-badumna-works

    We also have a free Cloud product, although probably not suitable for what you have in mind (http://cloud.badumna.com

    Cheers
    The Scalify Team
     
  5. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    This is very very interesting and may be exactly what I'm looking for!

    Thank you very much :)
     
  6. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    How does scalify work in terms of preventing client cheating?
     
  7. Uncasid

    Uncasid

    Joined:
    Oct 5, 2012
    Posts:
    193
    That is the thing.. P2P is REALLY hard to prevent cheating.. You need a server that says "Yo, this data is not matching what I have.. something is wrong". This is one of the reasons for an authoritative server. If you are planning on doing something on the scale of eve: Eve has a lot of servers, and doesn't do voxel world sims.. think about that for a second.

    P2P means you will need to trust that what the user sends is good data. You can do checks to see if it is within a range of "ok" parameters.

    Ok, tough question time.. How much do you know about networking? How do you plan on running your simulation? Does the user only control one object?
     
    Last edited: Jun 12, 2013
  8. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    Right, well that's good to know, thanks.

    As I slowly build up the core of this game, I'm slowly building up my networking knowledge. I'm dreaming big but I'm going to be starting pretty small. Yes, the user controls only one object, kind of like in Eve the user controls only one ship. Given this new information on networking, this is what I'm thinking. The main thing that I want is my world being a single sharded game world. The game-world is split up into multiple regions. One option would be to have a scalify server running all the regions. Another option would be having multiple authoritative photon servers, each running their own region of the world, and when a player moves into a different region, they switch servers. I guess in that case I would have to have all the photon servers sharing information with eachother as well.
     
  9. Uncasid

    Uncasid

    Joined:
    Oct 5, 2012
    Posts:
    193
    I am always a fan of dreaming big.

    Want a big suggestion.. start building multiplayer.. don't built it single player first, you will end up re-writing it all anyways.

    How big is your world? Scalify doesn't really work with large large worlds, see this post here http://www.scalify.com/forum/showthread.php?12-Dynamic-Scenes&p=371&viewfull=1#post371

    You might be able to trick the system into working.. To do something like this, you would move the world around the user. This means the user sits at origin at all times. You can load bits of your voxel data into a visible buffer, then load it into the scene where it should be. You would also drop data you aren't using. This will make it seem like the user is moving.

    Now, I am not sure if this will work with scalify, as their system is based on object positions. This you might be able to trick this as well.. by saying that when the user is in view, they are "here" (ir, translated to world) in the world, not at 0,0,0
     
  10. Uncasid

    Uncasid

    Joined:
    Oct 5, 2012
    Posts:
    193
    Another thought.. If they have abstracted their NetworkView object (this is what unity uses), you might be able to use double precision for locations, then translate it on the local. Note that this would double the traffic.
     
  11. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    Yes, I will certainly start building it ground up with multiplayer. Right now I have some multiplayer functionality implemented with photon cloud, but there is no way cloud is going to work in the long run.

    In that case I think my world will end up being too large for Scalify. I'm guessing that moving the world around the player is a workaround for having a maximum world size? That is a smart idea. Since I'll likely do multiple authoritative photon servers, I'd imagine that moving the player around the world is less expensive than moving the world around the player though.

    Admittedly, I'm not sure I completely understand your suggestion about double precision as I'm not too well versed in networking yet. It sounds like it could be another workaround for Scalify's size restriction.

    What I want to be sure of is that I'm using the best server system to run this sort of game and maintain a good level of performance before I dive into anything. It seems like Scalify might not be able to do it, so do you think that the multiple photon server idea is the best way to go about it?

    Thanks for all your help so far Uncasid.
     
  12. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    As i am working on a multiplayer voxel game at the moment, let me share something you need to consider with an authoritative setup in a voxel game.

    Memory!

    Voxel worlds often take up quite a bit of memory. If people shouldn't be able to alter the world client side the server needs infomation of it, this can be a bare minimum, but can still be heavy. Now on the client side you can just load/unload regions as people move around. However the server needs to have infomation of all the regions which could possible be insane amounts of memory.

    Now when you mention voxels, is it only the style or do you actually have a sort of voxel engine where every piece of the world is a voxel that store some sort of information.

    Furthermore, do you use Unity physics in your game, or any kind of physics? Then you need to write your "own" for a Photon Server which can take some time to get right! (We did it where i work).
     
  13. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    The world actually isn't alterable at all, the voxels is just basically a style. Everything is made up of cubes, but for the most part they are simply meshes, so I hope that saves me some memory.

    As for terrain, I may just use unity terrain, and then just objects and structures and such are made of voxels. Do you know if Unity terrain would be more expensive than a single layer of voxel terrain (since you can't dig or alter the world)?

    And yes I use the Unity physics engine. Do I really have to write my own physics to use photon server then? That would be an unfortunate challenge!
     
  14. Uncasid

    Uncasid

    Joined:
    Oct 5, 2012
    Posts:
    193
    That is a tough one to answer.. I don't quite understand the scope of your project or what you plan on doing. Can you tell me a little more? Feel free to do it in private message if you don't want to talk about it here.

    You want to have a really solid concept for what you want to do in the game. I suggest writing it all up and sticking to it. It is a nightmare to switch networking systems mid swing. Your goal should be to do it correctly the first time.

    As for the floating point / double. Floating point has half the size of a double. With doubles, you can map all of planet earth to right about the meter. With float, maybe down the block. So if the goal is to have this really massive world, say like minecraft.. you will have to do some magical work. This will play a huge role in how you develop the networking back end.
     
  15. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    Yes
     
  16. peshwa_prince

    peshwa_prince

    Joined:
    Apr 14, 2010
    Posts:
    67
    Hi Julian, Just to clarify, Scalify does use floats for synchronising positional information by default. If your are planning on positional accuracy to the nearest centimetre, the largest position you can represent with a .NET float is 99,999.99 which is about 100km. So this would give you a game world of size 200km by 200km which is 40,000 square kms. If you drop the precision to 1 metre, your game world would be 100 times bigger (and so on).
    You also have the option of defining a custom position property on the entities (which use double). Scalify network will automatically synchronise this and then you can have the precision and size that you wish. Geoff's last post on this thread explains the problem very clearly.
    The key benefit of Scalify is that you don't have to worry about managing all the servers and the communication between them as it is managed transparently in the network.
     
  17. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    Alright, well that is definitely good to know, so I won't write off Scalify just yet. Will I be able to use the unity physics engine with Scalify? That would save me a lot of time I think. Also, is there a way around clients being able to cheat easily?
     
  18. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    Can I just resolve physics on the client end somehow and still use unity's physics?
     
  19. peshwa_prince

    peshwa_prince

    Joined:
    Apr 14, 2010
    Posts:
    67
    You can certainly compute the physics for objects locally while using Unity's physics. In terms of your question about clients being able to cheat easily - you need to figure out what is critical and non-critical wrt your game. Scalify allows you to send critical updates using central arbitration servers (such as result of a puch, or a combat operation, etc). All non-critical updates such as chat, running around in the world can be sent directly.
    There is also a distributed validation module that provides further cheat prevention for all game updates. When enabled, this module will select validators for each client in the network and use them to compute the update for that client. This will provide the same security as client-server while using a decentralised model so that your game is highly scalable. You can read more about this in the developer documentation.
     
  20. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    Well that sounds very promising. I'm going to have to read up on this bigtime. Thanks so much for your replies!
     
  21. Uncasid

    Uncasid

    Joined:
    Oct 5, 2012
    Posts:
    193
    interesting design, i will have to check this out then! off topic question, but here goes:

    what is scalify's update cycle like? if i purchase the $200 indie, does that allow for lifetime updates? what is the difference from pro and indie?
     
    Last edited: Jun 13, 2013
  22. scalify

    scalify

    Joined:
    May 20, 2010
    Posts:
    18
    Hi Uncasid,

    Yes, you would get updates and maintenance releases of the same version. The features of Pro and Indie are the same but purchase of Indie is restricted to developers with less than five employees/contractors and under $200K revenue. Of course, you can try it out for free.

    There is also our Cloud version http://cloud.badumna.com which is free up to 100 CCU (about 20,000 MAU), regardless of company size. It does not have as many features (and not suitable for the application discussed here), but since everything is set-up and ready to go it is a quick way to try it out. There are also multiplayer demos in the Unity Asset Store : https://www.assetstore.unity3d.com/#/content/8564

    Cheers
    The Scalify Team
     
  23. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    You can, but then movement needs to be handled client side which means that people can cheat in this manner.
    So you need to find out what is crucial for your game.

    For example for our game we cannot live with it, so we need to be aware for the physics server side. For this reason we are looking into uLink at the moment. But an Indie version is around 550€ for that. So you need to be serious about your game if your going in that direction.
     
  24. Julian-S

    Julian-S

    Joined:
    May 31, 2013
    Posts:
    73
    Gotcha. I wonder how difficult it would be to just have it function client side for now, and to program in server side physics later on and transfer it over.
     
  25. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    I have been hovering around this area for months..

    What I now know!!

    I was looking at uLink and got stuck in and created an auth setup, wow I’m going fine, uLink is awesome.. But hang on!!

    Then realized the server needs to run the game :S.. It is possible to do it and keep costs down, however for a first project it still seems a little heavy on costs. ($100 per server a month + uLink at 550 eur) for the game I wanted to create and host. Alternative anyone!!

    Non auth (cheat happy), photon cloud seems the way to go on this, no server worries is a joy for development.

    Now at first I thought, photon could will be super rubbish but after spending the last month with it, I now think it’s really good and productive to work with.

    Best advice, add up the costs and have a think about it.

    My personal solution is to reduce the need for the players to cheat or even just let them lol..

    One thing I would defiantly keep clear of if using photon cloud, is real money as game currency.. One bad classic example, and I need not even say the name ;) Z
     
    Last edited: Sep 12, 2013
  26. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    I do all physics simulations on the server and interpolate the position updates on the client, so yes


    If you're smart at keeping your packet size small theres no real downsides to going the authoritative route, just think of the client as a window to the server. Ask it to do everything. "Can I pick up this weapon" -> server checks if the item exists at that position -> "You have picked up the weapon" (validation to prevent cheating)


    You can move some un-important stuff to p2p to take some of the load off the server, though.


    I know RuneScape at times can send 50kb/s, with MMORPG's you can use quite a bit more bandwidth than an FPS
     
    Last edited: Sep 12, 2013
  27. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    hay "Alabatross", do you have an idea on cost for such a setup?

    for example, how much would it cost to deploy something like "Counter Strike" as an auth setup, with lets say 1000 active players?

    this is the area that always catches me out, would be good to get more info on the subject as my estimates may just be well off ;)

    Would something like this cover it (just a random link)?

    http://www.fasthosts.co.uk/dedicated-servers/windows-servers/ds500-windows/

    Also that's Zone based (rooms), not all in one room.
     
    Last edited: Sep 12, 2013
  28. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    To be dead honest, I'm not sure.

    The best thing to do would be to continue to buy better VPS's as your player base increases, rather than dishing out the money to support 1000 players when you may only have 200. Just do it during the beta phase/stress tests
     
  29. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Its me again, and I got some interesting info for you all ;)

    I did a very simple test to get an idea on scale and costs e.t.c of running an auth setup.

    I got the “uLink” auth example running on an EC2 micro instance (auth example here):
    http://developer.muchdifferent.com/unitypark/Tutorials/uLinkAuthoritativeServer

    I then run the server and took a peek at it with the windows task manager (on the EC2 instance).

    At idle, it is running with around 08% CPU and 15mb memory usage

    With 6 connected clients its running at 11% CPU and 16.5 MB (keep in mind here that I can only move one player at a time)

    What I find very odd, is that after disconnecting all the clients the CPU and MEM is still at 11% and 16.5MB. Now this could just be that the example is not made correctly, but is a little concerning!! Maybe the server has to release the client, as it may still be there in some kind of buffer.

    So it looks like low CPU and high MEM for an auth server instance.

    Happy days,
    super_me!!
     
    Last edited: Sep 17, 2013
  30. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,124
    You can do the general thing as others said. I want to recommend you to start with UnityPark suite and uLink if you need to use unity's physics on the server authoritatively. www.muchdifferent.com or use the built in networking at start and then convert to uLink if it started to work.

    The trial version is free for development but you can not release your game with so you don't have to pay for trying uLink.

    Photon can be used as well but it has less feautres built in. From the other hand it doesn't run unity on the server which might be desirable for you.