Search Unity

netEngineX - MMO Server Architecture using C# and Unity

Discussion in 'Multiplayer' started by lzaiats, May 21, 2018.

  1. lzaiats

    lzaiats

    Joined:
    Nov 8, 2013
    Posts:
    5
    Hi all! I've been working on a new tool (lib) to help me and my team on our current project and I just wanted to share it with you!



    All feedback is appreciated!

    ---

    Welcome to netEngineX (temporary name) showcase! A distributed MMO server architecture using C# and Unity (other game engines soon)!

    Basically, netEngineX consists of three parts:
    1) State Server (entities and infrastructure management)
    2) Workers (unity instances for world simulation)
    3) Clients (unity instances for players)

    This is a simple demo to show the current state of this technology:
    1) We start a spectator client @ 10 statesyncs per second (no player controlled character for this demo)
    2) We spawn 50 dumb AIs with one CharacterController each;
    3) We spawn 1 Worker and assign the 50 AIs to its simulation;
    4) We spawn more 550 dumb AIs and assign to this Worker simulation;
    5) As you can see, the Worker FPS is low due to 600 CharacterControllers...
    6) We spawn 2 more Workers and divide the simulation over the 3 Workers;
    7) Now the load is distributed over the 3 Workers \o/
    8) Now we show some more cool features like: Auto Worker Assignment when Worker dies, Stopped game simulation without Workers and other stuff... =)

    * One client is connected as spectator so you can see that all the entities redistribution works seamlessly...

    ** netEngineX have built-in Network LOD using groups to save bandwidth...

    *** This is not a real game, but if you can imagine all the possibilities =) All Workers are running locally, but yes, they can be run across the network... We are using CharacterController (heavy) to simulate AIs so we have a more close simulation of (600) player controlled characters...

    Suggestions and questions, feel free to email me!

    Thanks for watching!
     
    Joe-Censored likes this.
  2. Deleted User

    Deleted User

    Guest

    Insane bandwidth consumption, even though you are using LOD groups it is too high. I got my 500 entities at 20 snapshots per second with the rotation at 20-30 KB/s instead of yours 160KB/S which is only positioning.

     
    Last edited by a moderator: May 22, 2018
    lzaiats likes this.
  3. lzaiats

    lzaiats

    Joined:
    Nov 8, 2013
    Posts:
    5
    Hi @wobes !

    Actually, my example does not uses the network LOD, the engine implements it, but for the sake of simplicity I am not segmenting the entities on network groups, the client is receiving every entity message... 600 entities sending 10 syncs per second: 1 Vector3, 1 Quaternion and 1 Color on state-sync messages (not compressed, no deltas), definitely not optimized at all...

    The purpose of this demo was to show the scalability / reliability, distributing the world simulation across multiple Unity instances seamlessly =)

    I am going to optimize my state-sync packets and run the demo again, maybe I can get a better bandwidth consumption...

    Thank you for your feedback!
     
    Deleted User likes this.
  4. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    Your demo already seems not bad.
    What kinds of assignments do you support besides auto assignment?
    And does every simulation server open their own connection to the client?
     
    lzaiats likes this.
  5. lzaiats

    lzaiats

    Joined:
    Nov 8, 2013
    Posts:
    5
    @Pidon Thank you! It's still a WIP, but I think we are on the right way =)

    About the entity -> worker assignments, currently we have:
    • the single entity assignment to a single worker (move entityId workerId);
    • all entities assignment to a single worker (moveAll workerId) and;
    • (autoAssign) all entities divided across all connected workers...
    There's a lot of room for other entities distribution algorithms...

    All the workers send their load info to the state server and this info can be easily used to decide if it's time to spawn more workers or re-distribute the entities (based on their type, maybe).

    netEngineX let you can create your game to support direct connection to other workers (more workers, more IP addresses, more port bindings, maybe this approach will not scale), but I am not using this strategy on this demo... The idea here is to use the state server as packet router between the player and the worker transparently, with all the handover process occurring inside the local network (between workers and state server only, the clients are always connected to the state server)...

    You can write your own state server using a more distributed approach, such as using Akka or Orleans, that would scale perfectly too =) (maybe we will go to this way anytime soon)

    LZ
     
  6. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    103
    The concept of the worker is really what I am interested
     
  7. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    103
    The concept of workers is really interesting
     
  8. lzaiats

    lzaiats

    Joined:
    Nov 8, 2013
    Posts:
    5
    @lorddanger Yes, the magic here is to have workers so the game simulation can be distributed! Actually the project is more evolved than this demo with a lot of optimizations and new features!

    I am planning to show a real game using it soon =)
     
  9. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    103
    It will be paid service or open source etc. As I would like to try It
     
  10. lzaiats

    lzaiats

    Joined:
    Nov 8, 2013
    Posts:
    5
    @lorddanger We are planning to release it open source when we can get it working for at least one real game ;)
     
    marcsh likes this.
  11. Pandalawl

    Pandalawl

    Joined:
    Jan 27, 2017
    Posts:
    8
    Any Updates or News on this ?
     
    marcsh likes this.
  12. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    103
    I am also interested in know more about it
     
  13. Kirkja

    Kirkja

    Joined:
    Oct 18, 2009
    Posts:
    7
    I'd like more info as well.
     
  14. ParityJames

    ParityJames

    Joined:
    Mar 29, 2012
    Posts:
    4
    Well thats ashame, it seems like this dev fell off the face of the earth