Search Unity

ECS and Networking?

Discussion in 'Entity Component System' started by omegabytestudio, Aug 15, 2018.

  1. omegabytestudio

    omegabytestudio

    Joined:
    Nov 9, 2015
    Posts:
    77
    Hi there!

    I'm playing a bit with Pure and Hybrid ECS.

    Pure ECS seems pretty good for backsend server, where you don't need physics/animation.

    I got stuck tho : Networking.

    I wanted to use DarkRift 2 Networking, but I have no idea how to implement it in pure ECS.

    DarkRift use gameobject to manage the networking, and I have pure entities, so :(

    Is there any example/tutorial for networking with ECS? I know I ask a lot as ECS is pretty new, but never now.

    If anyone has any tips, you are welcome!!
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Unity native ECS has no networking atm. But you perhaps already noticed similar topic
    ECS and Networking
    https://forum.unity.com/threads/ecs-and-networking.528134/

    As you may also notice, the title is almost identical. Which will lead to confusion. For tidiness keeping, would you mind, to amend it, so it is distinctive from other topic? Thx

    Nothing stops you from mixing Pure and Hybrid ECS. You can make an Hybrid ECS interface, to communicate with OOP world and its server, if you wish. And then in future, just change to ECS server, if existing. Shouldn't be too hard, as you should have required handles back then.
     
    Spy-Shifty likes this.
  3. omegabytestudio

    omegabytestudio

    Joined:
    Nov 9, 2015
    Posts:
    77
    Thanks for the thread!

    I acually searched for it, don't know why I didn't find it.

    Edit : I don't think I can change my title?
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    No probs.
    Search tool is your friend.

    The mentioned similar topic, is just few thread down below yours. Hard to miss it. But proved it can be. ;)

    You can edit title, when you click on top-right of your thread Thread Tools. Just below Search this thread. Then you have edit title.
     
  5. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Hi I'm the developer of the BBSNetworkSystem
    @Antypodish already introduced my thread. I just want to introduce my system a little bit more.

    Well the system was written based on the usage of photon network engine. But you can use any network backend. Just implement the INetworkManager interface.
    Synchronization is quite easy. Add a NetworkSync component to your entity. Assign the NetSync attributes to your components and the NetSyncMember to the member which you want to synchronize through the network.
    Define your network entity factory methods to instantiate entites on the remote client.

    Adding and deleting entities as well as adding, changing and removing components will be automatically synchronized with all clients.

    Synchronize entity references accross the network. Handle different authority systems, based on Client, Master and Scene types.

    The system take care of message size and number of packages send through the network. It only send that information which are importent. It uses delta compression and package compression (protobuf) to minimize package sizes. It's optimized for reflection. It uses cashed delegates to improve performance of reflection.

    Please feel free to ask me, if you have some questions or some improvements.
    I'm happy about any feedback!

    Get it from github
     
    osamansr2o1oo likes this.