Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Connected Games: general feedback and questions

Discussion in 'Connected Games' started by BHouse, Sep 13, 2018.

  1. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    263
    Yes, encryption is not included yet but this is planned for the new network transport (it will definitely be included but there is no ETA yet for it).
     
    IrosSoftware likes this.
  2. IrosSoftware

    IrosSoftware

    Joined:
    Oct 1, 2016
    Posts:
    2
    Thank you for answers.

    I expect encryption and hash value check for tampering detection.

    Please continue to do your best!
     
  3. Karrzun

    Karrzun

    Joined:
    Oct 26, 2017
    Posts:
    44
    I got a quick question about sending data via commands. I need a transform to be updated so I'm wondering whether it's better to send the Transform as a whole or just its seperate fields. Does it make a difference at all?

    Code Snippet:

    [Command]
    void CmdSyncTransform (Transform transform)
    {
    ....
    }


    versus

    [Command]
    void CmdSyncTransform (Vector3 pos, Quaternion rot, Vector3 scale)
    {
    ...
    }



    //Edit:
    I wanted to do some tests and it seems, one can't pass Transform as a parameter because it's a component. Sorry for the dumb question
     
  4. jackt_unity

    jackt_unity

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    32
    Hi Karzun,

    Are you still having issues, or have you worked them out?
     
  5. Karrzun

    Karrzun

    Joined:
    Oct 26, 2017
    Posts:
    44
    It's not a real issue, but rather curiosity regarding performance and efficiency. My script is working fine and porobably I won't have any performance issues either because it's going to be just a simple little LAN game for my friends and me.
    Still, I'd be more than happy to know whether and how this difference would impact performance. Would it be better to give three paramters or would it be better to write a custom struct to hold those values send the struct instead?
    Sending the struct as a whole would require some additionals bytes, I assume, and thus claim a bit more bandwidth. Of course that's not a big deal for a handful of objects but it keeps adding up so surely it would make a difference for hundreds and thousands of objects. That's why I'd tend to send those values seperatly. But maybe I miss something else/more important here?


    Edit: wording
     
  6. Magnusai

    Magnusai

    Unity Technologies

    Joined:
    Nov 22, 2018
    Posts:
    1
    Personally I prefer structs for sending data, just more neat but I imagine on such a small scale either way would be fine.
    Also depends how many values you need to send. If you end up having to send more and more values you code might look messy sending them individually instead of just defining a single struct and using it over and over.
     
  7. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    2,877
    There is no bandwidth difference. UNET weaver would serialize all values of the struct into NetworkWriter. Same as when you pass the parameters one by one.
     
  8. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    429
    If you care about efficiency, here's a tool for you. With BitBuffer you can serialize/deserialize your data efficiently and without GC, thanks to ZigZag and variable-length encoding based on integers family. Here's how you can create abstractions with your custom structures without codegen and reflection using managed arrays or Span<T>.
     
  9. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    12
    So does this mean I shouldn't be messing about with the github download, but should be on the latest 2019?

    Bit worried how you don't know if it's in or not...
     
  10. jackt_unity

    jackt_unity

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    32
    Hi there,

    At the moment it is only available through GitHub (found here) as it is not yet confirmed stable so has not been added to the main Unity install. This library has not been updated since October, though there is an update which should be coming soon.
     
    Kirsche likes this.
  11. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    323
    Hi, I'm wondering would it keeps support MonoBehavior in the future since more and more stuff is implementing in ECS?
     
  12. BHouse

    BHouse

    Unity Technologies

    Joined:
    Jan 10, 2018
    Posts:
    60
    Everything we are implementing alongside ECS today is intended to be compatible with both ECS and MonoBehavior systems.