Search Unity

Send Arrays from one pc to another pc connected with a network cable.

Discussion in 'Multiplayer' started by kingbaggot, Jan 14, 2019.

  1. kingbaggot

    kingbaggot

    Joined:
    Jun 6, 2013
    Posts:
    51
    Apologies in advance from this ultra-noobist query - I've never dealt with Networked unity before.

    I have three PCs each with a simple unity-build art package where you make a collage. Each of these sends to a 4th PC running a unity-build which acts as a gallery - which displays the results split onto 6 screens.

    What is the most efficient way of sending this info to the 4th pc - which I assume will be receiving the data as an array (of collage piece x,y & rotation ints) rather than bitmap data (which is probably too large) ?

    Should I start by reading the Network manager documentation ? Or is there another way I should be going about this ?

    -cheers,
     
  2. Chexxor

    Chexxor

    Joined:
    Sep 26, 2017
    Posts:
    4
    First of all, the documentation found on the official documentation pages belong to the obsolete networking APIs and will be replaced by the new Multiplayer system which they're currently developing, but as I've started building my own stuff wit ht

    I'm not super experienced on this area, but for starters I would set up a basic Server-client setup based on the new Unity Transport package. If you want it to be "most efficient" there are probably a ton of things to do, one is to try make it "jobified" which is the more advanced example in my link.

    Anyway, once you got the basic setup I would find a way to send images with UDP. Normally file transfer is done over TCP I believe, which is a reliable protocol, but the transport package only offer UDP as far as I know, so figuring out how to send images over UDP can be googled I guess, but in essence it would include:
    • Serializing image data into a byte array
    • Sequencing data
    • Handling reliability of all kinds:
      • Integrity
      • Sequential ordering
      • Resending packages (in case of loss)
    I suspect the Transport package may include some reliability on top of UDP, although I'm not sure since they are currently using it for their FPS project which has both elements that require and don't require reliability. I would suggest analyzing some of the FPS projects code, but that may be scary and according to some is a huge overkill for people wanting to start small.

    Edit: Once anyone with better knowledge and experience than me replies, I'd go with their suggestions instead of mine.
     
    kingbaggot likes this.
  3. kingbaggot

    kingbaggot

    Joined:
    Jun 6, 2013
    Posts:
    51
    thanks for the reply -

    If I limit my project to unity 2017.3.03 can I still use the obsolete Network Manager functionality ? It seems more 'plug and play' than the newer stuff they're developing.