Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    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:
    268
    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:
    47
    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. JTovey

    JTovey

    Unity Technologies

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

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

    Karrzun

    Joined:
    Oct 26, 2017
    Posts:
    47
    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:
    3,297
    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:
    546
    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>.
     
    hippocoder likes this.
  9. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    16
    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. JTovey

    JTovey

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    34
    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:
    389
    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:
    66
    Everything we are implementing alongside ECS today is intended to be compatible with both ECS and MonoBehavior systems.
     
    zhuchun likes this.
  13. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    286
    So what does it mean that the new Unity Multiplayer is with Google Cloud. Are the servers going to be able to request new servers to spin up on demand?
     
  14. JTovey

    JTovey

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    34
    Hi Jesse,

    Can you confirm what you are asking the question about, maybe quote the post, so that I have a bit more context for your question?

    To answer your question as best I can from what you have said thus far, yes, they are hosted on Google Cloud, and you can spin up and down instances as the need increases, though if they are left inactive for too long they are closed down again. Of course, this is not infinite, and you would have access to a limited number of instances.

    I hope this answers your question, if not, please let me know.
     
  15. BHouse

    BHouse

    Unity Technologies

    Joined:
    Jan 10, 2018
    Posts:
    66
    I can clarify a bit further. The extent of the GCP partnership varies per service. For example Multiplay server hosting continues to offer "Hybrid" bare-metal hosting with burst into the cloud. This service prefers GCP servers when using Cloud, but is also capable of leveraging AWS servers as needed.

    Other services (like matchmaking, player identity) will be hosted in Google Cloud , with maybe a few exceptions in regions like China.

    Please let us know if there's something more specific you would like to learn about.
     
  16. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    389
    Hi, I contacted Multiplay a year ago and at that moment they don't have any server in China, but they planned to co-op with a local cloud service provider. When you're saying "a few exceptions in China", is that means Multiplay is going to have a different partner in China other than Google Cloud, or the services just don't work?
     
  17. BHouse

    BHouse

    Unity Technologies

    Joined:
    Jan 10, 2018
    Posts:
    66
    Good question! It means that we need to work with other providers in China. It's something we're all considering carefully for adapting existing services (like Multiplay) as well as how we design new services, i.e. to ensure we have a plan to be able to support Chinese markets.
     
    zhuchun likes this.
  18. yaraco

    yaraco

    Joined:
    Aug 21, 2013
    Posts:
    5
  19. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    693
    Is this new multiplayer have anything to do with Google Stadia? can it work with it somehow?
     
  20. CallMeSpam

    CallMeSpam

    Joined:
    Feb 10, 2018
    Posts:
    19
    So, the first update to the GitHub in six months is not considered relevant enough to mention?
     
  21. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,871
    Stadia is a fundamentally different technology as far as delivery to the player. The only place I could see this used is entirely on Google's server side, but I'd be very surprised if Google didn't have their own networking solution they are requiring for that.
     
  22. dcorp

    dcorp

    Joined:
    Sep 6, 2017
    Posts:
    2
    Not sure if anyone could possibly help advise about a logical path to take, but this seemed like the place to check:

    I currently have a fast paced 2D twitch shooter game that I’ve been working on for over half a year. The game is for WebGL and is build with the HLAPI. The game is currently playable in a server-client architecture (though the sever currently trusts the clients) and I’ve worked around all the UNET bugs that had caused issues for me, but as latency rises my current interpolation/client prediction/lag compensation aren’t performing adequately. I noticed that with the new transport layer there is an emphasis on solid examples for lag compensation/client prediction with the FPS example which looks promising. I will obviously need to migrate from UNET eventually, but I’m not sure if the new system is ready for me to adapt. I see a couple ways I could proceed:

    (1) Stay with the HLAPI and see how the new system develops (any word if a HLAPI replacement is coming?)
    (2) Convert to the LLAPI to make it easier to transition when the time comes
    (3) Work in switching to the new transport layer now

    Hoping someone may be able to provide some advice
     
    Last edited: May 7, 2019
  23. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,871
    The new networking API is UDP based with no websockets support. This is the last update from a Unity dev on this topic I've seen:

    So I'd say #3 is out of the question, unless there's been new developments on this front.
     
  24. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    96
    Turn based multiplayer support is really a huge issue these days. It‘s only in an acceptable shape for Android & Playstore via Google Play Games Services. It‘s a mess for iOS and virtually non-existant for any other platform on a reliable scale. While there are a lot of individual solutions, none of them is truly cross-platform and widely accepted. Players want a single logon and profile management across multiple games, and not island solutions. Only Unity would be able to pull that off at large scale, so that in the future players will have a „Unity Profile“ with their Avatars, Leaderboards, Achievements, Challenges, Friends Networks etc. in one consistent place.
    If Unity would offer a Turn-based suite of features in the scope of GPGS across all the supported platforms, that would be such a huge win. Suddenly, all iOS, Android, Windows and what-have-you users could connect to play their board games, card games and all the other great turn-based stuff.
     
  25. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    782
    Can u elaborate a bit on this?
     
  26. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    96
    Uh...where should I start? ;)

    Even before Apple abandoned the Gamecenter app with iOS 10, they had a tendency of neglecting focus on gaming. API changes and sloppy bugs (like deliberately changing parameter defaults that completely reverse an API semantics if not explicitly set by the app), fixing bugs only 2 releases (= 2 years) after reporting, erratic backend and notifications performance etc. always made it a gamble to offer Gamecenter support. Whatever goes wrong with the infrastructure is blamed on your app and instantly reflects in reviews/ratings. And Apple just never had a culture of instant response to such issues. They seem not to care.
    When they abandoned Gamecenter with iOS 10, Engineers at WWDC told that this was just a first step towards a rework of the whole concept. And it was, but not to the better. The former player photos that users just loved and most apps integrated into their setups where simply taken away and replaced by lame grey circles with players initials -- to this day. Friends handling: simply vanished. API orchestration changed year over year, bombarding you with deprecations. The invitation process via iMessage is just totally confusing, working only erratically over long periods of time and just not understood by the users, and does not fit to an in-game experience.
    As of today there is NO single Unity integration for multiplayer (turn-based, real-time) left. Prime31 was the last to keep the flag up the pole, but now has stopped it also. There are just some plugins left that support leaderboards and achievements. Full stop. If you need to make a strategic decision for iOS/Unity TODAY and want to rely on a standard service, you're lost. The plugin devs defer you to the "upcoming Unity support" for multiplayer, but it doesn't look like anything you could use productively any time soon, at least not for turn-based. There are some standalone solutions out there (whose business model is running the backends -- fair enough...), but I don't think they can be a viable alternative if you don't happen to be a mainstream killer game that can sustain a complete standalone userbase. Who wants to create and maintain multiple user profiles, different for each game? People want a central infrastructure that connects their games and friends in one place. Gamecenter and Google Play Games are the right approach, and there would be room left for one more big player that offers the same across all platforms and has an undoubted reputation for long-term sustainability, performance and reliability.
    My hope is that the cooperation with Google will blend some of the GPGS scope and reliability into the (hopefully) upcoming common solution. I am for sure rather an "Apple boy" than hardcore Android fan, but that is honestly just so much better, reliable and smooth to integrate. And you have such comprehensive analytics features in you dev. console about how your game is used.
     
    pKallv likes this.
  27. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    28
    I upgraded a Unet Project to 2019.1.4f and imported the HLAPI Package. Everything looks fine ,except the one single script isn't compiling (NetworkTransformChild.cs). It's not showing any errors. I've got no warnings for anything (on any other script), it just won't load on my player prefab (Cannot be loaded. Please fix any compile errors and assign a valid script). How would I fix this?

    Alternatively, do I understand right that the new system is available now? I only need basic functionality just as connecting in local networks, synchonizing transforms and sending messages. Where would I get started to do this...
     
  28. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,871
    There's an issue with a misspelling in that script that Unity apparently is being slow to fix, which was pointed out in a few other threads (no idea if a bug was actually filed by those complaining about the issue, so that might be the cause).

    The new system is in an alpha state. Last I checked it is little more than a barebones transport. What you describe as your needs is much higher level functionality you'll have to build on top of it. There is an FPS demo using it released, which I would assume implements transform syncing though.

    Transform syncing is not all that difficult. You just as needed or at some interval send the world position and rotation to all clients, and optionally rigidbody stuff like velocity, angular velocity, etc. The only tricky part is smoothing that out on the client side, and accounting for missed updates or updates for whatever reason arriving at an irregular rate.
     
    Last edited: Jun 5, 2019
  29. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    526
    Hi,
    it seems you are all focused on realtime multiplayer (L3).
    do you have a roadmap/timeline on the Dynamic Single Player (L1) and turn-based (L2) aspects of connected games? (e.g. player identity & cloud db, virtual currencies, leaderboards, etc... )
    or you are not planning anything and we have to build our own or use gamesparks/playfab/whatever?
     
  30. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    389
    To be clear, I'm not from Unity ;)

    L3 is the hardest part, and probably the most important part in 3A games, UNET failed once, so they're focusing on it. L1 and L2 already have some alternatives, as you mentioned. Specific to L2, it can be done easily by a Node.JS backend, no problem. However, if you're looking for the state-of-art version of L2(like Dota Underlords), it's based on L3 somewhat.
     
    Joe-Censored likes this.
  31. nektariosfifes14

    nektariosfifes14

    Joined:
    Jun 25, 2015
    Posts:
    11
    will pricing be depended on concurrent users or resources used? (cpu, ram usage)